module

Asciidoctor::Extensions

Extensions provide a way to participate in the parsing and converting phases of the AsciiDoc processor or extend the AsciiDoc syntax.

The various extensions participate in AsciiDoc processing as follows:

  1. After the source lines are normalized, Preprocessors modify or replace the source lines before parsing begins. IncludeProcessors are used to process include directives for targets which they claim to handle.
  2. The Parser parses the block-level content into an abstract syntax tree. Custom blocks and block macros are processed by associated BlockProcessors and BlockMacroProcessors, respectively.
  3. TreeProcessors are run on the abstract syntax tree.
  4. Conversion of the document begins, at which point inline markup is processed and converted. Custom inline macros are processed by associated InlineMacroProcessors.
  5. Postprocessors modify or replace the converted document.
  6. The output is written to the output stream.

Extensions may be registered globally using the Extensions.register method or added to a custom Registry instance and passed as an option to a single Asciidoctor processor.

Class methods

create(name : Symbol | Nil = nil) : Registry

Create a new Registry, optionally with a block-based group.

Source
generate_name

Generate a unique name for an extension group.

Source
groups

Get all globally registered extension groups.

Source
register(name : Symbol | Nil, group : Group.class) : Nil

Register an extension Group globally.

The group can be a Group subclass or an instance of a Group subclass.

Source
register(name : Symbol | Nil, group : Group) : Nil

Register an extension Group instance globally.

Source
unregister(*names : Symbol) : Nil

Unregister statically-registered extension groups by name.

Source
unregister_all

Unregister all statically-registered extension groups.

Source

Nested types