You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
5.8 KiB

4 years ago
  1. # Editor.md
  2. ![](https://pandao.github.io/editor.md/images/logos/editormd-logo-180x180.png)
  3. ![](https://img.shields.io/github/stars/pandao/editor.md.svg)
  4. ![](https://img.shields.io/github/forks/pandao/editor.md.svg)
  5. ![](https://img.shields.io/github/tag/pandao/editor.md.svg)
  6. ![](https://img.shields.io/github/release/pandao/editor.md.svg)
  7. ![](https://img.shields.io/github/issues/pandao/editor.md.svg)
  8. ![](https://img.shields.io/bower/v/editor.md.svg)
  9. **Editor.md** : The open source embeddable online markdown editor (component), based on CodeMirror & jQuery & Marked.
  10. ### Features
  11. - Support Standard Markdown / CommonMark and GFM (GitHub Flavored Markdown);
  12. - Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...;
  13. - Markdown Extras : Support [ToC (Table of Contents)](https://pandao.github.io/editor.md/examples/toc.html), [Emoji](https://pandao.github.io/editor.md/examples/emoji.html), [Task lists](https://pandao.github.io/editor.md/examples/task-lists.html), [@Links](https://pandao.github.io/editor.md/examples/@links.html)...;
  14. - Compatible with all major browsers (IE8+), compatible Zepto.js and iPad;
  15. - Support [decode & fliter of the HTML tags & attributes](https://pandao.github.io/editor.md/examples/html-tags-decode.html);
  16. - Support [TeX (LaTeX expressions, Based on KaTeX)](https://pandao.github.io/editor.md/examples/katex.html), [Flowchart](https://pandao.github.io/editor.md/examples/flowchart.html) and [Sequence Diagram](https://pandao.github.io/editor.md/examples/sequence-diagram.html) of Markdown extended syntax;
  17. - Support AMD/CMD (Require.js & Sea.js) Module Loader, and Custom/define editor plugins;
  18. [README & Examples (English)](https://pandao.github.io/editor.md/en.html)
  19. --------
  20. **Editor.md** 是一款开源的、可嵌入的 Markdown 在线编辑器(组件),基于 CodeMirror、jQuery 和 Marked 构建。
  21. ![editormd-screenshot](https://pandao.github.io/editor.md/examples/images/editormd-screenshot.png "editormd-screenshot")
  22. #### 主要特性
  23. - 支持通用 Markdown / CommonMark 和 GFM (GitHub Flavored Markdown) 风格的语法,也可[变身为代码编辑器](https://pandao.github.io/editor.md/examples/change-mode.html);
  24. - 支持实时预览、图片(跨域)上传、预格式文本/代码/表格插入、代码折叠、跳转到行、搜索替换、只读模式、自定义样式主题和多语言语法高亮等功能;
  25. - 支持 [ToC(Table of Contents)](https://pandao.github.io/editor.md/examples/toc.html)、[Emoji表情](https://pandao.github.io/editor.md/examples/emoji.html)、[Task lists](https://pandao.github.io/editor.md/examples/task-lists.html)、[@链接](https://pandao.github.io/editor.md/examples/@links.html)等 Markdown 扩展语法;
  26. - 支持 TeX 科学公式(基于 [KaTeX](https://pandao.github.io/editor.md/examples/katex.html))、流程图 [Flowchart](https://pandao.github.io/editor.md/examples/flowchart.html) 和 [时序图 Sequence Diagram](https://pandao.github.io/editor.md/examples/sequence-diagram.html);
  27. - 支持[识别和解析 HTML 标签,并且支持自定义过滤标签及属性解析](https://pandao.github.io/editor.md/examples/html-tags-decode.html),具有可靠的安全性和几乎无限的扩展性;
  28. - 支持 AMD / CMD 模块化加载(支持 [Require.js](https://pandao.github.io/editor.md/examples/use-requirejs.html) & [Sea.js](https://pandao.github.io/editor.md/examples/use-seajs.html)),并且支持[自定义扩展插件](https://pandao.github.io/editor.md/examples/define-plugin.html);
  29. - 兼容主流的浏览器(IE8+)和 [Zepto.js](https://pandao.github.io/editor.md/examples/use-zepto.html),且支持 iPad 等平板设备;
  30. #### Examples
  31. [https://pandao.github.io/editor.md/examples/index.html](https://pandao.github.io/editor.md/examples/index.html)
  32. #### Download & install
  33. [Github download](https://github.com/pandao/editor.md/archive/master.zip)
  34. Bower install :
  35. ```shell
  36. bower install editor.md
  37. ```
  38. #### Usages
  39. HTML:
  40. ```html
  41. <link rel="stylesheet" href="editormd.min.css" />
  42. <div id="editormd">
  43. <textarea style="display:none;">### Hello Editor.md !</textarea>
  44. </div>
  45. ```
  46. > Tip: Editor.md can auto append `<textarea>` tag;
  47. javascript:
  48. ```html
  49. <script src="jquery.min.js"></script>
  50. <script src="editormd.min.js"></script>
  51. <script type="text/javascript">
  52. $(function() {
  53. var editor = editormd("editormd", {
  54. path : "../lib/" // Autoload modules mode, codemirror, marked... dependents libs path
  55. });
  56. /*
  57. // or
  58. var editor = editormd({
  59. id : "editormd",
  60. path : "../lib/"
  61. });
  62. */
  63. });
  64. </script>
  65. ```
  66. Using modular script loader :
  67. - [Using Require.js](https://github.com/pandao/editor.md/tree/master/examples/use-requirejs.html)
  68. - [Using Sea.js](https://github.com/pandao/editor.md/tree/master/examples/use-seajs.html)
  69. #### Dependents
  70. - [CodeMirror](http://codemirror.net/ "CodeMirror")
  71. - [marked](https://github.com/chjj/marked "marked")
  72. - [jQuery](http://jquery.com/ "jQuery")
  73. - [FontAwesome](http://fontawesome.io/ "FontAwesome")
  74. - [github-markdown.css](https://github.com/sindresorhus/github-markdown-css "github-markdown.css")
  75. - [KaTeX](http://khan.github.io/KaTeX/ "KaTeX")
  76. - [prettify.js](http://code.google.com/p/google-code-prettify/ "prettify.js")
  77. - [Rephael.js](http://raphaeljs.com/ "Rephael.js")
  78. - [flowchart.js](http://adrai.github.io/flowchart.js/ "flowchart.js")
  79. - [sequence-diagram.js](http://bramp.github.io/js-sequence-diagrams/ "sequence-diagram.js")
  80. - [Prefixes.scss](https://github.com/pandao/prefixes.scss "Prefixes.scss")
  81. #### Changes
  82. [Change logs](https://github.com/pandao/editor.md/blob/master/CHANGE.md)
  83. #### License
  84. The MIT License.
  85. Copyright (c) 2015 Pandao