-
Notifications
You must be signed in to change notification settings - Fork 0
Methods
Several methods allow you to interface with Emboss.
Emboss.compile()
compiles a template. See the Precompilation page for more details.
var compiledTemplate = Emboss.compile(templateSource);
Emboss.render()
renders a template. To 'render' a template is to generate its output. In other words, this is the outputted HTML.
Its first argument can either be a compiled template or a template source. Compiled templates can be attained through Emboss.compile()
or Emboss.getPrecompiledTemplate()
.
It expects its second argument, if defined, to be an object containing data for the template. This argument is optional.
document.body.innerHTML = Emboss.render(template, {message: 'Hello World!'});
Emboss.bulkPrecompile
precompiles all templates in a document in bulk. See the Precompilation page for more details.
Emboss.storePrecompiledTemplate()
stores a precompiled template. It is used by the precompiled templates script produced by Emboss.bulkPrecompile()
to store precompiled templates in a neat and accessible manner. Users should not need to make use of this method themselves.
Emboss.getPrecompiledTemplate()
retrieves a precompiled template. See the Precompilation page for more details.
var precompiledTemplate = Emboss.getPrecompiledTemplate('templateID');