Astral.Markdown (Astral v0.3.2)

Copy Markdown View Source

Markdown rendering backed by MDEx.

Astral delegates Markdown parsing and frontmatter extraction to MDEx, then delegates frontmatter decoding to YamlElixir.

Summary

Functions

Render Markdown source to HTML and page metadata using optional MDEx options.

Convert Markdown source to HEEx-compatible HTML while preserving component tags.

Functions

render(source, opts \\ [])

@spec render(
  String.t(),
  keyword()
) :: {:ok, Astral.Content.t()} | {:error, term()}

Render Markdown source to HTML and page metadata using optional MDEx options.

to_heex_html(source, opts \\ [])

@spec to_heex_html(
  String.t(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}

Convert Markdown source to HEEx-compatible HTML while preserving component tags.

Accepts MDEx options under :markdown and image/source context under :file. Astral retains frontmatter and heading conventions and enables HEEx parsing.