mrdocs::GeneratorRegistry

The generators a run can select.

Synopsis

class GeneratorRegistry;

Description

The registry owns every Generator of a run, whatever defined it. That covers the ones that ship with MrDocs (adoc, html, xml, json and noop), the ones the addons contribute as data, and the ones that pipeline extensions install. It starts with the built‐in ones. It does not know where the others come from. A script, a plugin, a data‐driven definition and a program's own code all add through install. There is no process‐wide registry, so two registries in one process do not see each other's generators.

GeneratorRegistry generators;
MRDOCS_TRY(generators.install(std::make_shared<MyGenerator>()));
Generator const* generator = generators.find("my-format");

Thread Safety

Adding and looking up a generator are synchronized with each other.

Member Functions

Name

Description

GeneratorRegistry [constructor]

Constructors

~GeneratorRegistry [destructor]

Destructor.

operator= [deleted]

Copy assignment operator

find

Return the generator with this id, or nullptr.

generators

Return the generators, in the order they were added.

install

Install a generator.

Created with MrDocs