|
9 | 9 | Author: rtfpessoa |
10 | 10 | --> |
11 | 11 |
|
12 | | - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/github.min.css"> |
13 | | - <!--css--> |
| 12 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css"> |
| 13 | + |
| 14 | + <!--diff2html-css--> |
| 15 | + |
| 16 | + <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> |
| 17 | + |
| 18 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script> |
| 19 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/languages/scala.min.js"></script> |
| 20 | + |
| 21 | + <!--diff2html-js-ui--> |
14 | 22 |
|
15 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js"></script> |
16 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/languages/scala.min.js"></script> |
17 | 23 | <script> |
18 | | - document.addEventListener("DOMContentLoaded", function() { |
19 | | - // collect all the distinct languages in the HTML |
20 | | - var distinctLanguages = []; |
21 | | - [].forEach.call(document.getElementsByClassName("d2h-file-wrapper"), function(file) { |
22 | | - distinctLanguages.indexOf(file.dataset.lang) === -1 && distinctLanguages.push(file.dataset.lang); |
23 | | - }); |
24 | | - |
25 | | - // pass the languages to the highlightjs plugin |
26 | | - hljs.configure({languages: distinctLanguages}); |
27 | | - |
28 | | - // collect all the code lines and execute the highlight on them |
29 | | - var codeLines = document.getElementsByClassName("d2h-code-line-ctn"); |
30 | | - [].forEach.call(codeLines, function(line) { |
31 | | - hljs.highlightBlock(line); |
32 | | - }); |
| 24 | + $(document).ready(function() { |
| 25 | + var diff2htmlUi = new Diff2HtmlUI(); |
| 26 | + diff2htmlUi.fileListCloseable('#diff', false); |
| 27 | + diff2htmlUi.highlightCode('#diff'); |
33 | 28 | }); |
34 | 29 | </script> |
35 | 30 | </head> |
36 | 31 | <body style="text-align: center; font-family: 'Source Sans Pro',sans-serif;"> |
37 | 32 | <h1>Diff to HTML by <a href="https://github.com/rtfpessoa">rtfpessoa</a></h1> |
38 | 33 |
|
39 | | -<div> |
40 | | - <!--diff--> |
| 34 | +<div id="diff"> |
| 35 | + <!--diff2html-diff--> |
41 | 36 | </div> |
42 | 37 | </body> |
43 | 38 | </html> |
0 commit comments