highlight.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Highlight plugin | Trumbowyg</title>
  6. <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
  7. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.13.0/themes/prism-tomorrow.css">
  8. <link rel="stylesheet" href="../../css/main.css">
  9. </head>
  10. <body class="documentation-body">
  11. <div class="main main-demo-inner">
  12. <section class="wrapper section">
  13. <h2 class="section-title">Highlight plugin</h2>
  14. <div class="feature">
  15. <h3>Basic usage</h3>
  16. <p>
  17. This plugin allow you to add an code highlighter in Trumbowyg.
  18. </p>
  19. <a href="../../documentation/plugins/#plugin-highlight" class="button button-demo">Read highlight plugin documentation</a>
  20. <div id="editor">
  21. <p>Just press plugin button and paste code there!</p>
  22. <p><br></p>
  23. </div>
  24. <h4>The code</h4>
  25. <pre><code class="js-code-to-eval javascript">
  26. $('#editor')
  27. .trumbowyg({
  28. btns: [
  29. ['highlight']
  30. ]
  31. });
  32. </code></pre>
  33. </div>
  34. <div class="feature">
  35. <h3>Setup</h3>
  36. <h4>In head tag</h4>
  37. <pre><code class="html loading-head">
  38. &lt;!-- Import prismjs stylesheet -->
  39. &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.13.0/themes/prism.css">
  40. </code></pre>
  41. <h4>At the end of body</h4>
  42. <pre><code class="html loading-body">
  43. &lt;!-- Import jQuery -->
  44. &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">&lt;/script>
  45. &lt;script>window.jQuery || document.write('&lt;script src="js/vendor/jquery-3.2.1.min.js">&lt;\/script>')&lt;/script>
  46. &lt;!-- Import prismjs -->
  47. &lt;script src="//cdnjs.cloudflare.com/ajax/libs/prism/1.13.0/prism.min.js">&lt;/script>
  48. </code></pre>
  49. </div>
  50. </section>
  51. </div>
  52. <!-- Import jQuery -->
  53. <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  54. <script>window.jQuery || document.write('<script src="../../js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
  55. <!-- Import highlight.js -->
  56. <script src="//cdnjs.cloudflare.com/ajax/libs/prism/1.13.0/prism.min.js"></script>
  57. <!-- DO NOT COPY THIS LINES IN YOUR PROJECT, THEY ARE THERE JUST FOR THE EXAMPLE PAGE PRUPOSE -->
  58. <script src="../js/loader.js"></script>
  59. <script>
  60. loadStyle('dist/ui/trumbowyg.css', 'Import Trumbowyg stylesheet');
  61. loadStyle('dist/plugins/highlight/ui/trumbowyg.highlight.css', 'Import highlight plugin specific stylesheet');
  62. loadScript('dist/trumbowyg.js', 'Import Trumbowyg');
  63. loadScript('dist/plugins/highlight/trumbowyg.highlight.js', 'Import all plugins you want AFTER importing jQuery and Trumbowyg');
  64. </script>
  65. <script src="../js/runExampleCode.js"></script>
  66. <script src="../js/highlight.js"></script>
  67. </body>
  68. </html>