Skip to content

Generate Provider

Hooks that generate files through jinja templating.

Hooks

Type Description Return
file_update Hook for jinja templates. If given an output, the rendered contents are output to a file, otherwise the rendered contents are output as a string. None
generate Hook for generating project outputs. Recursively renders all files and folders in a given target directory to an output. If there is a "templates" directory and a file or directory that matches the templates input param, use that as target. Paths to templates and output are cross-platform but should be written with / path separators. None
jinja Hook for jinja templates. If given an output, the rendered contents are output to a file, otherwise the rendered contents are output as a string. str
update_section Hook for updating a section of a document. None

Examples

jinja

Render a single file

compact->: jinja path/to/template/file.tpl output/path.py
expanded:
  ->: jinja
  template: path/to/template/file.tpl
  ouput: output/path.py

generate

Recursively render a directory

stuff: things  # Arbitrary context
compact->: generate path/to/template/file/or/dir output/path
expanded:
  ->: jinja
  template: path/to/template/file/or/dir
  output: output/path