# netnrmd **Repository Path**: phpu/netnrmd ## Basic Information - **Project Name**: netnrmd - **Description**: NetnrMD编辑器(jQuery + Monaco Editor 编辑器 + Marked 解析 + DOMPurify 清洗 + highlight 代码高亮) - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: https://md.netnr.com - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2020-12-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README English | [简体中文](README_zh-CN.md) # NetnrMD Editor jQuery + Monaco Editor + Marked Parsing + DOMPurify Cleaning + highlight > ### [CHANGELOG](changelog.md) ### Install ```html
Loading ...
``` ### Options ```js var nmd = new netnrmd('#editor', { //View, 1 editor, 2 split screen, 3 preview, default 2 viewmodel: 2 //Editor font size fontsize: 16, height: 300, //Delay Parsing (ms) defer: 300, //Auto save key, default netnrmd_markdown, corresponding configuration is needed when there are multiple netnrmd editors on a page storekey: "key", //Changes are automatically saved by default autosave: true, prefixkey: 'Ctrl+', //Before rendering the callback viewbefore: function () { console.log(this); }, //Markdown editor changes when callback input: function () { console.log(this); }, //Trigger command callback cmdcallback: function (cmd) { console.log(this); } }); ``` ### Function ```js var nmd = new netnrmd('#editor'); console.log(nmd); //Focus editor nmd.focus(); //set height nmd.height(200); //View switching, default 2, 1, 3 cycle nmd.toggleView(); //View editor nmd.toggleView(1); //View editor and preview nmd.toggleView(2); //View preview nmd.toggleView(3); //set markdown nmd.setmd(md); //get markdown nmd.getmd(); //set html nmd.sethtml(html); //get html nmd.gethtml(); //render nmd.render(); //hide nmd.hide(); //hide toolbar nmd.hide('toolbar'); //show nmd.show(); //show toolbar nmd.show('toolbar'); //set localStorage nmd.setstore(); //get localStorage nmd.getstore(); ```