json-ld.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!doctype html>
  2. <title>CodeMirror: JSON-LD 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="../../addon/edit/matchbrackets.js"></script>
  8. <script src="../../addon/comment/continuecomment.js"></script>
  9. <script src="../../addon/comment/comment.js"></script>
  10. <script src="javascript.js"></script>
  11. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  12. <div id="nav">
  13. <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
  14. <ul>
  15. <li><a href="../../index.html">Home</a>
  16. <li><a href="../../doc/manual.html">Manual</a>
  17. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  18. </ul>
  19. <ul>
  20. <li><a href="../index.html">Language modes</a>
  21. <li><a class=active href="#">JSON-LD</a>
  22. </ul>
  23. </div>
  24. <article>
  25. <h2>JSON-LD mode</h2>
  26. <div><textarea id="code" name="code">
  27. {
  28. "@context": {
  29. "name": "http://schema.org/name",
  30. "description": "http://schema.org/description",
  31. "image": {
  32. "@id": "http://schema.org/image",
  33. "@type": "@id"
  34. },
  35. "geo": "http://schema.org/geo",
  36. "latitude": {
  37. "@id": "http://schema.org/latitude",
  38. "@type": "xsd:float"
  39. },
  40. "longitude": {
  41. "@id": "http://schema.org/longitude",
  42. "@type": "xsd:float"
  43. },
  44. "xsd": "http://www.w3.org/2001/XMLSchema#"
  45. },
  46. "name": "The Empire State Building",
  47. "description": "The Empire State Building is a 102-story landmark in New York City.",
  48. "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
  49. "geo": {
  50. "latitude": "40.75",
  51. "longitude": "73.98"
  52. }
  53. }
  54. </textarea></div>
  55. <script>
  56. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  57. matchBrackets: true,
  58. autoCloseBrackets: true,
  59. mode: "application/ld+json",
  60. lineWrapping: true
  61. });
  62. </script>
  63. <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
  64. </article>