openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

index.html (2196B)


      1 <!doctype html>
      2 
      3 <title>CodeMirror: Handlebars 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="../../addon/mode/simple.js"></script>
     10 <script src="../../addon/mode/multiplex.js"></script>
     11 <script src="../xml/xml.js"></script>
     12 <script src="handlebars.js"></script>
     13 <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
     14 <div id=nav>
     15   <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
     16 
     17   <ul>
     18     <li><a href="../../index.html">Home</a>
     19     <li><a href="../../doc/manual.html">Manual</a>
     20     <li><a href="https://github.com/codemirror/codemirror">Code</a>
     21   </ul>
     22   <ul>
     23     <li><a href="../index.html">Language modes</a>
     24     <li><a class=active href="#">HTML mixed</a>
     25   </ul>
     26 </div>
     27 
     28 <article>
     29 <h2>Handlebars</h2>
     30 <form><textarea id="code" name="code">
     31 {{> breadcrumbs}}
     32 
     33 {{!--
     34   You can use the t function to get
     35   content translated to the current locale, es:
     36   {{t 'article_list'}}
     37 --}}
     38 
     39 <h1>{{t 'article_list'}}</h1>
     40 
     41 {{! one line comment }}
     42 
     43 {{#each articles}}
     44   {{~title}}
     45   <p>{{excerpt body size=120 ellipsis=true}}</p>
     46 
     47   {{#with author}}
     48     written by {{first_name}} {{last_name}}
     49     from category: {{../category.title}}
     50     {{#if @../last}}foobar!{{/if}}
     51   {{/with~}}
     52 
     53   {{#if promoted.latest}}Read this one! {{else}} This is ok! {{/if}}
     54 
     55   {{#if @last}}<hr>{{/if}}
     56 {{/each}}
     57 
     58 {{#form new_comment}}
     59   <input type="text" name="body">
     60 {{/form}}
     61 
     62 </textarea></form>
     63     <script>
     64       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
     65         lineNumbers: true,
     66         matchBrackets: true,
     67         mode: {name: "handlebars", base: "text/html"}
     68       });
     69     </script>
     70     
     71     <p>Handlebars syntax highlighting for CodeMirror.</p>
     72 
     73     <p><strong>MIME types defined:</strong> <code>text/x-handlebars-template</code></p>
     74 
     75     <p>Supported options: <code>base</code> to set the mode to
     76     wrap. For example, use</p>
     77     <pre>mode: {name: "handlebars", base: "text/html"}</pre>
     78     <p>to highlight an HTML template.</p>
     79 </article>