Asciidoctor::PreprocessorReader
Inherits Asciidoctor::Reader < Asciidoctor::Logging < Reference < Object
Public: Methods for retrieving lines from AsciiDoc source files, evaluating preprocessor directives as each line is read off the Array of lines.
Constructors
Instance methods
Create a Cursor for an include file.
Check whether this reader is empty (contains no lines). Overrides Reader#empty? to pop the include stack if needed.
Reports whether pushing an include on the include stack exceeds the max include depth.
Returns nil if no max depth is set and includes are disabled (max-include-depth=0), false if the current max depth will not be exceeded, and the relative max include depth if the current max depth will be exceeded.
Check whether there are any lines left to read. Overrides Reader#has_more_lines? to use peek_line (which pops include stack).
Override the Reader#peek_line method to pop the include stack if the last line has been reached and there's at least one include on the stack.
Internal: Preprocess the directive to conditionally include or exclude content.
name - The name of the conditional inclusion directive (ifdef, ifndef, ifeval, endif) target - The target, which is the name of one or more attributes delimiter - The conditional delimiter for multiple attributes ('+' or ',') text - The text associated with this directive (between square brackets)
Returns a Boolean indicating whether the cursor should be advanced.
Internal: Preprocess the directive to include lines from another document.
target - The unsubstituted String name of the target document attrlist - An attribute list String (text between square brackets)
Returns a Boolean indicating whether the line under the cursor was changed.
Push source onto the front of the reader and switch the context based on the file, document-relative path and line information given.
Internal: Resolve the value of one side of an ifeval expression.
Returns the resolved value (String, Int32, Float64, Bool, or Nil).
Private: Ignore front-matter, commonly used in static site generators.
data - The Array of String source lines increment_linenos - Whether to increment line numbers (default: true)
Returns the Array of front-matter lines, or nil if not detected.