index.html 1.7 KB

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