index.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!doctype html>
  2. <title>CodeMirror: Tornado template mode</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="../../addon/mode/overlay.js"></script>
  8. <script src="../xml/xml.js"></script>
  9. <script src="../htmlmixed/htmlmixed.js"></script>
  10. <script src="tornado.js"></script>
  11. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  12. <div id=nav>
  13. <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  14. <ul>
  15. <li><a href="../../index.html">Home</a>
  16. <li><a href="../../doc/manual.html">Manual</a>
  17. <li><a href="https://github.com/marijnh/codemirror">Code</a>
  18. </ul>
  19. <ul>
  20. <li><a href="../index.html">Language modes</a>
  21. <li><a class=active href="#">Tornado</a>
  22. </ul>
  23. </div>
  24. <article>
  25. <h2>Tornado template mode</h2>
  26. <form><textarea id="code" name="code">
  27. <!doctype html>
  28. <html>
  29. <head>
  30. <title>My Tornado web application</title>
  31. </head>
  32. <body>
  33. <h1>
  34. {{ title }}
  35. </h1>
  36. <ul class="my-list">
  37. {% for item in items %}
  38. <li>{% item.name %}</li>
  39. {% empty %}
  40. <li>You have no items in your list.</li>
  41. {% end %}
  42. </ul>
  43. </body>
  44. </html>
  45. </textarea></form>
  46. <script>
  47. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  48. lineNumbers: true,
  49. mode: "tornado",
  50. indentUnit: 4,
  51. indentWithTabs: true
  52. });
  53. </script>
  54. <p>Mode for HTML with embedded Tornado template markup.</p>
  55. <p><strong>MIME types defined:</strong> <code>text/x-tornado</code></p>
  56. </article>