| 5 |
lars |
1 |
<!doctype html>
|
|
|
2 |
<title>CodeMirror: HAML mode</title>
|
|
|
3 |
<meta charset="utf-8" />
|
|
|
4 |
<link rel=stylesheet href="../../doc/docs.css">
|
|
|
5 |
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
|
6 |
<script src="../../lib/codemirror.js"></script>
|
|
|
7 |
<script src="../xml/xml.js"></script>
|
|
|
8 |
<script src="../htmlmixed/htmlmixed.js"></script>
|
|
|
9 |
<script src="../javascript/javascript.js"></script>
|
|
|
10 |
<script src="../ruby/ruby.js"></script>
|
|
|
11 |
<script src="haml.js"></script>
|
|
|
12 |
<style>
|
|
|
13 |
.CodeMirror {
|
|
|
14 |
background: #f8f8f8;
|
|
|
15 |
}
|
|
|
16 |
</style>
|
|
|
17 |
<div id=nav>
|
|
|
18 |
<a href="http://codemirror.net">
|
|
|
19 |
<h1>CodeMirror</h1>
|
|
|
20 |
<img id=logo src="../../doc/logo.png">
|
|
|
21 |
</a>
|
|
|
22 |
<ul>
|
|
|
23 |
<li>
|
|
|
24 |
<a href="../../index.html">Home</a>
|
|
|
25 |
<li>
|
|
|
26 |
<a href="../../doc/manual.html">Manual</a>
|
|
|
27 |
<li>
|
|
|
28 |
<a href="https://github.com/codemirror/codemirror">Code</a>
|
|
|
29 |
</ul>
|
|
|
30 |
<ul>
|
|
|
31 |
<li>
|
|
|
32 |
<a href="../index.html">Language modes</a>
|
|
|
33 |
<li>
|
|
|
34 |
<a class=active href="#">HAML</a>
|
|
|
35 |
</ul>
|
|
|
36 |
</div>
|
|
|
37 |
<article>
|
|
|
38 |
<h2>HAML mode</h2>
|
|
|
39 |
<form>
|
|
|
40 |
<textarea id="code" name="code"> !!! #content .left.column(title="title"){:href => "/hello", :test => "#{hello}_#{world}"}
|
|
|
41 |
<!-- This is a comment -->%h2 Welcome to our site! %p= puts "HAML MODE" .right.column = render :partial => "sidebar" .container .row .span8 %h1.title= @page_title %p.title= @page_title %p / The same as HTML comment Hello multiline comment -# haml comment This wont
|
|
|
42 |
be displayed nor will this Date/Time: - now = DateTime.now %strong= now - if now > DateTime.parse("December 31, 2006") = "Happy new " + "year!" %title = @title \= @title
|
|
|
43 |
<h1>Title</h1>
|
|
|
44 |
<h1 title="HELLO"> Title </h1>
|
|
|
45 |
</textarea>
|
|
|
46 |
</form>
|
|
|
47 |
<script>
|
|
|
48 |
var editor = CodeMirror.fromTextArea(document.getElementById("code"),
|
|
|
49 |
{
|
|
|
50 |
lineNumbers: true,
|
|
|
51 |
mode: "text/x-haml"
|
|
|
52 |
});
|
|
|
53 |
</script>
|
|
|
54 |
<p>
|
|
|
55 |
<strong>MIME types defined:</strong> <code>text/x-haml</code>.</p>
|
|
|
56 |
<p>
|
|
|
57 |
<strong>Parsing/Highlighting Tests:</strong>
|
|
|
58 |
<a href="../../test/index.html#haml_*">normal</a>,
|
|
|
59 |
<a href="../../test/index.html#verbose,haml_*">verbose</a>.</p>
|
|
|
60 |
</article>
|