Skip to content

Commit 1c6403c

Browse files
committed
fix(highlight.js): use prebuilt package
custom build is broken
1 parent 9d6fca2 commit 1c6403c

File tree

5 files changed

+21
-54
lines changed

5 files changed

+21
-54
lines changed

Gulpfile.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ var vendorFiles = function(done) {
282282

283283

284284
// copy vendor scripts
285-
src(['node_modules/bootstrap/dist/js/bootstrap.min.*', 'node_modules/@popperjs/core/dist/umd/popper.min.*'])
285+
src(['node_modules/bootstrap/dist/js/bootstrap.min.*', 'node_modules/@popperjs/core/dist/umd/popper.min.*', 'node_modules/@highlightjs/cdn-assets/highlight.min.js'])
286286
.pipe(dest(paths.scripts.output))
287287

288288
// copy vendor Styles
289-
src(['node_modules/bootstrap/dist/css/bootstrap.min.*', 'node_modules/highlight.js/styles/atom-one-dark.css'])
289+
src(['node_modules/bootstrap/dist/css/bootstrap.min.*'])
290290
.pipe(dest(paths.styles.output))
291291

292292
// copy vendor fonts
@@ -310,32 +310,6 @@ var copyFiles = function(done) {
310310
done()
311311
}
312312

313-
// Build and copy highlight.js
314-
var buildPack = function(done) {
315-
// Make sure this feature is activated before running
316-
if (!settings.hjs) return done()
317-
318-
// build highlight pack
319-
// see https://highlightjs.readthedocs.io/en/latest/building-testing.html
320-
// TODO currently building is bugged when using npm
321-
let command = 'cd node_modules/highlight.js'
322-
+ ' && npm install'
323-
+ ' && node tools/build Apache CSS HTTP JavaScript Bash Makefile PHP Diff JSON Markdown Perl SQL HTML Java Nginx Shell Properties Less SCSS Puppet Dockerfile xquery'
324-
325-
exec(command, (err, stdout, stderr)=> {
326-
console.log(stderr)
327-
console.log(stdout)
328-
329-
callback(err)
330-
})
331-
332-
src('node_modules/highlight.js/build/*pack.js')
333-
.pipe(dest(paths.scripts.output))
334-
335-
// Signal completion
336-
done()
337-
}
338-
339313
/**
340314
* Export Tasks
341315
*/
@@ -351,7 +325,6 @@ exports.default = series(
351325
buildStyles,
352326
buildSVGs,
353327
copyFiles,
354-
buildPack,
355328
prettyXml
356329
)
357330
)

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
"supertest": "^7.0.0"
5454
},
5555
"dependencies": {
56+
"@highlightjs/cdn-assets": "^11.11.1",
5657
"@neos21/bootstrap3-glyphicons": "^1.0.7",
5758
"@popperjs/core": "^2.11.8",
58-
"bootstrap": "^5.3.3",
59-
"highlight.js": "^11.11.1"
59+
"bootstrap": "^5.3.3"
6060
}
6161
}

src/main/xar-resources/resources/scripts/highlight.pack.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/main/xar-resources/templates/page.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,9 @@
137137
<!-- <script type="text/javascript" src="resources/scripts/jquery.slim.min.js" /> -->
138138
<script type="text/javascript" src="resources/scripts/popper.min.js" />
139139
<script type="text/javascript" src="resources/scripts/bootstrap.min.js" />
140-
<script type="text/javascript" src="resources/scripts/highlight.pack.js" />
140+
<script type="text/javascript" src="resources/scripts/highlight.min.js" />
141141
<script type="text/javascript">
142-
$(document).ready(function () {
143-
$('pre code').each(function (i, block) {
144-
hljs.highlightBlock(block);
145-
});
146-
});
142+
hljs.highlightAll();
147143
</script>
148144
</body>
149145

0 commit comments

Comments
 (0)