all repos — NoPaste @ 29b774f090102303e43cf939b38ac2083e62d9f1

Resurrected - The PussTheCat.org fork of NoPaste

scripts/CodeMirror/mode/slim/index.html (view raw)

 1<!doctype html>
 2
 3<title>CodeMirror: SLIM 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<link rel="stylesheet" href="../../theme/ambiance.css">
 9<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
10<script src="https://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
11<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
12<script src="../../lib/codemirror.js"></script>
13<script src="../xml/xml.js"></script>
14<script src="../htmlembedded/htmlembedded.js"></script>
15<script src="../htmlmixed/htmlmixed.js"></script>
16<script src="../coffeescript/coffeescript.js"></script>
17<script src="../javascript/javascript.js"></script>
18<script src="../ruby/ruby.js"></script>
19<script src="../markdown/markdown.js"></script>
20<script src="slim.js"></script>
21<style>.CodeMirror {background: #f8f8f8;}</style>
22<div id=nav>
23  <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
24
25  <ul>
26    <li><a href="../../index.html">Home</a>
27    <li><a href="../../doc/manual.html">Manual</a>
28    <li><a href="https://github.com/codemirror/codemirror">Code</a>
29  </ul>
30  <ul>
31    <li><a href="../index.html">Language modes</a>
32    <li><a class=active href="#">SLIM</a>
33  </ul>
34</div>
35
36<article>
37  <h2>SLIM mode</h2>
38  <form><textarea id="code" name="code">
39body
40  table
41    - for user in users
42      td id="user_#{user.id}" class=user.role
43        a href=user_action(user, :edit) Edit #{user.name}
44        a href=(path_to_user user) = user.name
45body
46  h1(id="logo") = page_logo
47  h2[id="tagline" class="small tagline"] = page_tagline
48
49h2[id="tagline"
50   class="small tagline"] = page_tagline
51
52h1 id = "logo" = page_logo
53h2 [ id = "tagline" ] = page_tagline
54
55/ comment
56  second line
57/! html comment
58   second line
59<!-- html comment -->
60<a href="#{'hello' if set}">link</a>
61a.slim href="work" disabled=false running==:atom Text <b>bold</b>
62.clazz data-id="test" == 'hello' unless quark
63 | Text mode #{12}
64   Second line
65= x ||= :ruby_atom
66#menu.left
67  - @env.each do |x|
68    li: a = x
69*@dyntag attr="val"
70.first *{:class => [:second, :third]} Text
71.second class=["text","more"]
72.third class=:text,:symbol
73
74  </textarea></form>
75  <script>
76    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
77      lineNumbers: true,
78      theme: "ambiance",
79      mode: "application/x-slim"
80    });
81    $('.CodeMirror').resizable({
82      resize: function() {
83        editor.setSize($(this).width(), $(this).height());
84        //editor.refresh();
85      }
86    });
87  </script>
88
89  <p><strong>MIME types defined:</strong> <code>application/x-slim</code>.</p>
90
91  <p>
92    <strong>Parsing/Highlighting Tests:</strong>
93    <a href="../../test/index.html#slim_*">normal</a>,
94    <a href="../../test/index.html#verbose,slim_*">verbose</a>.
95  </p>
96</article>