Module Asciidoctor::Extensions
In: lib/asciidoctor/extensions.rb

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, {Preprocessor}s modify or replace the source lines before parsing begins. {IncludeProcessor}s 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 {BlockProcessor}s and {BlockMacroProcessor}s, respectively.
  3. {TreeProcessor}s 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 {InlineMacroProcessor}s.
  5. {Postprocessor}s 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.

Methods

Classes and Modules

Module Asciidoctor::Extensions::BlockProcessorDsl
Module Asciidoctor::Extensions::DocinfoProcessorDsl
Module Asciidoctor::Extensions::IncludeProcessorDsl
Module Asciidoctor::Extensions::InlineMacroProcessorDsl
Module Asciidoctor::Extensions::MacroProcessorDsl
Module Asciidoctor::Extensions::ProcessorDsl
Module Asciidoctor::Extensions::SyntaxDsl
Class Asciidoctor::Extensions::BlockMacroProcessor
Class Asciidoctor::Extensions::BlockProcessor
Class Asciidoctor::Extensions::DocinfoProcessor
Class Asciidoctor::Extensions::Extension
Class Asciidoctor::Extensions::Group
Class Asciidoctor::Extensions::IncludeProcessor
Class Asciidoctor::Extensions::InlineMacroProcessor
Class Asciidoctor::Extensions::MacroProcessor
Class Asciidoctor::Extensions::Postprocessor
Class Asciidoctor::Extensions::Preprocessor
Class Asciidoctor::Extensions::Processor
Class Asciidoctor::Extensions::ProcessorExtension
Class Asciidoctor::Extensions::Registry
Class Asciidoctor::Extensions::TreeProcessor

Constants

DSL = ProcessorDsl
DSL = ProcessorDsl
Treeprocessor = TreeProcessor   Alias deprecated class name for backwards compatibility
DSL = ProcessorDsl
DSL = IncludeProcessorDsl
DSL = DocinfoProcessorDsl
DSL = BlockProcessorDsl
DSL = MacroProcessorDsl
DSL = InlineMacroProcessorDsl

External Aliases

create -> build_registry
  Deprecated: Use create instead of build_registry

Public Class methods

Public: Resolves the Class object for the qualified name.

Returns Class

Public: Registers an extension Group that subsequently registers a collection of extensions.

Registers the extension Group specified under the given name. If a name is not given, one is calculated by appending the next value in a 0-based index to the string "extgrp". For instance, the first unnamed extension group to be registered is assigned the name "extgrp0" if a name is not specified.

The names are not yet used, but are intended for selectively activating extensions in the future.

If the extension group argument is a String or a Symbol, it gets resolved to a Class before being registered.

name - The name under which this extension group is registered (optional, default: nil) group - A block (Proc), a Class, a String or Symbol name of a Class or

          an Object instance of a Class.

Examples

  Asciidoctor::Extensions.register UmlExtensions

  Asciidoctor::Extensions.register :uml, UmlExtensions

  Asciidoctor::Extensions.register do
    block_processor :plantuml, PlantUmlBlock
  end

  Asciidoctor::Extensions.register :uml do
    block_processor :plantuml, PlantUmlBlock
  end

Returns the [Proc, Class or Object] instance, matching the type passed to this method.

Internal: Resolve the specified object as a Class

object - The object to resolve as a Class

Returns a Class if the specified object is a Class (but not a Module) or a String that resolves to a Class; otherwise, nil

Public: Unregister statically-registered extension groups by name.

names - one or more Symbol or String group names to unregister

Returns nothing

Public: Unregister all statically-registered extension groups.

Returns nothing

[Validate]