class method Spah.DOM.Blueprint.compile
Spah.DOM.Blueprint.compile(htmlPath, templatePathMask, done) → void
-
html
(String
) – The raw HTML that will form the base of this Blueprint instance. -
done
(Function
) – The function to call once the document has been compiled. Receives two arguments (error, blueprintInstance).
(Server-side only) Creates a new HTML5 blueprint document to work with. Parses the file specified in the docPath
argument into a JSDOM environment, and then reads all Mustache files within the templatePathMask into the blueprint, inserting them into script tags at the bottom of the document body.
GOTCHA: If your markup is not valid (for instance, opening a tag that expects to be closed, then never closing it) you run the risk of leaving unanswered callbacks from jsdom, which can result in a node process that does not exit properly.