Class: Asciidoctor::Extensions::IncludeProcessor

Inherits:
Processor
  • Object
show all
Defined in:
lib/asciidoctor/extensions.rb

Overview

IncludeProcessors are used to process ‘include::<target>[]` directives in the source document.

When Asciidoctor comes across a ‘include::<target>[]` directive in the source document, it iterates through the IncludeProcessors and delegates the work of reading the content to the first processor that identifies itself as capable of handling that target.

IncludeProcessor implementations must extend IncludeProcessor. – TODO add file extension or regexp as shortcut for handles? method

Constant Summary collapse

DSL =
IncludeProcessorDsl

Instance Attribute Summary

Attributes inherited from Processor

#config

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

#handles?(target) ⇒ Boolean

Returns:

  • (Boolean)


452
453
454
# File 'lib/asciidoctor/extensions.rb', line 452

def handles? target
  true
end

#process(document, reader, target, attributes) ⇒ Object

Raises:

  • (::NotImplementedError)


448
449
450
# File 'lib/asciidoctor/extensions.rb', line 448

def process document, reader, target, attributes
  raise ::NotImplementedError, %(#{IncludeProcessor} subclass #{self.class} must implement the ##{__method__} method)
end