Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 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
<link rel="stylesheet" href="../../theme/mdn-like.css">
7
<script src="../../lib/codemirror.js"></script>
8
<script src="../../addon/mode/overlay.js"></script>
9
<script src="../xml/xml.js"></script>
10
<script src="../htmlmixed/htmlmixed.js"></script>
11
<script src="django.js"></script>
12
<style type="text/css">
13
    .CodeMirror {
14
        border-top: 1px solid black;
15
        border-bottom: 1px solid black;
16
    }
17
</style>
18
<div id=nav>
19
    <a href="http://codemirror.net">
20
        <h1>CodeMirror</h1>
21
        <img id=logo src="../../doc/logo.png">
22
    </a>
23
    <ul>
24
        <li>
25
            <a href="../../index.html">Home</a>
26
            <li>
27
                <a href="../../doc/manual.html">Manual</a>
28
                <li>
29
                    <a href="https://github.com/codemirror/codemirror">Code</a>
30
    </ul>
31
    <ul>
32
        <li>
33
            <a href="../index.html">Language modes</a>
34
            <li>
35
                <a class=active href="#">Django</a>
36
    </ul>
37
</div>
38
<article>
39
    <h2>Django template mode</h2>
40
    <form>
41
        <textarea id="code" name="code">
42
            <!doctype html>
43
            <html>
44
 
45
            <head>
46
                <title>My Django web application</title>
47
            </head>
48
 
49
            <body>
50
                <h1> {{ page.title|capfirst }} </h1>
51
                <ul class="my-list"> {# traverse a list of items and produce links to their views. #} {% for item in items %}
52
                    <li>
53
                        <a href="{% url 'item_view' item.name|slugify %}"> {{ item.name }} </a>
54
                    </li> {% empty %}
55
                    <li>You have no items in your list.</li> {% endfor %} </ul> {% comment "this is a forgotten footer" %}
56
                <footer></footer> {% endcomment %} </body>
57
 
58
            </html>
59
        </textarea>
60
    </form>
61
    <script>
62
        var editor = CodeMirror.fromTextArea(document.getElementById("code"),
63
        {
64
            lineNumbers: true,
65
            mode: "django",
66
            indentUnit: 2,
67
            indentWithTabs: true,
68
            theme: "mdn-like"
69
        });
70
    </script>
71
    <p>Mode for HTML with embedded Django template markup.</p>
72
    <p>
73
        <strong>MIME types defined:</strong> <code>text/x-django</code></p>
74
</article>