@@ -3,13 +3,13 @@ var path = require("path")
3
3
var marked = require ( "marked" )
4
4
var layout = fs . readFileSync ( "./docs/layout.html" , "utf-8" )
5
5
var version = JSON . parse ( fs . readFileSync ( "./package.json" , "utf-8" ) ) . version
6
- try { fs . mkdirSync ( "../mithril " ) } catch ( e ) { }
7
- try { fs . mkdirSync ( "../mithril /archive" ) } catch ( e ) { }
8
- try { fs . mkdirSync ( "../mithril /archive/v" + version ) } catch ( e ) { }
9
- try { fs . mkdirSync ( "../mithril /archive/v" + version + "/lib" ) } catch ( e ) { }
10
- try { fs . mkdirSync ( "../mithril /archive/v" + version + "/lib/prism" ) } catch ( e ) { }
11
- try { fs . mkdirSync ( "../mithril /lib" ) } catch ( e ) { }
12
- try { fs . mkdirSync ( "../mithril /lib/prism" ) } catch ( e ) { }
6
+ try { fs . mkdirSync ( "./dist " ) } catch ( e ) { }
7
+ try { fs . mkdirSync ( "./dist /archive" ) } catch ( e ) { }
8
+ try { fs . mkdirSync ( "./dist /archive/v" + version ) } catch ( e ) { }
9
+ try { fs . mkdirSync ( "./dist /archive/v" + version + "/lib" ) } catch ( e ) { }
10
+ try { fs . mkdirSync ( "./dist /archive/v" + version + "/lib/prism" ) } catch ( e ) { }
11
+ try { fs . mkdirSync ( "./dist /lib" ) } catch ( e ) { }
12
+ try { fs . mkdirSync ( "./dist /lib/prism" ) } catch ( e ) { }
13
13
14
14
var guides = fs . readFileSync ( "docs/guides.md" , "utf-8" ) <
8000
/div>
15
15
var methods = fs . readFileSync ( "docs/methods.md" , "utf-8" )
@@ -55,12 +55,12 @@ function generate(pathname) {
55
55
. replace ( / < h ( .) i d = " ( [ ^ " ] + ?) " > ( .+ ?) < \/ h .> / gim, function ( match , n , id , text ) { // fix anchors
56
56
return "<h" + n + " id=\"" + text . toLowerCase ( ) . replace ( / < ( \/ ? ) c o d e > / g, "" ) . replace ( / < a .* ?> .+ ?< \/ a > / g, "" ) . replace ( / \. | \[ | \] | & q u o t ; | \/ | \( | \) / g, "" ) . replace ( / \s / g, "-" ) + "\">" + text + "</h" + n + ">"
57
57
} )
58
- fs . writeFileSync ( "../mithril /archive/v" + version + "/" + outputFilename . replace ( / ^ d o c s \/ / , "" ) , html , "utf-8" )
59
- fs . writeFileSync ( "../mithril /" + outputFilename . replace ( / ^ d o c s \/ / , "" ) , html , "utf-8" )
58
+ fs . writeFileSync ( "./dist /archive/v" + version + "/" + outputFilename . replace ( / ^ d o c s \/ / , "" ) , html , "utf-8" )
59
+ fs . writeFileSync ( "./dist /" + outputFilename . replace ( / ^ d o c s \/ / , "" ) , html , "utf-8" )
60
60
}
61
61
else if ( ! pathname . match ( / l i n t | g e n e r a t e / ) ) {
62
- fs . writeFileSync ( "../mithril /archive/v" + version + "/" + pathname . replace ( / ^ d o c s \/ / , "" ) , fs . readFileSync ( pathname , "utf-8" ) , "utf-8" )
63
- fs . writeFileSync ( "../mithril /" + pathname . replace ( / ^ d o c s \/ / , "" ) , fs . readFileSync ( pathname , "utf-8" ) , "utf-8" )
62
+ fs . writeFileSync ( "./dist /archive/v" + version + "/" + pathname . replace ( / ^ d o c s \/ / , "" ) , fs . readFileSync ( pathname , "utf-8" ) , "utf-8" )
63
+ fs . writeFileSync ( "./dist /" + pathname . replace ( / ^ d o c s \/ / , "" ) , fs . readFileSync ( pathname , "utf-8" ) , "utf-8" )
64
64
}
65
65
}
66
66
}
0 commit comments