1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-10 07:47:07 +01:00

Refactor generation.

Merge implicit and explicit generation paths, start emitting file
transform & copy signals, fix various bugs, introduce new bugs, support
better --debug outputs in the future.
This commit is contained in:
hacksalot
2016-02-09 15:27:34 -05:00
parent 1bc4263a46
commit aaa5e1fc1f
11 changed files with 336 additions and 282 deletions

View File

@ -22,12 +22,13 @@ UnderscoreGenerator = module.exports =
generateSimple: ( data, tpl ) ->
try
# Compile and run the Handlebars template.
tpl = _.template tpl
template data
t = _.template tpl
t data
catch
#console.dir _error
HMS = require '../core/status-codes'
throw
fluenterror: HMS[if tpl then 'invokeTemplate' else 'compileTemplate']
fluenterror: HMS[if t then 'invokeTemplate' else 'compileTemplate']
inner: _error
@ -49,9 +50,9 @@ UnderscoreGenerator = module.exports =
XML: require 'xml-escape'
RAW: json
cssInfo: cssInfo
#engine: this
#engine: @
headFragment: opts.headFragment || ''
opts: opts
registerHelpers theme, opts, cssInfo, ctx, this
registerHelpers theme, opts, cssInfo, ctx, @
@generateSimple ctx, jst