index.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!doctype html>
  2. <title>CodeMirror: Cypher Mode for CodeMirror</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/neo.css" />
  7. <script src="../../lib/codemirror.js"></script>
  8. <script src="cypher.js"></script>
  9. <style>
  10. .CodeMirror {
  11. border-top: 1px solid black;
  12. border-bottom: 1px solid black;
  13. }
  14. </style>
  15. <div id=nav>
  16. <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  17. <ul>
  18. <li><a href="../../index.html">Home</a>
  19. <li><a href="../../doc/manual.html">Manual</a>
  20. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  21. </ul>
  22. <ul>
  23. <li><a href="../index.html">Language modes</a>
  24. <li><a class=active href="#">Cypher Mode for CodeMirror</a>
  25. </ul>
  26. </div>
  27. <article>
  28. <h2>Cypher Mode for CodeMirror</h2>
  29. <form>
  30. <textarea id="code" name="code">// Cypher Mode for CodeMirror, using the neo theme
  31. MATCH (joe { name: 'Joe' })-[:knows*2..2]-(friend_of_friend)
  32. WHERE NOT (joe)-[:knows]-(friend_of_friend)
  33. RETURN friend_of_friend.name, COUNT(*)
  34. ORDER BY COUNT(*) DESC , friend_of_friend.name
  35. </textarea>
  36. </form>
  37. <p><strong>MIME types defined:</strong>
  38. <code><a href="?mime=application/x-cypher-query">application/x-cypher-query</a></code>
  39. </p>
  40. <script>
  41. window.onload = function() {
  42. var mime = 'application/x-cypher-query';
  43. // get mime type
  44. if (window.location.href.indexOf('mime=') > -1) {
  45. mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5);
  46. }
  47. window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
  48. mode: mime,
  49. indentWithTabs: true,
  50. smartIndent: true,
  51. lineNumbers: true,
  52. matchBrackets : true,
  53. autofocus: true,
  54. theme: 'neo'
  55. });
  56. };
  57. </script>
  58. </article>