axllent/silverstripe-gfmarkdown 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

axllent/silverstripe-gfmarkdown

Composer 安装命令:

composer require axllent/silverstripe-gfmarkdown

包简介

GitHub Flavored Markdown editing & rendering using Parsedown

README 文档

README

This module adds a field and a data type that allows for Markdown editing in the CMS using the Github Flavoured Markdown parser Parsedown to render the html.

It includes the Ace editor for CMS editing.

Requirements

  • Silverstripe ^4.0 || ^5.0

Installation

composer require axllent/silverstripe-gfmarkdown

Usage

Use the Markdown data type as your fields data type, and the MarkdownEditor field in the CMS for editing.

Example:

<?php

use Axllent\Gfmarkdown\Forms\MarkdownEditor;

class MyPage extends Page
{
    public static $db = array(
        'MarkdownContent' => 'Markdown'
    );

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        // If you want the Ace markdown editor in the CMS
        $fields->addFieldToTab('Root.Main',
            MarkdownEditor::create('MarkdownContent')
                ->setTheme('github')            // set theme
                ->setRows(20)                   // set number of rows in CMS
                ->setWrap(false)                // disable word wrapping
                ->setHighlightActiveLine(true)  // enable line highlighting
        );

        return $fields;
    }
}

Silverstripe Template:

<div class="content">
    $MarkdownContent  <!-- Will show as rendered html -->
</div>

统计信息

  • 总下载量: 4.93k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固