From 80452ee9fcfdc129c17519fdf93207b9176921a5 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Tue, 1 Sep 2015 16:10:23 -0500 Subject: [PATCH] fix doc path issues --- scripts/docs/dgeni-config.js | 18 ++++++++++-------- scripts/docs/processors/index-page.js | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/docs/dgeni-config.js b/scripts/docs/dgeni-config.js index 833b824b58..845a7c8db8 100644 --- a/scripts/docs/dgeni-config.js +++ b/scripts/docs/dgeni-config.js @@ -31,11 +31,12 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty }) //configure file reading -.config(function(readFilesProcessor, inlineTagProcessor, readTypeScriptModules) { +.config(function(readFilesProcessor, readTypeScriptModules) { - // Don't run unwanted processors - readFilesProcessor.$enabled = false; // We are not using the normal file reading processor + // Don't run unwanted processors since we are not using the normal file reading processor + readFilesProcessor.$enabled = false; readFilesProcessor.basePath = path.resolve(__dirname, '../..'); + readTypeScriptModules.basePath = path.resolve(path.resolve(__dirname, '../..')); readTypeScriptModules.sourceFiles = [ 'ionic/ionic.ts' @@ -58,9 +59,8 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty }) // Configure file writing -.config(function(writeFilesProcessor, versionInfo) { - // TODO(tlancina): Use nightly if version isn't specified by gulp task - writeFilesProcessor.outputFolder = 'dist/ionic-site/docs/' + versionInfo.currentVersion.raw + '/api/'; +.config(function(writeFilesProcessor) { + writeFilesProcessor.outputFolder = 'dist/ionic-site' }) // Configure rendering @@ -104,7 +104,7 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty }) // Configure ids and paths -.config(function(computeIdsProcessor, computePathsProcessor) { +.config(function(computeIdsProcessor, computePathsProcessor, versionInfo) { // computeIdsProcessor.idTemplates.push({ // docTypes: ['guide'], // getId: function(doc) { @@ -124,7 +124,9 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty computePathsProcessor.pathTemplates = [{ docTypes: ['class', 'var', 'function', 'let'], getOutputPath: function(doc) { - return doc.fileInfo.relativePath + // TODO(tlancina): Use nightly if version isn't specified by gulp task + // TODO(tlancina): inject api base path + return 'docs/' + versionInfo.currentVersion.raw + '/api/' + doc.fileInfo.relativePath // strip ionic from path root .replace(/^ionic\//, '') // replace extension with .html diff --git a/scripts/docs/processors/index-page.js b/scripts/docs/processors/index-page.js index 9eabb857e6..8b56f20265 100644 --- a/scripts/docs/processors/index-page.js +++ b/scripts/docs/processors/index-page.js @@ -6,12 +6,13 @@ module.exports = function indexPage() { $runAfter: ['adding-extra-docs'], $runBefore: ['extra-docs-added'], $process: function(docs) { + //TODO(tlancina): inject api base path or at least version docs.push({ docType: 'index-page', id: 'index-page', currentVersion: this.version, template: 'api_index.template.html', - outputPath: 'index.md' + outputPath: 'docs/2.0.0-alpha.2/api/index.md' }); } }