Astral.Formatter (Astral v0.7.0)

Copy Markdown View Source

Formats .astral templates through the standard mix format pipeline.

Add Astral.Formatter to :plugins and include .astral files in :inputs in .formatter.exs. Elixir setup blocks use Code.format_string!/2; template bodies use Phoenix.LiveView.HTMLFormatter. JavaScript and TypeScript script bodies delegate to Volt unless an explicit :tag_formatters override is set.

Phoenix's HEEx formatting options, including :heex_line_length, :attribute_formatters and :tag_formatters, are passed through. Styles and non-JavaScript script bodies are left to Phoenix's preservation rules.

Summary

Functions

Advertise .astral support to Mix.

Format setup Elixir and HEEx using the same source boundary as the renderer.

Functions

features(opts)

Advertise .astral support to Mix.

format(source, opts)

Format setup Elixir and HEEx using the same source boundary as the renderer.