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.text builds for the given extension set.

Delegates to mdformat’s own build_mdit with the MDRenderer class and the same mdformat_opts shape (user options plus a blank filename), so every registered plugin – including this package’s myst entry point – configures the engine identically to the mdformat plugin path. This sharing is what makes convert(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}), as mdformat.text takes them.

Returns:

A configured MarkdownIt engine whose renderer is mdformat’s MDRenderer.