mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
Merge pull request #224 from nasa/open-docs-css
[Documentation] Add styling
This commit is contained in:
commit
a20bbd98f5
9
docs/footer.html
Normal file
9
docs/footer.html
Normal file
@ -0,0 +1,9 @@
|
||||
<hr>
|
||||
<cite>
|
||||
This document is styled using
|
||||
<a href="https://github.com/jasonm23/markdown-css-themes">
|
||||
https://github.com/jasonm23/markdown-css-themes
|
||||
</a>.
|
||||
</cite>
|
||||
</body>
|
||||
</html>
|
@ -20,7 +20,7 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
/*global require,process,GLOBAL*/
|
||||
/*global require,process,__dirname,GLOBAL*/
|
||||
/*jslint nomen: false */
|
||||
|
||||
|
||||
@ -47,6 +47,8 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
|
||||
nomnoml = require('nomnoml'),
|
||||
toc = require("markdown-toc"),
|
||||
Canvas = require('canvas'),
|
||||
header = fs.readFileSync(path.resolve(__dirname, 'header.html')),
|
||||
footer = fs.readFileSync(path.resolve(__dirname, 'footer.html')),
|
||||
options = require("minimist")(process.argv.slice(2));
|
||||
|
||||
// Convert from nomnoml source to a target PNG file.
|
||||
@ -115,9 +117,9 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
|
||||
// Prepend table of contents
|
||||
markdown =
|
||||
[ TOC_HEAD, toc(markdown).content, "", markdown ].join("\n");
|
||||
this.push("<html><body>\n");
|
||||
this.push(header);
|
||||
this.push(marked(markdown));
|
||||
this.push("\n</body></html>\n");
|
||||
this.push(footer);
|
||||
done();
|
||||
};
|
||||
return transform;
|
||||
@ -186,12 +188,12 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
|
||||
var destination = file.replace(options['in'], options.out),
|
||||
destPath = path.dirname(destination),
|
||||
streamOptions = {};
|
||||
if (file.match(/png$/)){
|
||||
if (file.match(/png$/)) {
|
||||
streamOptions.encoding = null;
|
||||
} else {
|
||||
streamOptions.encoding = 'utf8';
|
||||
}
|
||||
|
||||
|
||||
mkdirp(destPath, function (err) {
|
||||
fs.createReadStream(file, streamOptions)
|
||||
.pipe(fs.createWriteStream(destination, streamOptions));
|
||||
|
7
docs/header.html
Normal file
7
docs/header.html
Normal file
@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet"
|
||||
href="http://jasonm23.github.io/markdown-css-themes/avenir-white.css">
|
||||
</head>
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user