class Asciidoctor::Extensions::Preprocessor

Public: Preprocessors are run after the source text is split into lines and normalized, but before parsing begins.

Prior to invoking the preprocessor, Asciidoctor splits the source text into lines and normalizes them. The normalize process strips trailing whitespace from each line and leaves behind a line-feed character (i.e., ā€œnā€).

Asciidoctor passes a reference to the Reader and a copy of the lines Array to the {Processor#process} method of an instance of each registered Preprocessor. The Preprocessor modifies the Array as necessary and either returns a reference to the same Reader or a reference to a new Reader.

Preprocessor implementations must extend the Preprocessor class.

Constants

DSL

Internal: Overlays a builder DSL for configuring the Processor instance. Includes a method to define configuration options and another to define the {Processor#process} method.

Public Instance Methods

process(document, reader) click to toggle source
# File lib/asciidoctor/extensions.rb, line 180
def process document, reader
  raise ::NotImplementedError
end