Template registry, embedded at compile time.
All regular files under priv/templates/<prefix>/... are read into
the module at compile time. A template's name is its path relative
to priv/templates/, e.g. "docker/dockerfile_v01.eex",
"helm/configmap_env.yaml.eex", "rel/env.sh.eex".
Prefixes
Files are organised by a single top-level directory under
priv/templates/, called the prefix. Some prefixes have a default
file extension that callers may omit:
helm→.yaml.eexdocker→.eexrel→.eex
So get("rel/env.sh") and get("rel/env.sh.eex") resolve to the
same template; get("helm/configmap_env") resolves to
helm/configmap_env.yaml.eex. As a convenience, callers that pass
the rendered-output name (e.g. get("helm/configmap_env.yaml"))
also resolve to the .eex source, so user-facing config files can
keep referring to templates by their output extension. Prefixes
without a default (e.g. k8s) always require the full filename.
EEx helpers
Built-in templates import Marea.Templates, only: [...] to call
yaml!/1, indent/2 and to_dashes/1 from EEx.
Summary
Functions
Renders the template named name as EEx with assigns. Raises if
the template is not embedded.
Renders raw EEx content with assigns.
Returns the template content, or nil if missing.
Same as get/1 but raises if the template is missing.
Indents every line of string by count spaces.
Lists template names whose path starts with prefix <> "/".
All embedded templates as %{relative_path => content}.
Replaces _ with - for use in template-generated identifiers.
Parses a single YAML document; returns [] for empty input.
Functions
Renders the template named name as EEx with assigns. Raises if
the template is not embedded.
Renders raw EEx content with assigns.
Used when the source isn't a built-in template (e.g. a user-supplied
file under <marea_dir>/templates/). name is used only for EEx
error messages. Whitespace-only lines in the result are collapsed
to keep generated YAML clean.
Returns the template content, or nil if missing.
name may include the file extension (e.g. "rel/env.sh.eex") or
omit it for a known prefix (e.g. "rel/env.sh").
Same as get/1 but raises if the template is missing.
@spec indent(String.t(), non_neg_integer()) :: String.t()
Indents every line of string by count spaces.
Lists template names whose path starts with prefix <> "/".
Returns the relative paths (with extension), suitable for passing
back to get/1 or expand/2.
All embedded templates as %{relative_path => content}.
Replaces _ with - for use in template-generated identifiers.
Parses a single YAML document; returns [] for empty input.