Skip to content

Commit f00c7bd

Browse files
authored
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
1 parent b83bc2e commit f00c7bd

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

default_theme/index.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,12 @@ module.exports = function (comments, options, callback) {
7171
}
7272
}
7373
};
74+
75+
sharedImports.imports.renderSectionList = _.template(fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'), sharedImports);
76+
sharedImports.imports.renderSection = _.template(fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'), sharedImports);
77+
sharedImports.imports.renderNote = _.template(fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), sharedImports);
7478

75-
var pageTemplate = _.template(
76-
fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), {
77-
imports: _.assign({}, sharedImports.imports, {
78-
renderSection: _.template(
79-
fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'),
80-
sharedImports),
81-
renderNote: _.template(
82-
fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'),
83-
sharedImports),
84-
renderSectionList: _.template(
85-
fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'),
86-
sharedImports)
87-
})
88-
});
79+
var pageTemplate = _.template(fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), sharedImports);
8980

9081
// push assets into the pipeline as well.
9182
vfs.src([__dirname + '/assets/**'], { base: __dirname })

lib/output/util/linker_stack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function LinkerStack(config) {
6767
* path.
6868
*
6969
* @param {Array<Object>} comments a list of comments
70-
* @param {Function} a method that turns a namespace into a URL
70+
* @param {Function} resolver a method that turns a namespace into a URL
7171
* @returns {LinkerStack} returns this
7272
* @private
7373
* @example

0 commit comments

Comments
 (0)