You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.0 KiB

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