index.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!doctype html>
  2. <title>CodeMirror: Django 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="django.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/codemirror/codemirror">Code</a>
  18. </ul>
  19. <ul>
  20. <li><a href="../index.html">Language modes</a>
  21. <li><a class=active href="#">Django</a>
  22. </ul>
  23. </div>
  24. <article>
  25. <h2>Django template mode</h2>
  26. <form><textarea id="code" name="code">
  27. <!doctype html>
  28. <html>
  29. <head>
  30. <title>My Django web application</title>
  31. </head>
  32. <body>
  33. <h1>
  34. {{ page.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. {% endfor %}
  42. </ul>
  43. </body>
  44. </html>
  45. </textarea></form>
  46. <script>
  47. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  48. lineNumbers: true,
  49. mode: "django",
  50. indentUnit: 4,
  51. indentWithTabs: true
  52. });
  53. </script>
  54. <p>Mode for HTML with embedded Django template markup.</p>
  55. <p><strong>MIME types defined:</strong> <code>text/x-django</code></p>
  56. </article>