Renders .astral templates with HEEx semantics.
A .astral file is a small single-file template: an optional leading Elixir
setup block delimited by ---, followed by HEEx markup. Component files under
the configured components directory become local HEEx function components, so
components/formatted_date.astral is called as <.formatted_date />.
Summary
Functions
Return the template source currently being rendered in this process.
Render template source with project components and assigns.
Render a .astral file with project components and assigns.
Render a Markdown file as HEEx with project components and assigns.
Evaluate a .astral setup block and return its Elixir binding.
Return true when a path points to an Astral template.
Functions
@spec current_source() :: String.t() | nil
Return the template source currently being rendered in this process.
@spec render(Astral.Template.Source.t(), map() | keyword(), Astral.Config.t()) :: {:ok, String.t()} | {:error, term()}
Render template source with project components and assigns.
@spec render_file(String.t(), map() | keyword(), Astral.Config.t()) :: {:ok, String.t()} | {:error, term()}
Render a .astral file with project components and assigns.
@spec render_markdown_file(String.t(), map() | keyword(), Astral.Config.t()) :: {:ok, String.t()} | {:error, term()}
Render a Markdown file as HEEx with project components and assigns.
@spec setup_binding_file(String.t(), map() | keyword(), Astral.Config.t()) :: {:ok, keyword()} | {:error, term()}
Evaluate a .astral setup block and return its Elixir binding.
Return true when a path points to an Astral template.