Mercurial
comparison .cms/lib/codemirror/mode/jinja2/index.html @ 0:78edf6b517a0 draft
24.10
author | Coffee CMS <info@coffee-cms.ru> |
---|---|
date | Fri, 11 Oct 2024 22:40:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:78edf6b517a0 |
---|---|
1 <!doctype html> | |
2 | |
3 <title>CodeMirror: Jinja2 mode</title> | |
4 <meta charset="utf-8"/> | |
5 <link rel=stylesheet href="../../doc/docs.css"> | |
6 | |
7 <link rel="stylesheet" href="../../lib/codemirror.css"> | |
8 <script src="../../lib/codemirror.js"></script> | |
9 <script src="jinja2.js"></script> | |
10 <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> | |
11 <div id=nav> | |
12 <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a> | |
13 | |
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/codemirror5">Code</a> | |
18 </ul> | |
19 <ul> | |
20 <li><a href="../index.html">Language modes</a> | |
21 <li><a class=active href="#">Jinja2</a> | |
22 </ul> | |
23 </div> | |
24 | |
25 <article> | |
26 <h2>Jinja2 mode</h2> | |
27 <form><textarea id="code" name="code"> | |
28 {# this is a comment #} | |
29 {%- for item in li -%} | |
30 <li>{{ item.label }}</li> | |
31 {% endfor -%} | |
32 {{ item.sand == true and item.keyword == false ? 1 : 0 }} | |
33 {{ app.get(55, 1.2, true) }} | |
34 {% if app.get('_route') == ('_home') %}home{% endif %} | |
35 {% if app.session.flashbag.has('message') %} | |
36 {% for message in app.session.flashbag.get('message') %} | |
37 {{ message.content }} | |
38 {% endfor %} | |
39 {% endif %} | |
40 {{ path('_home', {'section': app.request.get('section')}) }} | |
41 {{ path('_home', { | |
42 'section': app.request.get('section'), | |
43 'boolean': true, | |
44 'number': 55.33 | |
45 }) | |
46 }} | |
47 {% include ('test.incl.html.twig') %} | |
48 | |
49 # for item in seq: | |
50 <li>{{ item }} </li> ## this comment is ignored | |
51 # endfor | |
52 # set text = "Multiline | |
53 text" | |
54 # for href, caption in [('index.html', 'Index'), | |
55 ('about.html', 'About')]: | |
56 <li><a href="{{ href }}">{{ caption }}</a></li> | |
57 # endfor | |
58 </textarea></form> | |
59 <script> | |
60 var editor = | |
61 CodeMirror.fromTextArea(document.getElementById("code"), {mode: | |
62 {name: "jinja2", htmlMode: true}}); | |
63 </script> | |
64 </article> |