From f00c7bd153c8abe7035ffaff2ef04c2318db284e Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 16 Jul 2016 20:10:15 -0400 Subject: [PATCH] Robertleeplummerjr master (#476) * Expose imports between templates Exposes `renderSectionList`, and `renderSection` & `renderNote` for consistency. Fixes #462 * Fixes #440 Resolve typo * Resolve variable name conflict * Change formatters to master --- default_theme/index.js | 19 +++++-------------- lib/output/util/linker_stack.js | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/default_theme/index.js b/default_theme/index.js index 870545e..7019983 100644 --- a/default_theme/index.js +++ b/default_theme/index.js @@ -71,21 +71,12 @@ module.exports = function (comments, options, callback) { } } }; + + sharedImports.imports.renderSectionList = _.template(fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'), sharedImports); + sharedImports.imports.renderSection = _.template(fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'), sharedImports); + sharedImports.imports.renderNote = _.template(fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), sharedImports); - var pageTemplate = _.template( - fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), { - imports: _.assign({}, sharedImports.imports, { - renderSection: _.template( - fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'), - sharedImports), - renderNote: _.template( - fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), - sharedImports), - renderSectionList: _.template( - fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'), - sharedImports) - }) - }); + var pageTemplate = _.template(fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), sharedImports); // push assets into the pipeline as well. vfs.src([__dirname + '/assets/**'], { base: __dirname }) diff --git a/lib/output/util/linker_stack.js b/lib/output/util/linker_stack.js index b74b869..6072d78 100644 --- a/lib/output/util/linker_stack.js +++ b/lib/output/util/linker_stack.js @@ -67,7 +67,7 @@ function LinkerStack(config) { * path. * * @param {Array} comments a list of comments - * @param {Function} a method that turns a namespace into a URL + * @param {Function} resolver a method that turns a namespace into a URL * @returns {LinkerStack} returns this * @private * @example