supply version info to docs processors

This commit is contained in:
Tim Lancina
2015-09-03 14:30:33 -05:00
parent 6d1eee6ced
commit 82b18689ae
3 changed files with 7 additions and 10 deletions

View File

@ -1,18 +1,18 @@
module.exports = function indexPage() {
module.exports = function indexPage(renderDocsProcessor) {
return {
name: 'index-page',
description: 'Create documentation index page',
version: 'nightly',
$runAfter: ['adding-extra-docs'],
$runBefore: ['extra-docs-added'],
$process: function(docs) {
//TODO(tlancina): inject api base path or at least version
var currentVersion = renderDocsProcessor.extraData.version.current.name;
docs.push({
docType: 'index-page',
id: 'index-page',
currentVersion: this.version,
currentVersion: currentVersion,
template: 'api_index.template.html',
outputPath: 'docs/2.0.0-alpha.2/api/index.md'
outputPath: 'docs/' + currentVersion + '/api/index.md'
});
}
}