Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Latest commit

 

History

History
113 lines (78 loc) · 3.69 KB

templates.md

File metadata and controls

113 lines (78 loc) · 3.69 KB

Templates

Kind: global class

new Templates(config)

Represents a Templates

Param Type Description
config object The configuration object (optional)

templates.setDefaultOptions(defaultOptions) ⇒

Sets the default options passed to the compile function of each template engine.

Kind: instance method of Templates
Returns: same instance to allow chaining

Param Type Description
defaultOptions object The default options

templates.registerLibrary(library) ⇒

Registers a single library containing its own template engine directories, template engines, and template directories.

Kind: instance method of Templates
Returns: same instance to allow chaining

Param Type Description
library object The library object

templates.registerEngineDirectory(path) ⇒

Registers an engine directory.

Kind: instance method of Templates
Returns: same instance to allow chaining

Param Type Description
path Array.<string> The engine directory path

templates.registerEngine(path) ⇒

Registers a single engine.

Kind: instance method of Templates
Returns: same instance to allow chaining

Param Type Description
path Array.<string> | object The engine path or object

templates.registerTemplateDirectory(path) ⇒

Registers a template directory.

Kind: instance method of Templates
Returns: same instance to allow chaining

Param Type Description
path Array.<string> The template directory path

templates.compileFromSource(engineName, source, options) ⇒

Compiles a template from source

Kind: instance method of Templates
Returns: the compile template function

Param Type Description
engineName string The engine name to lookup
source string The template source
options object (Optional) The template options

templates.compileFromFile(templateFile, options) ⇒

Compiles a template from a file

Kind: instance method of Templates
Returns: the compile template function

Param Type Description
templateFile string The template file to compile
options object (Optional) The template options