mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-02 20:37:08 +01:00
feat: improve template helper wiring
This commit is contained in:
4
dist/helpers/handlebars-helpers.js
vendored
4
dist/helpers/handlebars-helpers.js
vendored
@ -26,7 +26,7 @@ Template helper definitions for Handlebars.
|
||||
@method registerHelpers
|
||||
*/
|
||||
|
||||
module.exports = function(theme, opts) {
|
||||
module.exports = function(theme, rez, opts) {
|
||||
var curGlob, ex, glob, slash, wrappedHelpers;
|
||||
helpers.theme = theme;
|
||||
helpers.opts = opts;
|
||||
@ -37,7 +37,7 @@ Template helper definitions for Handlebars.
|
||||
var args;
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
args.shift();
|
||||
args.pop();
|
||||
args[args.length - 1] = rez;
|
||||
return func.apply(this, args);
|
||||
});
|
||||
}
|
||||
|
4
dist/renderers/handlebars-generator.js
vendored
4
dist/renderers/handlebars-generator.js
vendored
@ -51,8 +51,6 @@ Definition of the HandlebarsGenerator class.
|
||||
},
|
||||
generate: function(json, jst, format, curFmt, opts, theme) {
|
||||
var ctx, encData;
|
||||
registerPartials(format, theme);
|
||||
registerHelpers(theme, opts);
|
||||
encData = json;
|
||||
if (format === 'html' || format === 'pdf') {
|
||||
encData = json.markdownify();
|
||||
@ -60,6 +58,8 @@ Definition of the HandlebarsGenerator class.
|
||||
if (format === 'doc') {
|
||||
encData = json.xmlify();
|
||||
}
|
||||
registerPartials(format, theme);
|
||||
registerHelpers(theme, encData, opts);
|
||||
ctx = {
|
||||
r: encData,
|
||||
RAW: json,
|
||||
|
Reference in New Issue
Block a user