@@ -112,7 +112,7 @@ var svgmin = require('gulp-svgmin')
112
112
*/
113
113
114
114
// Remove pre-existing content from output folders
115
- var cleanDist = function ( done ) {
115
+ var cleanDist = function ( done ) {
116
116
// Make sure this feature is activated before running
117
117
if ( ! settings . clean ) return done ( )
118
118
@@ -143,13 +143,13 @@ var jsTasks = lazypipe()
143
143
. pipe ( dest , paths . scripts . output )
144
144
145
145
// Lint, minify, and concatenate scripts
146
- var buildScripts = function ( done ) {
146
+ var buildScripts = function ( done ) {
147
147
// Make sure this feature is activated before running
148
148
if ( ! settings . scripts ) return done ( )
149
149
150
150
// Run tasks on script files
151
151
src ( paths . scripts . input )
152
- . pipe ( flatmap ( function ( stream , file ) {
152
+ . pipe ( flatmap ( function ( stream , file ) {
153
153
// If the file is a directory
154
154
if ( file . isDirectory ( ) ) {
155
155
// Setup a suffix variable
@@ -184,7 +184,7 @@ var buildScripts = function(done) {
184
184
}
185
185
186
186
// Lint scripts
187
- var lintScripts = function ( done ) {
187
+ var lintScripts = function ( done ) {
188
188
// Make sure this feature is activated before running
189
189
if ( ! settings . scripts ) return done ( )
190
190
@@ -201,24 +201,24 @@ var lintScripts = function(done) {
201
201
202
202
// pretty print all xml listings
203
203
// articles not yet decided
204
- var prettyXml = function ( done ) {
204
+ var prettyXml = function ( done ) {
205
205
src ( paths . xml . listings , { base : "./" } )
206
- . pipe ( muxml ( {
207
- stripComments : false ,
208
- stripCdata : false ,
209
- stripInstruction : false ,
210
- saxOptions : {
211
- trim : true ,
212
- normalize : true
213
- }
214
- } ) )
206
+ . pipe ( muxml ( {
207
+ stripComments : false ,
208
+ stripCdata : false ,
209
+ stripInstruction : false ,
210
+ saxOptions : {
211
+ trim : true ,
212
+ normalize : true
213
+ }
214
+ } ) )
215
215
. pipe ( dest ( "./" ) )
216
- // Signal completion
217
- done ( )
216
+ // Signal completion
217
+ done ( )
218
218
}
219
219
220
220
// Process, lint, and minify Sass files
221
- var buildStyles = function ( done ) {
221
+ var buildStyles = function ( done ) {
222
222
// Make sure this feature is activated before running
223
223
if ( ! settings . styles ) return done ( )
224
224
@@ -258,7 +258,7 @@ var buildStyles = function(done) {
258
258
}
259
259
260
260
// Optimize SVG files
261
- var buildSVGs = function ( done ) {
261
+ var buildSVGs = function ( done ) {
262
262
// Make sure this feature is activated before running
263
263
if ( ! settings . svgs ) return done ( )
264
264
@@ -272,7 +272,7 @@ var buildSVGs = function(done) {
272
272
}
273
273
274
274
// Copy third-party dependencies from node_modules into resources
275
- var vendorFiles = function ( done ) {
275
+ var vendorFiles = function ( done ) {
276
276
// Make sure this feature is activated before running
277
277
if ( ! settings . vendor ) return done ( )
278
278
@@ -282,11 +282,16 @@ var vendorFiles = function(done) {
282
282
283
283
284
284
// copy vendor scripts
285
- src ( [ 'node_modules/bootstrap/dist/js/bootstrap.min.*' , 'node_modules/jquery/dist/jquery.slim.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' , 'node_modules/@highlightjs/cdn-assets/languages/xquery.min.js' , 'node_modules/@highlightjs/cdn-assets/languages/dockerfile.min.js' ] )
286
+ . pipe ( dest ( paths . scripts . output ) )
287
+
288
+ // copy pre-packed lang definitions for code highlighter
289
+ // CSS Bash Makefile Diff JSON Markdown Perl SQL Shell Properties Less SCSS Puppet'
290
+ src ( [ 'node_modules/@highlightjs/cdn-assets/languages/xquery.min.js' , 'node_modules/@highlightjs/cdn-assets/languages/dockerfile.min.js' , 'node_modules/@highlightjs/cdn-assets/languages/apache.min.js' , 'node_modules/@highlightjs/cdn-assets/languages/http.min.js' , 'node_modules/@highlightjs/cdn-assets/languages/nginx.min.js' ] )
286
291
. pipe ( dest ( paths . scripts . output ) )
287
292
288
293
// copy vendor Styles
289
- src ( [ 'node_modules/bootstrap/dist/css/bootstrap.min.*' , 'node_modules/highlight.js/ styles/atom-one-dark.css' ] )
294
+ src ( [ 'node_modules/bootstrap/dist/css/bootstrap.min.*' , 'node_modules/@highlightjs/cdn-assets/ styles/atom-one-dark.min .css' ] )
290
295
. pipe ( dest ( paths . styles . output ) )
291
296
292
297
// copy vendor fonts
@@ -298,7 +303,7 @@ var vendorFiles = function(done) {
298
303
299
304
300
305
// Copy static files into output folder
301
- var copyFiles = function ( done ) {
306
+ var copyFiles = function ( done ) {
302
307
// Make sure this feature is activated before running
303
308
if ( ! settings . copy ) return done ( )
304
309
@@ -310,32 +315,6 @@ var copyFiles = function(done) {
310
315
done ( )
311
316
}
312
317
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
-
339
318
/**
340
319
* Export Tasks
341
320
*/
@@ -351,7 +330,6 @@ exports.default = series(
351
330
buildStyles ,
352
331
buildSVGs ,
353
332
copyFiles ,
354
- buildPack ,
355
333
prettyXml
356
334
)
357
335
)
0 commit comments