PtcRunner.SiteGuides.MarkdownHTML (PtcRunner v0.14.0)

Copy Markdown View Source

Renders the bounded Markdown subset the guides use into HTML for the static site.

The renderer is deliberately fail-closed: an element, attribute, parser warning, or link shape it does not recognise raises instead of publishing something silently wrong. Extend the whitelists when a guide legitimately needs more Markdown.

Summary

Functions

Renders one guide's Markdown.

Types

rendered()

@type rendered() :: %{title: String.t(), description: String.t(), html: String.t()}

Functions

render!(markdown, source, rewrite_link)

@spec render!(String.t(), String.t(), (String.t() -> String.t())) :: rendered()

Renders one guide's Markdown.

source labels errors. rewrite_link receives every href exactly as written in the Markdown and returns the href to publish; it should raise on a target it cannot account for.