Class: Decorator

decorator~Decorator(logger, compiler) → {Decorator}

new Decorator(logger, compiler) → {Decorator}

Layout decorator.

Parameters:
Name Type Description
logger Logger
compiler Compiler
Source:
Returns:
Type
Decorator

Methods

(async) decorate(file) → {String}

Decorate input file with layout.

Parameters:
Name Type Description
file File
Source:
Returns:
Type
String

list() → {Array.<String>}

List registered layout.

Source:
Returns:
Type
Array.<String>

register(layout, fn, ctxopt)

Register a decorate function.

Parameters:
Name Type Attributes Default Description
layout String
fn decorateCallback | String

If string, will call Compiler on this filename while decorating.

ctx Object <optional>
null

Custom context if you want to pass something to this decorator. This is deprecated and you should use helper function with layout filter.

Source:

unregister(layout)

Unregister a decorate function.

Parameters:
Name Type Description
layout String
Source: