markdown: Shared lightweight Markdown engine construction, independent of the typed document model#
Shared lightweight Markdown engine construction, independent of the typed document model.
- myform.markdown.build_engine(extensions: tuple[str, ...], options: Mapping[str, Any] | None = None) MarkdownIt#
Build the exact engine
mdformat.textbuilds for the given extension set.Delegates to
mdformat’s ownbuild_mditwith theMDRendererclass and the samemdformat_optsshape (user options plus a blankfilename), so every registered plugin – including this package’smystentry point – configures the engine identically to the mdformat plugin path. This sharing is what makesconvert(text, f, f)a byte-for-byte fixed point of today’s formatter.- Parameters:
extensions – The mdformat parser-extension names to enable (e.g.
('myst',)).options – mdformat options (e.g.
{'number': True}), asmdformat.texttakes them.
- Returns:
A configured
MarkdownItengine whose renderer is mdformat’sMDRenderer.