Generates resources by making use of a template engine. The template folder structure will be kept. Folders will be interpreted as containers and files as documents. A FileIdentifierMapper will be used to generate identifiers that correspond to the relative structure.

Metadata resources will be yielded separately from their subject resource.

A relative templateFolder is resolved relative to cwd, unless it's preceded by @css:, e.g. @css:foo/bar.

Implements

Constructors

Properties

Methods

Constructors

Properties

logger: Logger = ...

Methods

  • Generates resources with the given options, based on the given template folder. The output Iterable should be sorted so that containers always appear before their contents.

    Parameters

    • templateFolder: string

      Folder where the templates are located.

    • location: ResourceIdentifier

      Base identifier.

    • options: Dict<unknown>

      Options that can be used when generating resources.

    Returns AsyncIterable<Resource>

    A map where the keys are the identifiers and the values the corresponding representations to store.