From dd83662e0fdbf50df32de6274a06e9fb5d7b4939 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 29 Oct 2015 12:30:13 -0700 Subject: [PATCH] [Documentation] Add styling --- docs/footer.html | 9 +++++++++ docs/gendocs.js | 12 +++++++----- docs/header.html | 7 +++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 docs/footer.html create mode 100644 docs/header.html diff --git a/docs/footer.html b/docs/footer.html new file mode 100644 index 0000000000..e4e5daee87 --- /dev/null +++ b/docs/footer.html @@ -0,0 +1,9 @@ +
+ + This document is styled using + + https://github.com/jasonm23/markdown-css-themes + . + + + diff --git a/docs/gendocs.js b/docs/gendocs.js index 30182e30e7..51c84d9a64 100644 --- a/docs/gendocs.js +++ b/docs/gendocs.js @@ -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("\n"); + this.push(header); this.push(marked(markdown)); - this.push("\n\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)); diff --git a/docs/header.html b/docs/header.html new file mode 100644 index 0000000000..e6be56f543 --- /dev/null +++ b/docs/header.html @@ -0,0 +1,7 @@ + + + + + +