Skip to content

Commit dd83662

Browse files
committed
[Documentation] Add styling
1 parent df3b0bd commit dd83662

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

docs/footer.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<hr>
2+
<cite>
3+
This document is styled using
4+
<a href="https://github.com/jasonm23/markdown-css-themes">
5+
https://github.com/jasonm23/markdown-css-themes
6+
</a>.
7+
</cite>
8+
</body>
9+
</html>

docs/gendocs.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* at runtime from the About dialog for additional information.
2121
*****************************************************************************/
2222

23-
/*global require,process,GLOBAL*/
23+
/*global require,process,__dirname,GLOBAL*/
2424
/*jslint nomen: false */
2525

2626

@@ -47,6 +47,8 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
4747
nomnoml = require('nomnoml'),
4848
toc = require("markdown-toc"),
4949
Canvas = require('canvas'),
50+
header = fs.readFileSync(path.resolve(__dirname, 'header.html')),
51+
footer = fs.readFileSync(path.resolve(__dirname, 'footer.html')),
5052
options = require("minimist")(process.argv.slice(2));
5153

5254
// Convert from nomnoml source to a target PNG file.
@@ -115,9 +117,9 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
115117
// Prepend table of contents
116118
markdown =
117119
[ TOC_HEAD, toc(markdown).content, "", markdown ].join("\n");
118-
this.push("<html><body>\n");
120+
this.push(header);
119121
this.push(marked(markdown));
120-
this.push("\n</body></html>\n");
122+
this.push(footer);
121123
done();
122124
};
123125
return transform;
@@ -186,12 +188,12 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
186188
var destination = file.replace(options['in'], options.out),
187189
destPath = path.dirname(destination),
188190
streamOptions = {};
189-
if (file.match(/png$/)){
191+
if (file.match(/png$/)) {
190192
streamOptions.encoding = null;
191193
} else {
192194
streamOptions.encoding = 'utf8';
193195
}
194-
196+
195197
mkdirp(destPath, function (err) {
196198
fs.createReadStream(file, streamOptions)
197199
.pipe(fs.createWriteStream(destination, streamOptions));

docs/header.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<html>
2+
<head>
3+
<link rel="stylesheet"
4+
href="http://jasonm23.github.io/markdown-css-themes/avenir-white.css">
5+
</head>
6+
<body>
7+

0 commit comments

Comments
 (0)