index.html 2.9 KB

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