Used for extending the functionality of the template engine (Nunjucks). Sub-class this class to create a new template extension.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

_contextUser: UserInfo
tags: string[] = []

One or more tags that represent case-sensitive tag names that will invoke this extension.

Accessors

Methods

  • Required, must implement this method to run the extension.

    IMPORTANT: The actual signature of this method depends on what you pass to nodes.CallExtensionAsync() in your parse() method. The parameters listed here are just placeholders - your actual implementation will have different parameters.

    Common Patterns:

    • CallExtensionAsync(this, 'run', params)run(context, body, callBack)
    • CallExtensionAsync(this, 'run', params, [body])run(context, params, body, callBack)
    • CallExtensionAsync(this, 'run', params, [body, error])run(context, params, body, error, callBack)

    Parameters

    • context: any

      Always the first parameter: Nunjucks rendering context

    • Rest ...args: any[]

    Returns any

    See

    README.md in this directory for detailed documentation on parameter mapping