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.

179 lines
8.1 KiB

2 months ago
  1. <!doctype html>
  2. <title>CodeMirror 5</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="lib/codemirror.css">
  5. <link rel=stylesheet href="doc/docs.css">
  6. <script src="lib/codemirror.js"></script>
  7. <script src="mode/xml/xml.js"></script>
  8. <script src="mode/javascript/javascript.js"></script>
  9. <script src="mode/css/css.js"></script>
  10. <script src="mode/htmlmixed/htmlmixed.js"></script>
  11. <script src="addon/edit/matchbrackets.js"></script>
  12. <script src="doc/activebookmark.js"></script>
  13. <style>
  14. .CodeMirror { height: auto; border: 1px solid #ddd; }
  15. .CodeMirror-scroll { max-height: 200px; }
  16. .CodeMirror pre { padding-left: 7px; line-height: 1.25; }
  17. .banner { background: #ffc; padding: 6px; border-bottom: 2px solid silver; text-align: center }
  18. </style>
  19. <div class=banner>
  20. Note that this is the website for CodeMirror 5. <a href="https://codemirror.net/">Version 6</a> is the current version.
  21. </div>
  22. <div id=nav>
  23. <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="doc/logo.png"></a>
  24. <ul>
  25. <li><a class=active data-default="true" href="#description">Home</a>
  26. <li><a href="doc/manual.html">Manual</a>
  27. <li><a href="https://github.com/codemirror/codemirror5">Code</a>
  28. <li><a href="https://codemirror.net/">Version 6</a>
  29. </ul>
  30. <ul>
  31. <li><a href="#features">Features</a>
  32. <li><a href="#community">Community</a>
  33. <li><a href="#browsersupport">Browser support</a>
  34. </ul>
  35. </div>
  36. <article>
  37. <section id=description class=first>
  38. <p><strong>CodeMirror</strong> is a versatile text editor
  39. implemented in JavaScript for the browser. It is specialized for
  40. editing code, and comes with a number of <a href="mode/index.html">language modes</a> and <a href="doc/manual.html#addons">addons</a>
  41. that implement more advanced editing functionality.</p>
  42. <p>A rich <a href="doc/manual.html#api">programming API</a> and a
  43. CSS <a href="doc/manual.html#styling">theming</a> system are
  44. available for customizing CodeMirror to fit your application, and
  45. extending it with new functionality.</p>
  46. </section>
  47. <section id=demo>
  48. <h2>This is CodeMirror</h2>
  49. <form style="position: relative; margin-top: .5em;"><textarea id=demotext>
  50. <!-- Create a simple CodeMirror instance -->
  51. <link rel="stylesheet" href="lib/codemirror.css">
  52. <script src="lib/codemirror.js"></script>
  53. <script>
  54. var editor = CodeMirror.fromTextArea(myTextarea, {
  55. lineNumbers: true
  56. });
  57. </script></textarea>
  58. <select id="demolist" onchange="document.location = this.options[this.selectedIndex].value;">
  59. <option value="#">Other demos...</option>
  60. <option value="demo/complete.html">Autocompletion</option>
  61. <option value="demo/folding.html">Code folding</option>
  62. <option value="demo/theme.html">Themes</option>
  63. <option value="mode/htmlmixed/index.html">Mixed language modes</option>
  64. <option value="demo/bidi.html">Bi-directional text</option>
  65. <option value="demo/variableheight.html">Variable font sizes</option>
  66. <option value="demo/search.html">Search interface</option>
  67. <option value="demo/vim.html">Vim bindings</option>
  68. <option value="demo/emacs.html">Emacs bindings</option>
  69. <option value="demo/sublime.html">Sublime Text bindings</option>
  70. <option value="demo/tern.html">Tern integration</option>
  71. <option value="demo/merge.html">Merge/diff interface</option>
  72. <option value="demo/fullscreen.html">Full-screen editor</option>
  73. <option value="demo/simplescrollbars.html">Custom scrollbars</option>
  74. </select></form>
  75. <script>
  76. var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), {
  77. lineNumbers: true,
  78. mode: "text/html",
  79. matchBrackets: true
  80. });
  81. </script>
  82. <div class=actions>
  83. Get the current version: <a href="https://codemirror.net/5/codemirror.zip">5.65.16</a>.<br>
  84. You can see the <a href="https://github.com/codemirror/codemirror5" title="GitHub repository">code</a>,<br>
  85. read the <a href="doc/releases.html">release notes</a>,<br>
  86. or study the <a href="doc/manual.html">user manual</a>.
  87. </div>
  88. </section>
  89. <section id=features>
  90. <h2>Features</h2>
  91. <ul>
  92. <li>Support for <a href="mode/index.html">over 100 languages</a> out of the box
  93. <li>A powerful, <a href="mode/htmlmixed/index.html">composable</a> language mode <a href="doc/manual.html#modeapi">system</a>
  94. <li><a href="doc/manual.html#addon_show-hint">Autocompletion</a> (<a href="demo/xmlcomplete.html">XML</a>)
  95. <li><a href="doc/manual.html#addon_foldcode">Code folding</a>
  96. <li><a href="doc/manual.html#option_extraKeys">Configurable</a> keybindings
  97. <li><a href="demo/vim.html">Vim</a>, <a href="demo/emacs.html">Emacs</a>, and <a href="demo/sublime.html">Sublime Text</a> bindings
  98. <li><a href="doc/manual.html#addon_search">Search and replace</a> interface
  99. <li><a href="doc/manual.html#addon_matchbrackets">Bracket</a> and <a href="doc/manual.html#addon_matchtags">tag</a> matching
  100. <li>Support for <a href="demo/buffers.html">split views</a>
  101. <li><a href="doc/manual.html#addon_lint">Linter integration</a>
  102. <li><a href="demo/variableheight.html">Mixing font sizes and styles</a>
  103. <li><a href="demo/theme.html">Various themes</a>
  104. <li>Able to <a href="demo/resize.html">resize to fit content</a>
  105. <li><a href="doc/manual.html#mark_replacedWith">Inline</a> and <a href="doc/manual.html#addLineWidget">block</a> widgets
  106. <li>Programmable <a href="demo/marker.html">gutters</a>
  107. <li>Making ranges of text <a href="doc/manual.html#markText">styled, read-only, or atomic</a>
  108. <li><a href="demo/bidi.html">Bi-directional text</a> support
  109. <li>Many other <a href="doc/manual.html#api">methods</a> and <a href="doc/manual.html#addons">addons</a>...
  110. </ul>
  111. </section>
  112. <section id=community>
  113. <h2>Community</h2>
  114. <p>CodeMirror is an open-source project shared under
  115. an <a href="LICENSE">MIT license</a>. It is the editor used in the
  116. dev tools for
  117. <a href="https://hacks.mozilla.org/2013/11/firefox-developer-tools-episode-27-edit-as-html-codemirror-more/">Firefox</a>,
  118. <a href="https://developers.google.com/chrome-developer-tools/">Chrome</a>,
  119. and <a href="https://developer.apple.com/safari/tools/">Safari</a>, in <a href="http://www.lighttable.com/">Light
  120. Table</a>, <a href="http://brackets.io/">Adobe
  121. Brackets</a>, <a href="http://blog.bitbucket.org/2013/05/14/edit-your-code-in-the-cloud-with-bitbucket/">Bitbucket</a>,
  122. and <a href="doc/realworld.html">many other projects</a>.</p>
  123. <p>Development and bug tracking happens
  124. on <a href="https://github.com/codemirror/CodeMirror/">github</a>
  125. (<a href="http://marijnhaverbeke.nl/git/codemirror">alternate git
  126. repository</a>).
  127. Please <a href="https://codemirror.net/5/doc/reporting.html">read these
  128. pointers</a> before submitting a bug. Use pull requests to submit
  129. patches. All contributions must be released under the same MIT
  130. license that CodeMirror uses.</p>
  131. <p>Discussion around the project is done on
  132. a <a href="https://discuss.codemirror.net">discussion forum</a>.
  133. Announcements related to the project, such as new versions, are
  134. posted in the
  135. forum's <a href="https://discuss.codemirror.net/c/announce">"announce"</a>
  136. category. If needed, you can
  137. contact <a href="mailto:marijn@haverbeke.berlin">the maintainer</a>
  138. directly. We aim to be an inclusive, welcoming community. To make
  139. that explicit, we have
  140. a <a href="http://contributor-covenant.org/version/1/1/0/">code of
  141. conduct</a> that applies to communication around the project.</p>
  142. </section>
  143. <section id=browsersupport>
  144. <h2>Browser support</h2>
  145. <p>The <em>desktop</em> versions of the following browsers,
  146. in <em>standards mode</em> (HTML5 <code>&lt;!doctype html></code>
  147. recommended) are supported:</p>
  148. <table style="margin-bottom: 1em">
  149. <tr><th>Firefox</th><td>version 4 and up</td></tr>
  150. <tr><th>Chrome</th><td>any version</td></tr>
  151. <tr><th>Safari</th><td>version 5.2 and up</td></tr>
  152. <tr><th style="padding-right: 1em;">Internet Explorer/Edge</th><td>version 8 and up</td></tr>
  153. <tr><th>Opera</th><td>version 9 and up</td></tr>
  154. </table>
  155. <p>Support for modern mobile browsers is experimental. Recent
  156. versions of the iOS browser and Chrome on Android should work
  157. pretty well.</p>
  158. </section>
  159. </article>