在HTML中集成插件使用Markdown编辑器
1 下载
2 解压拷贝
将以下文件拷贝到项目中新建 static—>lib----->editormd中
3. 引用
- 引用css
<link rel="stylesheet" href="../static/lib/editormd/css/editormd.min.css"/>
- 插入到body中
<div id="test-editormd">
<textarea style="display:none;">[TOC]
#### Disabled options
- TeX (Based on KaTeX);
- Emoji;
- Task lists;
- HTML tags decode;
- Flowchart and Sequence Diagram;
#### Editor.md directory
editor.md/
lib/
css/
scss/
tests/
fonts/
images/
plugins/
examples/
languages/
editormd.js
...
</textarea>
</div>
4 编写script
- 引入js
<script src="../static/lib/editormd/editormd.min.js"></script>
var testEditor;
$(function() {
testEditor = editormd("test-editormd", {
width : "90%",
height : 640,
syncScrolling : "single",
path : "../lib/"
});
/*
// or
testEditor = editormd({
id : "test-editormd",
width : "90%",
height : 640,
path : "../lib/"
});
*/
});
5. 注意
在引入文件时,要引入正确路径