|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + |
| 4 | +<head> |
| 5 | + <meta charset="utf-8" /> |
| 6 | + <link rel="icon" href="favicon.png" /> |
| 7 | + <title>Data-URI Highlight ▲ Prism plugins</title> |
| 8 | + <base href="../.." /> |
| 9 | + <link rel="stylesheet" href="style.css" /> |
| 10 | + <link rel="stylesheet" href="themes/prism.css" data-noprefix /> |
| 11 | + <link rel="stylesheet" href="plugins/diff-highlight/prism-diff-highlight.css" data-noprefix /> |
| 12 | + <script src="scripts/prefixfree.min.js"></script> |
| 13 | + |
| 14 | + <script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script> |
| 15 | + <script src="https://www.google-analytics.com/ga.js" async></script> |
| 16 | +</head> |
| 17 | + |
| 18 | +<body class="language-none"> |
| 19 | + |
| 20 | + <header> |
| 21 | + <div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div> |
| 22 | + |
| 23 | + <h2>Diff Highlight</h2> |
| 24 | + <p>Highlights the code inside diff blocks.</p> |
| 25 | + </header> |
| 26 | + |
| 27 | + <section> |
| 28 | + <h1>How to use</h1> |
| 29 | + |
| 30 | + <p>Replace the <code>language-diff</code> of your code block with a <code>language-diff-xxxx</code> class to enable syntax highlighting for diff blocks.</p> |
| 31 | + |
| 32 | + <p>Optional:<br> |
| 33 | + You can add the <code>diff-highlight</code> class to your code block to indicate changes using the background color of a line rather than the color of the text.</p> |
| 34 | + </section> |
| 35 | + |
| 36 | + <section> |
| 37 | + <h1>Example</h1> |
| 38 | + |
| 39 | + <p>Using <code>class="language-diff"</code>:</p> |
| 40 | + |
| 41 | + <pre><code class="language-diff">@@ -4,6 +4,5 @@ |
| 42 | +- let foo = bar.baz([1, 2, 3]); |
| 43 | +- foo = foo + 1; |
| 44 | ++ const foo = bar.baz([1, 2, 3]) + 1; |
| 45 | + console.log(`foo: ${foo}`);</code></pre> |
| 46 | + |
| 47 | + <p>Using <code>class="language-diff diff-highlight"</code>:</p> |
| 48 | + |
| 49 | + <pre><code class="language-diff diff-highlight">@@ -4,6 +4,5 @@ |
| 50 | +- let foo = bar.baz([1, 2, 3]); |
| 51 | +- foo = foo + 1; |
| 52 | ++ const foo = bar.baz([1, 2, 3]) + 1; |
| 53 | + console.log(`foo: ${foo}`);</code></pre> |
| 54 | + |
| 55 | + <p>Using <code>class="language-diff-javascript"</code>:</p> |
| 56 | + |
| 57 | + <pre><code class="language-diff-javascript">@@ -4,6 +4,5 @@ |
| 58 | +- let foo = bar.baz([1, 2, 3]); |
| 59 | +- foo = foo + 1; |
| 60 | ++ const foo = bar.baz([1, 2, 3]) + 1; |
| 61 | + console.log(`foo: ${foo}`);</code></pre> |
| 62 | + |
| 63 | + <p>Using <code>class="language-diff-javascript diff-highlight"</code>:</p> |
| 64 | + |
| 65 | + <pre><code class="language-diff-javascript diff-highlight">@@ -4,6 +4,5 @@ |
| 66 | +- let foo = bar.baz([1, 2, 3]); |
| 67 | +- foo = foo + 1; |
| 68 | ++ const foo = bar.baz([1, 2, 3]) + 1; |
| 69 | + console.log(`foo: ${foo}`);</code></pre> |
| 70 | + |
| 71 | + </section> |
| 72 | + |
| 73 | + <footer data-src="templates/footer.html" data-type="text/html"></footer> |
| 74 | + |
| 75 | + <script src="prism.js"></script> |
| 76 | + <script src="components/prism-diff.js"></script> |
| 77 | + <script src="plugins/diff-highlight/prism-diff-highlight.js"></script> |
| 78 | + <script src="scripts/utopia.js"></script> |
| 79 | + <script src="components.js"></script> |
| 80 | + <script src="scripts/code.js"></script> |
| 81 | + |
| 82 | +</body> |
| 83 | + |
| 84 | +</html> |
0 commit comments