Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Markdown在线编辑
|
||||
*/
|
||||
|
||||
namespace plugin\dev\markdown;
|
||||
|
||||
use app\Plugin;
|
||||
|
||||
class App extends Plugin
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
return $this->view();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
{extend name="common/plugin_layout" /}
|
||||
{block name="title"}{$plugin.title} - {:config_get('title')}{/block}
|
||||
{block name="main"}
|
||||
<link rel="stylesheet" href="{$cdn_npm}[email protected]/css/editormd.min.css">
|
||||
<div class="container-fluid" id="app">
|
||||
<div class="col-12 center-block">
|
||||
<div class="card card-preview">
|
||||
<div class="card-inner mt-3">
|
||||
<div class="nya-title nk-ibx-action-item progress-rating">
|
||||
<span class="nk-menu-text font-weight-bold">Markdown在线编辑</span>
|
||||
</div>
|
||||
<div id="editor">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script src="{$cdn_npm}[email protected]/editormd.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
var editor = editormd("editor", {
|
||||
width: "100%",
|
||||
height: "600px",
|
||||
path : "{$cdn_npm}[email protected]/lib/",
|
||||
// theme : "dark",
|
||||
// previewTheme : "dark",
|
||||
// editorTheme : "pastel-on-dark",
|
||||
markdown : '## Hello World',
|
||||
codeFold: true,
|
||||
//syncScrolling : false,
|
||||
saveHTMLToTextarea: true, // 保存 HTML 到 Textarea
|
||||
searchReplace: true,
|
||||
//watch : false, // 关闭实时预览
|
||||
htmlDecode: "style,script,iframe|on*", // 开启 HTML 标签解析,为了安全性,默认不开启
|
||||
//toolbar : false, //关闭工具栏
|
||||
//previewCodeHighlight : false, // 关闭预览 HTML 的代码块高亮,默认开启
|
||||
emoji: true,
|
||||
taskList: true,
|
||||
tocm: true, // Using [TOCM]
|
||||
tex: true, // 开启科学公式TeX语言支持,默认关闭
|
||||
flowChart: true, // 开启流程图支持,默认关闭
|
||||
sequenceDiagram: true, // 开启时序/序列图支持,默认关闭,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user