View Source Cascade (Cascade v0.2.0)

Generate code from templates.

Summary

Functions

Generate the code associated to the given template name.

Returns all available templates.

Functions

Link to this function

generate(name, root_path, args_or_opts \\ [])

View Source
@spec generate(
  name :: atom(),
  root_path :: String.t(),
  args_or_opts :: keyword() | [String.t()]
) :: {:error, String.t()} | :ok

Generate the code associated to the given template name.

  • root_path is expected to be the root directory under which the template will be generated.
  • args_or_opts can be an arbitrary keyword list with the template options or a list of command line arguments passed to the mix cascade task. In the latter case the arguments will be validated using the template's Cascade.Template.args_schema/0.
@spec templates() :: keyword()

Returns all available templates.

All modules implementing the Cascade.Template behaviour will be returned.