API Reference managoat_docs v#0.1.0

Copy Markdown View Source

Modules

A documentation manual embedded at compile time, so a Phoenix app can serve it at a path of its own (/docs) instead of publishing a second site.

The structural checks on an embedded manual, as functions that return a list of failure messages (empty when the manual is sound). Managoat.Docs.GuardrailCase wraps each one as an ExUnit test; they are functions first so a host can run one from a script, a release task or a test of its own shape.

Pure functions use Managoat.Docs runs at compile time to turn the authoring dialect of a manual into plain markdown. Split out because a module cannot call its own functions from its own body, and so the transforms can be tested directly.

The structural gate on an embedded manual, as a case template. A host uses it once, in a test file of its own, and gets every check in Managoat.Docs.Checks as an ExUnit test against its real manual. The test module's body starts with the use and goes on to tests about the manual's content

Markdown → HTML, rendered through MDEx (comrak), on two paths that share one pipeline: to_html/1 for untrusted input (agent or user output) and to_trusted_html/1 for an authored manual. Both return a binary of HTML; a Phoenix caller wraps it in Phoenix.HTML.raw/1. The untrusted path closes two holes that a plain markdown-to-HTML call leaves open (Fountain #323)