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
This commit is contained in:
Tom MacWright 2016-07-16 20:10:15 -04:00 committed by GitHub
parent b83bc2eff6
commit f00c7bd153
2 changed files with 6 additions and 15 deletions

View File

@ -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 })

View File

@ -67,7 +67,7 @@ function LinkerStack(config) {
* path.
*
* @param {Array<Object>} 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