sequence-diagram JavaScript editor jQuery CSS HTML Documentation toc flowchart gfm codemirror Markdown commonmark katex markdown-editor marked markdown-writer
Need help with editor.md?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
pandao

Description

The open source embeddable online markdown editor (component).

10.4K Stars 2.0K Forks MIT License 149 Commits 481 Opened issues

Services available

Need anything else?

Editor.md

Editor.md : The open source embeddable online markdown editor (component), based on CodeMirror & jQuery & Marked.

Features

README & Examples (English)


Editor.md 是一款开源的、可嵌入的 Markdown 在线编辑器(组件),基于 CodeMirror、jQuery 和 Marked 构建。

editormd-screenshot

主要特性

Download & install

Download:

Github download

NPM install :

npm install editor.md

Bower install :

bower install editor.md

Usages

Create a Markdown editor
### Hello Editor.md !

If you using modular script loader:

Markdown to HTML
### Hello world!

See the full example: http://editor.md.ipandao.com/examples/html-preview-markdown-to-html.html

HTML to Markdown?

Sorry, Editor.md not support HTML to Markdown parsing, Maybe In the future.

Examples

https://pandao.github.io/editor.md/examples/index.html

Options

Editor.md options and default values:

{
    mode                 : "gfm",          // gfm or markdown
    name                 : "",             // Form element name for post
    value                : "",             // value for CodeMirror, if mode not gfm/markdown
    theme                : "",             // Editor.md self themes, before v1.5.0 is CodeMirror theme, default empty
    editorTheme          : "default",      // Editor area, this is CodeMirror theme at v1.5.0
    previewTheme         : "",             // Preview area theme, default empty
    markdown             : "",             // Markdown source code
    appendMarkdown       : "",             // if in init textarea value not empty, append markdown to textarea
    width                : "100%",
    height               : "100%",
    path                 : "./lib/",       // Dependents module file directory
    pluginPath           : "",             // If this empty, default use settings.path + "../plugins/"
    delay                : 300,            // Delay parse markdown to html, Uint : ms
    autoLoadModules      : true,           // Automatic load dependent module files
    watch                : true,
    placeholder          : "Enjoy Markdown! coding now...",
    gotoLine             : true,           // Enable / disable goto a line
    codeFold             : false,
    autoHeight           : false,
    autoFocus            : true,           // Enable / disable auto focus editor left input area
    autoCloseTags        : true,
    searchReplace        : true,           // Enable / disable (CodeMirror) search and replace function
    syncScrolling        : true,           // options: true | false | "single", default true
    readOnly             : false,          // Enable / disable readonly mode
    tabSize              : 4,
    indentUnit           : 4,
    lineNumbers          : true,           // Display editor line numbers
    lineWrapping         : true,
    autoCloseBrackets    : true,
    showTrailingSpace    : true,
    matchBrackets        : true,
    indentWithTabs       : true,
    styleSelectedText    : true,
    matchWordHighlight   : true,           // options: true, false, "onselected"
    styleActiveLine      : true,           // Highlight the current line
    dialogLockScreen     : true,
    dialogShowMask       : true,
    dialogDraggable      : true,
    dialogMaskBgColor    : "#fff",
    dialogMaskOpacity    : 0.1,
    fontSize             : "13px",
    saveHTMLToTextarea   : false,          // If enable, Editor will create a  tag save HTML code for form post to server-side.
    disabledKeyMaps      : [],

<pre><code>onload               : function() {},
onresize             : function() {},
onchange             : function() {},
onwatch              : null,
onunwatch            : null,
onpreviewing         : function() {},
onpreviewed          : function() {},
onfullscreen         : function() {},
onfullscreenExit     : function() {},
onscroll             : function() {},
onpreviewscroll      : function() {},

imageUpload          : false,          // Enable/disable upload
imageFormats         : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL       : "",             // Upload url
crossDomainUpload    : false,          // Enable/disable Cross-domain upload
uploadCallbackURL    : "",             // Cross-domain upload callback url

toc                  : true,           // Table of contents
tocm                 : false,          // Using [TOCM], auto create ToC dropdown menu
tocTitle             : "",             // for ToC dropdown menu button
tocDropdown          : false,          // Enable/disable Table Of Contents dropdown menu
tocContainer         : "",             // Custom Table Of Contents Container Selector
tocStartLevel        : 1,              // Said from H1 to create ToC
htmlDecode           : false,          // Open the HTML tag identification 
pageBreak            : true,           // Enable parse page break [========]
atLink               : true,           // for @link
emailLink            : true,           // for email address auto link
taskList             : false,          // Enable Github Flavored Markdown task lists
emoji                : false,          // :emoji: , Support Github emoji, Twitter Emoji (Twemoji);
                                       // Support FontAwesome icon emoji :fa-xxx: &gt; Using fontAwesome icon web fonts;
                                       // Support Editor.md logo icon emoji :editormd-logo: :editormd-logo-1x: &gt; 1~8x;
tex                  : false,          // TeX(LaTeX), based on KaTeX
flowChart            : false,          // flowChart.js only support IE9+
sequenceDiagram      : false,          // sequenceDiagram.js only support IE9+
previewCodeHighlight : true,           // Enable / disable code highlight of editor preview area

toolbar              : true,           // show or hide toolbar
toolbarAutoFixed     : true,           // on window scroll auto fixed position
toolbarIcons         : "full",         // Toolbar icons mode, options: full, simple, mini, See `editormd.toolbarModes` property.
toolbarTitles        : {},
toolbarHandlers      : {
    ucwords : function() {
        return editormd.toolbarHandlers.ucwords;
    },
    lowercase : function() {
        return editormd.toolbarHandlers.lowercase;
    }
},
toolbarCustomIcons   : {               // using html tag create toolbar icon, unused default <a> tag.
    lowercase        : "</a><a href="%5C%22javascript:;%5C%22" title='\"Lowercase\"' unselectable='\"on\"'><i class='\"fa\"' name='\"lowercase\"' style='\"font-size:24px;margin-top:'>a</i></a>",
    "ucwords"        : "<a href="%5C%22javascript:;%5C%22" title='\"ucwords\"' unselectable='\"on\"'><i class='\"fa\"' name='\"ucwords\"' style='\"font-size:20px;margin-top:'>Aa</i></a>"
},
toolbarIconTexts     : {},

lang : {  // Language data, you can custom your language.
    name        : "zh-cn",
    description : "开源在线Markdown编辑器<br>Open source online Markdown editor.",
    tocTitle    : "目录",
    toolbar     : {
        //...
    },
    button: {
        //...
    },
    dialog : {
        //...
    }
    //...
}</code></pre>
<p>}

Dependents

Changes

Change logs

License

The MIT License.

Copyright (c) 2015-2019 Pandao

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.