manually-load-modules.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Manually load modules - Editor.md examples</title>
  6. <link rel="stylesheet" href="css/style.css" />
  7. <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
  8. </head>
  9. <body>
  10. <div id="layout">
  11. <header>
  12. <h1>手动加载模式 Manually load modules</h1>
  13. <p>在这种模式下,可以同步使用 Editor.md 实例的成员方法。</p>
  14. </header>
  15. <div id="test-editormd">
  16. <textarea style="display:none;">#### Manually load modules exmaple
  17. ```html
  18. &lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
  19. &lt;link rel="stylesheet" href="../lib/codemirror/codemirror.min.css" /&gt;
  20. &lt;link rel="stylesheet" href="../lib/codemirror/addon/dialog/dialog.css" /&gt;
  21. &lt;link rel="stylesheet" href="../lib/codemirror/addon/search/matchesonscrollbar.css" /&gt;
  22. &lt;script src="../lib/codemirror/codemirror.min.js"&gt;&lt;/script&gt;
  23. &lt;!-- Or, You can also one by one load CodeMirror modes & addons. --&gt;
  24. &lt;script src="../lib/codemirror/addons.min.js"&gt;&lt;/script&gt;
  25. &lt;script src="../lib/codemirror/modes.min.js"&gt;&lt;/script&gt;
  26. &lt;script src="../lib/marked.min.js"&gt;&lt;/script&gt;
  27. &lt;!-- if setting previewCodeHighlight == true --&gt;
  28. &lt;script src="../lib/prettify.min.js"&gt;&lt;/script&gt;
  29. &lt;!-- if setting flowchart == true, or sequence-diagram == true --&gt;
  30. &lt;script src="../lib/raphael.min.js"&gt;&lt;/script&gt;
  31. &lt;script src="../lib/underscore.min.js"&gt;&lt;/script&gt;
  32. &lt;script src="../lib/sequence-diagram.min.js"&gt;&lt;/script&gt;
  33. &lt;script src="../lib/flowchart.min.js"&gt;&lt;/script&gt;
  34. &lt;script src="../lib/jquery.flowchart.min.js"&gt;&lt;/script&gt;
  35. <!-- if setting tex == true -->
  36. &lt;link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.css" /&gt;
  37. &lt;script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.js"&gt;&lt;/script&gt;
  38. &lt;link rel="stylesheet" href="../css/editormd.css" /&gt;
  39. &lt;script src="../editormd.js"&gt;&lt;/script&gt;
  40. &lt;script type="text/javascript"&gt;
  41. $(function() {
  42. var testEditor = editormd("test-editormd", {
  43. width : "90%",
  44. height : 720,
  45. autoLoadModules : false // Manually load modules
  46. });
  47. testEditor.fullscreen(); // In Manually load mode, You can be synchronized using the member method.
  48. });
  49. &lt;/script&gt;
  50. ```
  51. #### KaTeX test
  52. $$E = mc^2$$
  53. </textarea>
  54. </div>
  55. </div>
  56. <script src="js/jquery.min.js"></script>
  57. <link rel="stylesheet" href="../lib/codemirror/codemirror.min.css" />
  58. <link rel="stylesheet" href="../lib/codemirror/addon/dialog/dialog.css" />
  59. <link rel="stylesheet" href="../lib/codemirror/addon/search/matchesonscrollbar.css" />
  60. <script src="../lib/codemirror/codemirror.min.js"></script>
  61. <!-- Or, You can also one by one load CodeMirror modes & addons. -->
  62. <script src="../lib/codemirror/addons.min.js"></script>
  63. <script src="../lib/codemirror/modes.min.js"></script>
  64. <script src="../lib/marked.min.js"></script>
  65. <!-- if setting previewCodeHighlight == true -->
  66. <script src="../lib/prettify.min.js"></script>
  67. <!-- if setting flowchart == true, or sequence-diagram == true -->
  68. <script src="../lib/raphael.min.js"></script>
  69. <script src="../lib/underscore.min.js"></script>
  70. <script src="../lib/sequence-diagram.min.js"></script>
  71. <script src="../lib/flowchart.min.js"></script>
  72. <script src="../lib/jquery.flowchart.min.js"></script>
  73. <!-- if setting tex == true -->
  74. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.css" />
  75. <script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.js"></script>
  76. <link rel="stylesheet" href="../css/editormd.css" />
  77. <script src="../editormd.js"></script>
  78. <script type="text/javascript">
  79. $(function() {
  80. var testEditor = editormd("test-editormd", {
  81. width : "90%",
  82. height : 720,
  83. path : "../lib/",
  84. tex : true,
  85. autoLoadModules : false // Enable manually load modules
  86. });
  87. testEditor.fullscreen(); // This can be synchronized using the member method
  88. });
  89. </script>
  90. </body>
  91. </html>