mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
allow template files to be specified as absolute paths (#480)
This commit is contained in:
parent
c2c163297e
commit
6156d45582
@ -38,8 +38,7 @@ exports.Template = function(path) {
|
|||||||
@return {function} Returns template closure.
|
@return {function} Returns template closure.
|
||||||
*/
|
*/
|
||||||
exports.Template.prototype.load = function(file) {
|
exports.Template.prototype.load = function(file) {
|
||||||
var _path = path.join(this.path, file);
|
return _.template(fs.readFileSync(file, 'utf8'), null, this.settings);
|
||||||
return _.template(fs.readFileSync(_path, 'utf8'), null, this.settings);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -53,6 +52,8 @@ exports.Template.prototype.load = function(file) {
|
|||||||
@return {string} Rendered template.
|
@return {string} Rendered template.
|
||||||
*/
|
*/
|
||||||
exports.Template.prototype.partial = function(file, data) {
|
exports.Template.prototype.partial = function(file, data) {
|
||||||
|
file = path.resolve(this.path, file);
|
||||||
|
|
||||||
// load template into cache
|
// load template into cache
|
||||||
if (!(file in this.cache)) {
|
if (!(file in this.cache)) {
|
||||||
this.cache[file] = this.load(file);
|
this.cache[file] = this.load(file);
|
||||||
|
|||||||
4
test/specs/jsdoc/template.js
Normal file
4
test/specs/jsdoc/template.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/*global describe: true, expect: true, it: true, xdescribe: true, xit: true */
|
||||||
|
xdescribe('jsdoc/template', function() {
|
||||||
|
// TODO
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user