[Documentation] Add text to main page #228

This commit is contained in:
Henry 2015-12-11 09:51:58 -08:00
parent 89a93e2966
commit 6200ceddf8
4 changed files with 49 additions and 45 deletions

View File

@ -106,7 +106,7 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
}
// Convert from Github-flavored Markdown to HTML
function gfmifier() {
function gfmifier(renderTOC) {
var transform = new stream.Transform({ objectMode: true }),
markdown = "";
transform._transform = function (chunk, encoding, done) {
@ -114,9 +114,11 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
done();
};
transform._flush = function (done) {
// Prepend table of contents
markdown =
[ TOC_HEAD, toc(markdown).content, "", markdown ].join("\n");
if (renderTOC){
// Prepend table of contents
markdown =
[ TOC_HEAD, toc(markdown).content, "", markdown ].join("\n");
}
this.push(header);
this.push(marked(markdown));
this.push(footer);
@ -146,6 +148,10 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
return customRenderer;
}
function matchesPattern(pattern, candidate){
return candidate.match(pattern);
}
options['in'] = options['in'] || options.i;
options.out = options.out || options.o;
@ -168,13 +174,14 @@ GLOBAL.window = GLOBAL.window || GLOBAL; // nomnoml expects window to be define
var destination = file.replace(options['in'], options.out)
.replace(/md$/, "html"),
destPath = path.dirname(destination),
prefix = path.basename(destination).replace(/\.html$/, "");
prefix = path.basename(destination).replace(/\.html$/, ""),
renderTOC = file.match(options['suppress-toc'] || "") === null;
mkdirp(destPath, function (err) {
fs.createReadStream(file, { encoding: 'utf8' })
.pipe(split())
.pipe(nomnomlifier(destPath, prefix))
.pipe(gfmifier())
.pipe(gfmifier(renderTOC))
.pipe(fs.createWriteStream(destination, {
encoding: 'utf8'
}));

View File

@ -1,38 +0,0 @@
<!--
Open MCT Web, Copyright (c) 2014-2015, United States Government
as represented by the Administrator of the National Aeronautics and Space
Administration. All rights reserved.
Open MCT Web is licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Open MCT Web includes source code licensed under additional open source
licenses. See the Open Source Licenses file (LICENSES.md) included with
this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information.
-->
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Open MCT Web Documentation</title>
</head>
<body class="user-environ" ng-view>
Sections:
<ul>
<li><a href="api/">API</a></li>
<li><a href="architecture/">Architecture Overview</a></li>
<li><a href="guide/">Developer Guide</a></li>
<li><a href="tutorials/">Tutorials</a></li>
<li><a href="process/">Development Process</a></li>
</ul>
</body>
</html>

35
docs/src/index.md Normal file
View File

@ -0,0 +1,35 @@
# OpenMCTWeb Documentation
## Overview
Documentation is provided to support the use and development of the
OpenMCTWeb mission operations software. It's recommended that before doing
any development with OpenMCTWeb you take some time to familiarize yourself
with the documentation below.
OpenMCTWeb provides functionality out of the box, but it's also a framework for
building rich mission operations applications based on modern web technology.
The framework is configured declaratively, and defines conventions for
building on the provided capabilities by creating modular 'bundles' that
extend the provided extension points. The details of how to extend the
framework are provided in the following documentation.
## Sections
* The [Architecture Overview](architecture/) describes the concepts used
throughout OpenMCTWeb, and gives a high level overview of the framework's design.
* The [Developer's guide](guide/) goes into more detail about how to use the
framework
and the capabilities that it provides.
* The [Tutorials](tutorials/) give examples of extending the platform to add
functionality,
and integrate with data sources.
* The [API](api/) document is generated from inline documentation
using jsdoc, and describes the javascript objects and functions that make up
the software framework.
* Finally, the [Development Process](process/) document describes the
OpenMCTWeb software development cycle.

View File

@ -31,7 +31,7 @@
"jshint": "jshint platform example || exit 0",
"watch": "karma start",
"jsdoc": "jsdoc -c jsdoc.json -r -d target/docs/api",
"otherdoc": "node docs/gendocs.js --in docs/src --out target/docs",
"otherdoc": "node docs/gendocs.js --in docs/src --out target/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
"docs": "npm run jsdoc ; npm run otherdoc"
},
"repository": {