1- // const gulp = require('gulp');
2- // const markdownPdf = require('gulp-markdown-pdf');
3- // const replace = require('gulp-replace');
4- // const path = require("path");
5- // const fs = require('fs');
1+ const gulp = require ( 'gulp' ) ;
2+ const markdownPdf = require ( 'gulp-markdown-pdf' ) ;
3+ const replace = require ( 'gulp-replace' ) ;
4+ const path = require ( "path" ) ;
5+ const fs = require ( 'fs' ) ;
66
7- // gulp.task('docs-concatenate-markdown', function(cb){
7+ gulp . task ( 'docs-concatenate-markdown' , function ( cb ) {
88
9- // var rootPath = path.resolve('Docs/images/') + "/"
9+ var rootPath = path . resolve ( 'Docs/images/' ) + "/"
1010
11- // var toc = fs.readFileSync("Docs/_Sidebar.md", "utf8");
11+ var toc = fs . readFileSync ( "Docs/_Sidebar.md" , "utf8" ) ;
1212
13- // var lines = toc.split("\n");
13+ var lines = toc . split ( "\n" ) ;
1414
15- // lines.splice(1, 0, "* [About](Home)");
15+ lines . splice ( 1 , 0 , "* [About](Home)" ) ;
1616
17- // var markdown = "";
17+ var markdown = "" ;
1818
19- // for (let i = 0; i < lines.length; i++) {
19+ for ( let i = 0 ; i < lines . length ; i ++ ) {
2020
21- // const line = lines[i];
21+ const line = lines [ i ] ;
2222
23- // if(line.substring(0,1) == "#")
24- // {
25- // markdown += line
26- // }
27- // else if(line.substring(0,1) == "*")
28- // {
23+ if ( line . substring ( 0 , 1 ) == "#" )
24+ {
25+ markdown += line
26+ }
27+ else if ( line . substring ( 0 , 1 ) == "*" )
28+ {
2929
30- // let split = line.split("](");
30+ let split = line . split ( "](" ) ;
3131
32- // markdown += "## " + split[0].substring(3) + "\n";
32+ markdown += "## " + split [ 0 ] . substring ( 3 ) + "\n" ;
3333
34- // let text = fs.readFileSync("Docs/" + split[1].substring(0, split[1].length-1) + ".md", "utf8")
34+ let text = fs . readFileSync ( "Docs/" + split [ 1 ] . substring ( 0 , split [ 1 ] . length - 1 ) + ".md" , "utf8" )
3535
36- // markdown += text.replace(/\]\(images\//g, "](" + rootPath);;
37- // }
36+ markdown += text . replace ( / \] \( i m a g e s \/ / g, "](" + rootPath ) ; ;
37+ }
3838
39- // markdown += "\n";
39+ markdown += "\n" ;
4040
41- // }
41+ }
4242
43- // fs.writeFile('Releases/Source/docs.md', markdown, cb);
44- // });
43+ fs . writeFile ( 'Releases/Source/docs.md' , markdown , cb ) ;
44+ } ) ;
4545
46- // gulp.task('docs-build-pdf', function(){
46+ gulp . task ( 'docs-build-pdf' , function ( ) {
4747
48- // var tmpDoc = 'Releases/Source/docs.md'
48+ var tmpDoc = 'Releases/Source/docs.md'
4949
50- // return gulp.src(tmpDoc)
51- // .pipe(markdownPdf())
52- // .pipe(gulp.dest('Releases/Final/'));
50+ return gulp . src ( tmpDoc )
51+ . pipe ( markdownPdf ( ) )
52+ . pipe ( gulp . dest ( 'Releases/Final/' ) ) ;
5353
54- // })
54+ } )
5555
56- // gulp.task("build-docs", gulp.series('docs-concatenate-markdown', 'docs-build-pdf'));
56+ gulp . task ( "build-docs" , gulp . series ( 'docs-concatenate-markdown' , 'docs-build-pdf' ) ) ;
0 commit comments