You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.9 KiB

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