From 64e2de7aa6712391f5783176301247aa07c10978 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 30 Jul 2015 16:36:17 -0700 Subject: [PATCH] [Documentation] Add a build step Support generation of non-API docs using npm run docs. Supports MissionControl/vista#21 --- docsrc/architecture/index.md | 12 ++++++++++++ docsrc/gendocs.js | 15 +++++++++++++++ docsrc/guide/index.md | 9 --------- package.json | 4 +++- 4 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 docsrc/architecture/index.md diff --git a/docsrc/architecture/index.md b/docsrc/architecture/index.md new file mode 100644 index 0000000000..cbda4c46c5 --- /dev/null +++ b/docsrc/architecture/index.md @@ -0,0 +1,12 @@ +# Introduction + +This is a placeholder for an architectural description of Open MCT Web. + +```nomnoml +[ Start]->[ Load bundles.json] +[Load bundles.json]->[ Load bundle.json files] +[Load bundle.json files]->[ Resolve implementations] +[Resolve implementations]->[ Register with Angular] +[Register with Angular]->[ Bootstrap application] +[Bootstrap application]->[ End] +``` diff --git a/docsrc/gendocs.js b/docsrc/gendocs.js index c738c7ddb2..9f8954fc18 100644 --- a/docsrc/gendocs.js +++ b/docsrc/gendocs.js @@ -108,4 +108,19 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define }); }); + // Also copy over all HTML files + glob(options['in'] + "/**/*.html", {}, function (err, files) { + files.forEach(function (file) { + var destination = file.replace(options['in'], options.out), + destPath = path.dirname(destination); + + mkdirp(destPath, function (err) { + fs.createReadStream(file, { encoding: 'utf8' }) + .pipe(fs.createWriteStream(destination, { + encoding: 'utf8' + })); + }); + }); + }); + }()); diff --git a/docsrc/guide/index.md b/docsrc/guide/index.md index c826f4926b..0f72139a24 100644 --- a/docsrc/guide/index.md +++ b/docsrc/guide/index.md @@ -1,12 +1,3 @@ # Hello, world! This is a placeholder for the developer guide. - -```nomnoml -[ Start]->[ Load bundles.json] -[Load bundles.json]->[ Load bundle.json files] -[Load bundle.json files]->[ Resolve implementations] -[Resolve implementations]->[ Register with Angular] -[Register with Angular]->[ Bootstrap application] -[Bootstrap application]->[ End] -``` diff --git a/package.json b/package.json index 350bc7faa3..d594817ed2 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,9 @@ "start": "node app.js", "test": "karma start --single-run", "jshint": "jshint platform example || exit 0", - "jsdoc": "jsdoc -c jsdoc.json -r -d docs/api" + "jsdoc": "jsdoc -c jsdoc.json -r -d docs/api", + "otherdoc": "node docsrc/gendocs.js --in docsrc --out docs", + "docs": "npm run jsdoc ; npm run otherdoc" }, "repository": { "type": "git",