mrdocs::ExtensionRegistry
The user extension scripts declared by a configuration, loaded.
Synopsis
Declared in <mrdocs/Extensions/ExtensionRegistry.hpp>
class ExtensionRegistry;
Description
Extensions are optional and live entirely outside the Corpus a corpus is just extracted symbols. An application that has no extensions never needs this type; it does whatever an extension would do in its own code. An application that wants to honor a configuration's extension scripts loads them here and runs them as steps in its own workflow.
A .lua or .js file under an addon root's extensions/ directory is an extension. Running its top level (once, at load) registers two kinds of things: corpus transforms (mrdocs.register_transform) and output generators (mrdocs.register_generator). This object owns the scripting engines and the registered functions, so it must outlive both applyTransforms and any generator it hands out.
Typical workflow, after a corpus is built:
MRDOCS_TRY(ExtensionRegistry ext, ExtensionRegistry::load(config));
MRDOCS_TRY(ext.applyTransforms(corpus, config));
// then run generators: ext.findGenerator(id), else the built-in registry
Member Functions
Name |
Description |
|
Move constructor. |
|
Destructor. |
Move assignment. |
|
Apply the registered transforms to a corpus. |
|
Return the script‐defined generator with this id, or |
|
Return the script‐defined generators, as |