Wrapper around MDEx for rendering Markdown to HTML.
Provides a consistent interface with {:ok, html} / {:error, reason}
tuples and a bang variant that raises on error.
Supports optional syntax highlighting theme selection via the theme parameter.
Examples
iex> {:ok, html} = Sayfa.Markdown.render("# Hello")
iex> html =~ "Hello"
true
iex> Sayfa.Markdown.render!("**bold**")
"<p><strong>bold</strong></p>"
Summary
Functions
Renders a Markdown string to HTML.
Headings include anchor IDs for linking (e.g., <h1 id="hello">...</h1>).
An optional theme string selects the syntax highlighting theme (default: "github_light").
Examples
iex> {:ok, html} = Sayfa.Markdown.render("# Hello")
iex> html =~ ~s(id="hello")
true
iex> Sayfa.Markdown.render("plain text")
{:ok, "<p>plain text</p>"}
Renders a Markdown string to HTML, raising on error.
Examples
iex> html = Sayfa.Markdown.render!("# Hello")
iex> html =~ ~s(id="hello")
true