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 and the end of line character sequence from each line.

Asciidoctor passes the document and the document's Reader to the {Processor#process} method of the Preprocessor instance. The Preprocessor can modify the Reader as necessary and either return the same Reader (or falsy, which is equivalent) or a reference to a substitute 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 316
def process document, reader
  raise ::NotImplementedError, %(Asciidoctor::Extensions::Preprocessor subclass must implement ##{__method__} method)
end