Skip to content

Commit 4b5b5ef

Browse files
committed
switch files to be .html files instead of .md files for better syntax highlighting, and to reflect their actual content.
1 parent 2986303 commit 4b5b5ef

15 files changed

Lines changed: 9 additions & 10 deletions

dist/dist-site.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ debugging:
2424
load("../build/jslib/logger.js");
2525
load("../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");
3535
fileUtil.copyFile("init.js", "./dist-site/init.js");
3636
fileUtil.copyDir("i/", "./dist-site/i/", /\w/);
3737
fileUtil.copyDir("fonts", "./dist-site/fonts", /\w/);
38-
fileUtil.copyFile("../README.md", "./dist-site/index.md");
38+
fileUtil.copyFile("../README.md", "./dist-site/index.html");
3939
fileUtil.copyDir("../docs/", "./dist-site/docs/", /\w/);
4040

4141
preContents = fileUtil.readFile("pre.html");
4242
postContents = fileUtil.readFile("post.html");
4343

44-
//Convert each .md file to an HTML file
45-
files = fileUtil.getFilteredFileList("./dist-site", /\.md$/, true);
46-
for (i = 0; (mdFile = files[i]); i++) {
47-
htmlFile = mdFile.replace(/\.md$/, ".html");
44+
//Convert each .html file to a full HTML file
45+
files = fileUtil.getFilteredFileList("./dist-site", /\.html$/, 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
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)