autodoc2.render.myst_#

Renderer for MyST.

Module Contents#

Classes#

MystRenderer

Render the documentation as MyST.

Data#

API#

autodoc2.render.myst_._RE_DELIMS = 'compile(...)'#
class autodoc2.render.myst_.MystRenderer(db: autodoc2.db.Database, config: autodoc2.config.Config, *, warn: Callable[[str, autodoc2.utils.WarningSubtypes], None] | None = None, all_resolver: autodoc2.resolve_all.AllResolver | None = None, standalone: bool = True)[source]#

Bases: autodoc2.render.base.RendererBase

Render the documentation as MyST.

Initialization

Initialise the renderer.

Parameters:
  • db – The database to obtain objects from.

  • config – The configuration.

  • warn – The function to use to log warnings.

  • all_resolver – The resolver to use, for following __all__ children.

  • standalone – If True, this renderer is being used to create a standalone document

EXTENSION = '.md'#
render_item(full_name: str) Iterable[str][source]#
generate_summary(objects: list[autodoc2.utils.ItemData], alias: dict[str, str] | None = None) Iterable[str][source]#
static enclosing_backticks(text: str) str[source]#

Ensure the enclosing backticks are more than any inner ones.

render_package(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for a package.

render_module(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for a module.

render_function(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for a function.

render_exception(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for an exception.

render_class(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for a class.

render_property(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for a property.

render_method(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for a method.

render_attribute(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for an attribute.

render_data(item: autodoc2.utils.ItemData) Iterable[str][source]#

Create the content for a data item.

_reformat_cls_base_myst(value: str) str[source]#

Reformat the base of a class for RST.

Base annotations can come in the form:

A[B, C, D]

which we want to reformat as:

{py:obj}`A`\[{py:obj}`B`, {py:obj}`C`, {py:obj}`D`\]