mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-07-09 11:41:07 +01:00
feat: improve template helper wiring
This commit is contained in:
@ -30,7 +30,9 @@ HandlebarsGenerator = module.exports =
|
||||
try
|
||||
# Compile and run the Handlebars template.
|
||||
template = HANDLEBARS.compile tpl,
|
||||
strict: false, assumeObjects: false, noEscape: data.opts.noescape
|
||||
strict: false
|
||||
assumeObjects: false
|
||||
noEscape: data.opts.noescape
|
||||
return template data
|
||||
catch
|
||||
throw
|
||||
@ -42,10 +44,6 @@ HandlebarsGenerator = module.exports =
|
||||
|
||||
generate: ( json, jst, format, curFmt, opts, theme ) ->
|
||||
|
||||
# Set up partials and helpers
|
||||
registerPartials format, theme
|
||||
registerHelpers theme, opts
|
||||
|
||||
# Preprocess text
|
||||
encData = json
|
||||
if format == 'html' || format == 'pdf'
|
||||
@ -53,6 +51,10 @@ HandlebarsGenerator = module.exports =
|
||||
if( format == 'doc' )
|
||||
encData = json.xmlify()
|
||||
|
||||
# Set up partials and helpers
|
||||
registerPartials format, theme
|
||||
registerHelpers theme, encData, opts
|
||||
|
||||
# Set up the context
|
||||
ctx =
|
||||
r: encData
|
||||
|
Reference in New Issue
Block a user