Class: Asciidoctor::Extensions::Preprocessor
- Defined in:
- lib/asciidoctor/extensions.rb
Overview
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 Asciidoctor::Extensions::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.
Constant Summary collapse
- DSL =
DocumentProcessorDsl
Instance Attribute Summary
Attributes inherited from Processor
Instance Method Summary collapse
Methods inherited from Processor
config, #create_block, #create_image_block, #create_inline, #create_list, #create_list_item, #create_section, enable_dsl, #initialize, option, #parse_attributes, #parse_content, #update_config
Constructor Details
This class inherits a constructor from Asciidoctor::Extensions::Processor
Instance Method Details
#process(document, reader) ⇒ Object
388 389 390 |
# File 'lib/asciidoctor/extensions.rb', line 388 def process document, reader raise ::NotImplementedError, %(#{Preprocessor} subclass #{self.class} must implement the ##{__method__} method) end |