@@ -24,7 +24,7 @@ debugging:
2424load ( "../build/jslib/logger.js" ) ;
2525load ( "../build/jslib/fileUtil.js" ) ;
2626
27- var files , i , mdFile , htmlFile , fileContents ,
27+ var files , i , htmlFile , transFile , fileContents ,
2828 runtime = Packages . java . lang . Runtime . getRuntime ( ) ,
2929 process , preContents , postContents , h1 , homePath , cssPath ,
3030 jsPath , length , j , isTopPage = false ;
@@ -35,25 +35,25 @@ fileUtil.copyFile("main.css", "./dist-site/main.css");
3535fileUtil . copyFile ( "init.js" , "./dist-site/init.js" ) ;
3636fileUtil . copyDir ( "i/" , "./dist-site/i/" , / \w / ) ;
3737fileUtil . copyDir ( "fonts" , "./dist-site/fonts" , / \w / ) ;
38- fileUtil . copyFile ( "../README.md" , "./dist-site/index.md " ) ;
38+ fileUtil . copyFile ( "../README.md" , "./dist-site/index.html " ) ;
3939fileUtil . copyDir ( "../docs/" , "./dist-site/docs/" , / \w / ) ;
4040
4141preContents = fileUtil . readFile ( "pre.html" ) ;
4242postContents = fileUtil . readFile ( "post.html" ) ;
4343
44- //Convert each .md file to an HTML file
45- files = fileUtil . getFilteredFileList ( "./dist-site" , / \. m d $ / , true ) ;
46- for ( i = 0 ; ( mdFile = files [ i ] ) ; i ++ ) {
47- htmlFile = mdFile . replace ( / \. m d $ / , ".html" ) ;
44+ //Convert each .html file to a full HTML file
45+ files = fileUtil . getFilteredFileList ( "./dist-site" , / \. h t m l $ / , true ) ;
46+ for ( i = 0 ; ( htmlFile = files [ i ] ) ; i ++ ) {
47+ transFile = htmlFile + '.trans' ;
4848
4949 logger . trace ( "Creating " + htmlFile ) ;
5050
5151 //Do Markdown
52- process = runtime . exec ( [ "/bin/sh" , "-c" , "./Markdown.pl --html4tags " + mdFile + " > " + htmlFile ] ) ;
52+ process = runtime . exec ( [ "/bin/sh" , "-c" , "./Markdown.pl --html4tags " + htmlFile + " > " + transFile ] ) ;
5353 process . waitFor ( ) ;
5454
5555 //Build up a complete HTML file.
56- fileContents = fileUtil . readFile ( htmlFile ) ;
56+ fileContents = fileUtil . readFile ( transFile ) ;
5757 fileContents = preContents + fileContents + postContents ;
5858
5959 //Set the title of the HTML page
@@ -101,6 +101,5 @@ for (i = 0; (mdFile = files[i]); i++) {
101101
102102 fileUtil . saveFile ( htmlFile , fileContents ) ;
103103
104- //Remove the .md file
105- fileUtil . deleteFile ( mdFile ) ;
104+ fileUtil . deleteFile ( transFile ) ;
106105}
0 commit comments