2
0

index.html 1.7 KB

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