最近写一个博客系统,需要集成编辑器,所以我就打算集成一个markdown编辑器用来编辑文章。在网上搜,好像editor.md这个国产开源的markdown编辑器比较好。不过想吐槽是网上的教程真的。。。哈哈哈,开始我们的教程:
1.首先在editor.md官网(http://pandao.github.io/editor.md/)下载这一个编辑器。
这是下载好后的文件目录
2.将目录下的css目录,images目录,lib目录,plugins目录,src目录以及example目录中的css目录,js目录和整合一下
3.将提取后的文件放在你项目的静态文件夹中,我用的idea,我放在web目录下的static文件夹中,
写一个html如下
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>Simple example - Editor.md examples</title>
<link rel="stylesheet" href="/static/Admin/editor/css/style.css" />
<link rel="stylesheet" href="/static/Admin/editor/css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/static/Public/css/bootstrap_button.css">\
<style>
#submit_button{
display:block;
margin-left: 42%;
margin-top: 2em;
margin-bottom: 2em;
}
.input{