scripts/CodeMirror/mode/twig/index.html (view raw)
1<!doctype html>
2
3<title>CodeMirror: Twig 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="twig.js"></script>
10<script src="../xml/xml.js"></script>
11<script src="../../addon/mode/multiplex.js"></script>
12<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
13<div id=nav>
14 <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
15
16 <ul>
17 <li><a href="../../index.html">Home</a>
18 <li><a href="../../doc/manual.html">Manual</a>
19 <li><a href="https://github.com/codemirror/codemirror">Code</a>
20 </ul>
21 <ul>
22 <li><a href="../index.html">Language modes</a>
23 <li><a class=active href="#">Twig</a>
24 </ul>
25</div>
26
27<article>
28<h2>Twig mode</h2>
29<form><textarea id="code" name="code">
30{% extends "layout.twig" %}
31{% block title %}CodeMirror: Twig mode{% endblock %}
32{# this is a comment #}
33{% block content %}
34 {% for foo in bar if foo.baz is divisible by(3) %}
35 Hello {{ foo.world }}
36 {% else %}
37 {% set msg = "Result not found" %}
38 {% include "empty.twig" with { message: msg } %}
39 {% endfor %}
40{% endblock %}
41</textarea></form>
42 <script>
43 var editor =
44 CodeMirror.fromTextArea(document.getElementById("code"), {mode:
45 {name: "twig", base: "text/html"}});
46 </script>
47 </article>