YuriTemplate.Expander behaviour (yuri_template v1.1.0) View Source

The most common interface for the template expander.

Link to this section Summary

Types

Variable list specification.

Callbacks

Called to add an expansion of the next list of variables to the accumulator.

Link to this section Types

Specs

spec() :: [atom() | {:explode, atom()} | {:prefix, atom(), 1..10000}]

Variable list specification.

Link to this section Callbacks

Link to this callback

expand(accumulator, substitutes, variables)

View Source

Specs

expand(accumulator :: iodata(), substitutes :: Access.t(), variables :: spec()) ::
  iodata()

Called to add an expansion of the next list of variables to the accumulator.

Parameters

  • accumulator: iodata, possibly created by previous expanders.

  • substitutes: mapping names to values.

  • variables: list of names to get from substitutes.