Astral.Template.Source (Astral v0.3.2)

Copy Markdown View Source

Source for an Astral template file.

Astral keeps template source as a struct so renderers can distinguish static HTML layout strings from HEEx-backed .astral templates without relying on tuple conventions or map shapes.

Summary

Functions

Split an optional Elixir setup block from HEEx, returning its first source line.

Types

t()

@type t() :: %Astral.Template.Source{path: String.t(), source: String.t()}

Functions

split(source)

@spec split(String.t()) :: {String.t(), String.t(), pos_integer()}

Split an optional Elixir setup block from HEEx, returning its first source line.