From 3f1d7f7a762540f0f3f68b575f65f241982d5153 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 2 May 2017 14:12:21 +0100 Subject: [PATCH] build(aio): add the api folder to the list of template folders --- aio/tools/transforms/angular-api-package/index.js | 8 +++++++- aio/tools/transforms/config.js | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index 9dd26f5653..f713d0d042 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -9,7 +9,7 @@ const Package = require('dgeni').Package; const basePackage = require('../angular-base-package'); const typeScriptPackage = require('dgeni-packages/typescript'); -const { API_SOURCE_PATH, requireFolder } = require('../config'); +const { API_SOURCE_PATH, API_TEMPLATES_PATH, requireFolder } = require('../config'); module.exports = new Package('angular-api', [basePackage, typeScriptPackage]) @@ -107,6 +107,12 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage]) }); }) + .config(function(templateFinder) { + // Where to find the templates for the API doc rendering + templateFinder.templateFolders.unshift(API_TEMPLATES_PATH); + }) + + .config(function(convertToJsonProcessor, postProcessHtml, EXPORT_DOC_TYPES) { const DOCS_TO_CONVERT = EXPORT_DOC_TYPES.concat([ 'decorator', 'directive', 'pipe', 'module' diff --git a/aio/tools/transforms/config.js b/aio/tools/transforms/config.js index e42be6d2b7..1321472987 100644 --- a/aio/tools/transforms/config.js +++ b/aio/tools/transforms/config.js @@ -4,6 +4,7 @@ const { readdirSync } = require('fs'); const PROJECT_ROOT = resolve(__dirname, '../../..'); const AIO_PATH = resolve(PROJECT_ROOT, 'aio'); const TEMPLATES_PATH = resolve(AIO_PATH, 'tools/transforms/templates'); +const API_TEMPLATES_PATH = resolve(TEMPLATES_PATH, 'api'); const CONTENTS_PATH = resolve(AIO_PATH, 'content'); const OUTPUT_PATH = resolve(AIO_PATH, 'src/content'); const DOCS_OUTPUT_PATH = resolve(OUTPUT_PATH, 'docs'); @@ -16,5 +17,5 @@ function requireFolder(dirname, folderPath) { .map(p => require(resolve(absolutePath, p))); } -module.exports = { PROJECT_ROOT, AIO_PATH, TEMPLATES_PATH, CONTENTS_PATH, OUTPUT_PATH, DOCS_OUTPUT_PATH, API_SOURCE_PATH, requireFolder }; +module.exports = { PROJECT_ROOT, AIO_PATH, TEMPLATES_PATH, API_TEMPLATES_PATH, CONTENTS_PATH, OUTPUT_PATH, DOCS_OUTPUT_PATH, API_SOURCE_PATH, requireFolder };