2
0

index.html 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CodeMirror: Jinja2 mode</title>
  6. <link rel="stylesheet" href="../../lib/codemirror.css">
  7. <script src="../../lib/codemirror.js"></script>
  8. <script src="jinja2.js"></script>
  9. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  10. <link rel="stylesheet" href="../../doc/docs.css">
  11. </head>
  12. <body>
  13. <h1>CodeMirror: Jinja2 mode</h1>
  14. <form><textarea id="code" name="code">
  15. &lt;html style="color: green"&gt;
  16. &lt;!-- this is a comment --&gt;
  17. &lt;head&gt;
  18. &lt;title&gt;Jinja2 Example&lt;/title&gt;
  19. &lt;/head&gt;
  20. &lt;body&gt;
  21. &lt;ul&gt;
  22. {# this is a comment #}
  23. {%- for item in li -%}
  24. &lt;li&gt;
  25. {{ item.label }}
  26. &lt;/li&gt;
  27. {% endfor -%}
  28. &lt;/ul&gt;
  29. &lt;/body&gt;
  30. &lt;/html&gt;
  31. </textarea></form>
  32. <script>
  33. var editor =
  34. CodeMirror.fromTextArea(document.getElementById("code"), {mode:
  35. {name: "jinja2", htmlMode: true}});
  36. </script>
  37. </body>
  38. </html>