当前位置:网站首页>Markdown编辑器Editor.md插件的使用
Markdown编辑器Editor.md插件的使用
2022-07-07 06:11:00 【HHYZBC】
官网:
Editor.md - 开源在线 Markdown 编辑器 (pandao.github.io)
https://pandao.github.io/editor.md/index.html配置项:
var testEditor;
testEditor = editormd("test-editormd", {
placeholder:'本编辑器支持Markdown编辑,左边编写,右边预览', //默认显示的文字,这里就不解释了
width: "90%",
height: 640,
syncScrolling: "single",
path: "lib/js/editor.md-master/lib/", //你的path路径(原资源文件中lib包在我们项目中所放的位置)
theme: "dark",//工具栏主题
previewTheme: "dark",//预览主题
editorTheme: "pastel-on-dark",//编辑主题
saveHTMLToTextarea: true,
emoji: false,
taskList: true,
tocm: true, // Using [TOCM]
tex: true, // 开启科学公式TeX语言支持,默认关闭
flowChart: true, // 开启流程图支持,默认关闭
sequenceDiagram: true, // 开启时序/序列图支持,默认关闭,
toolbarIcons : function() { //自定义工具栏,后面有详细介绍
return editormd.toolbarModes['simple']; // full, simple, mini
},
});
//上面的挑有用的写上去就行获取Markdown格式的文本
document.querySelector('.editormd-markdown-textarea').value 获取markdown渲染过的文章
document.querySelector('.markdown-body').textContent,自定义工具栏
工具栏分为三组,full, simple, mini这三个,可以选择,也可以自由的设置工具栏,自由的设置工具栏在官网中有写,在这里就只介绍3组。
t.toolbarModes={
full:["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","reference-link","image","code","preformatted-text","code-block","table","datetime","emoji","html-entities","pagebreak","|","goto-line","watch","preview","fullscreen","clear","search","|","help","info"],
simple:["undo","redo","|","bold","del","italic","quote","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","watch","preview","fullscreen","|","help","info"],
mini:["undo","redo","|","watch","preview","|","help","info"]
}每一个标签表示一个工具,也可以随意使用上面的标签自定义工具栏,每个标签具体表示的工具官网上没有,所以只能与工具栏对照一下才行了
边栏推荐
- Several ways of lambda used in functions in kotlin (higher-order functions)
- [kuangbin]专题十五 数位DP
- Teach you how to select PCB board by hand (II)
- Basic data types and string types are converted to each other
- Go语言中,函数是一种类型
- NCS Chengdu New Electric interview Experience
- Greenplum6.x搭建_环境配置
- 为什么要选择云原生数据库
- 数据分析方法论与前人经验总结2【笔记干货】
- Opencv converts 16 bit image data to 8 bits and 8 to 16
猜你喜欢

如何在HarmonyOS应用中集成App Linking服务

IP地址的类别

A single game with goods increased by 100000, and the rural anchor sold men's clothes on top of the list?

NCS Chengdu Xindian interview experience

Appeler l'interface du moteur de création du service multimédia de jeu Huawei renvoie le Code d'erreur 1002, le message d'erreur: les paramètres sont l'erreur

調用華為遊戲多媒體服務的創建引擎接口返回錯誤碼1002,錯誤信息:the params is error

数字三角形模型 AcWing 275. 传纸条

About using CDN based on Kangle and EP panel

Calling the creation engine interface of Huawei game multimedia service returns error code 1002, error message: the params is error

Implementation of navigation bar at the bottom of applet
随机推荐
Through the "last mile" of legal services for the masses, fangzheng Puhua labor and personnel law self-service consulting service platform has been frequently "praised"
Greenplum6.x监控软件搭建
[step on the pit] Nacos registration has been connected to localhost:8848, no available server
Basic data types and string types are converted to each other
Qt Charts使用(重写QChartView,实现一些自定义功能)
Thirteen forms of lambda in kotlin
Other 7 features of TCP [sliding window mechanism ▲]
調用華為遊戲多媒體服務的創建引擎接口返回錯誤碼1002,錯誤信息:the params is error
Required String parameter ‘XXX‘ is not present
JS operation
AVL balanced binary search tree
说一个软件创业项目,有谁愿意投资的吗?
关于基于kangle和EP面板使用CDN
Introduction to data fragmentation
23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP
NCS Chengdu New Electric interview Experience
Rapid integration of authentication services - harmonyos platform
Download and install orcale database11.2.0.4
Teach you how to select PCB board by hand (II)
In go language, function is a type