index.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!doctype html>
  2. <title>CodeMirror: YAML 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="yaml.js"></script>
  8. <style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
  9. <div id=nav>
  10. <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  11. <ul>
  12. <li><a href="../../index.html">Home</a>
  13. <li><a href="../../doc/manual.html">Manual</a>
  14. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  15. </ul>
  16. <ul>
  17. <li><a href="../index.html">Language modes</a>
  18. <li><a class=active href="#">YAML</a>
  19. </ul>
  20. </div>
  21. <article>
  22. <h2>YAML mode</h2>
  23. <form><textarea id="code" name="code">
  24. --- # Favorite movies
  25. - Casablanca
  26. - North by Northwest
  27. - The Man Who Wasn't There
  28. --- # Shopping list
  29. [milk, pumpkin pie, eggs, juice]
  30. --- # Indented Blocks, common in YAML data files, use indentation and new lines to separate the key: value pairs
  31. name: John Smith
  32. age: 33
  33. --- # Inline Blocks, common in YAML data streams, use commas to separate the key: value pairs between braces
  34. {name: John Smith, age: 33}
  35. ---
  36. receipt: Oz-Ware Purchase Invoice
  37. date: 2007-08-06
  38. customer:
  39. given: Dorothy
  40. family: Gale
  41. items:
  42. - part_no: A4786
  43. descrip: Water Bucket (Filled)
  44. price: 1.47
  45. quantity: 4
  46. - part_no: E1628
  47. descrip: High Heeled "Ruby" Slippers
  48. size: 8
  49. price: 100.27
  50. quantity: 1
  51. bill-to: &id001
  52. street: |
  53. 123 Tornado Alley
  54. Suite 16
  55. city: East Centerville
  56. state: KS
  57. ship-to: *id001
  58. specialDelivery: >
  59. Follow the Yellow Brick
  60. Road to the Emerald City.
  61. Pay no attention to the
  62. man behind the curtain.
  63. ...
  64. </textarea></form>
  65. <script>
  66. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
  67. </script>
  68. <p><strong>MIME types defined:</strong> <code>text/x-yaml</code>.</p>
  69. </article>