bobzhang/asciidoctor/core does not have a README file

    CalloutMarks

    type CalloutMarks = Map[Int, Array[(AttrVal, String)]]

    Callout marks extracted from the source of a source block, indexed by 1-based line number: the (guard, numeral) pairs of the callouts on that line, in order (Ruby extract_callouts). The guard is Nil, the line comment prefix (Str) or List(["<!--", "-->"]) for XML callouts.

    ConverterFactory

    type ConverterFactory = (String, String?, Node) -> &Converter

    Creates a converter for a backend: (backend, htmlsyntax, document) -> converter.

    SyntaxHighlighterFactory

    type SyntaxHighlighterFactory = (String, String, Node) -> &SyntaxHighlighter?

    Converter

    pub(open) trait Converter {
    fn convert(Self, Node, String) -> String
    fn backend_traits(Self) -> BackendTraits
    }

    A converter turns nodes into output. transform is the node name (paragraph, inline_quoted, ...) or document/embedded/outline.

    SyntaxHighlighter

    pub(open) trait SyntaxHighlighter {
    fn name(Self) -> String
    fn handles_highlighting(Self) -> Bool = _
    fn highlight(Self, Node, String, String?, HighlightOptions) -> (String, Int?) = _
    fn format(Self, Node, String?, FormatOptions) -> String = _
    fn has_docinfo(Self, String) -> Bool = _
    fn docinfo(Self, String, Node, DocinfoOptions) -> String = _
    fn writes_stylesheet(Self, Node) -> Bool = _
    fn write_stylesheet(Self, Node) -> Array[(String, String)] = _
    }

    A syntax highlighter adapter (Ruby SyntaxHighlighter).

    A server-side adapter returns true from handles_highlighting (Ruby highlight?); highlight then handles the specialcharacters substitution of source blocks. A client-side adapter only formats the block and inserts docinfo markup. Every method but name has a default (Ruby SyntaxHighlighter::Base).

    Vfs

    pub(open) trait Vfs {
    fn read(Self, String) -> Bytes?
    fn is_file(Self, String) -> Bool
    fn is_dir(Self, String) -> Bool
    fn cwd(Self) -> String
    fn home(Self) -> String
    }

    Synchronous virtual file system used by the (pure) processor for include directives, docinfo files, stylesheets and embedded images. Real file access is provided by the io package, which preloads files asynchronously.

    ArgumentError

    pub(all) suberror ArgumentError {
    ArgumentError(String)
    }

    Raised by the public API when it is given invalid arguments (Ruby ArgumentError).

    ProcessingError

    pub(all) suberror ProcessingError {
    MissingConverter(String)
    ConversionFailed(String)
    }

    Raised when a document cannot be processed.

    ProcessingError::message

    fn ProcessingError::message(self : ProcessingError) -> String

    The message Ruby Asciidoctor uses for the error.

    SecurityError

    pub suberror SecurityError {
    SecurityError(String)
    } derive(
    Debug
    )

    Raised when a path escapes the jail in non-recovering mode.

    AttrKey

    pub(all) enum AttrKey {
    Name(String)
    Pos(Int)
    } derive(Eq, Hash,
    Debug
    )

    Key of an attribute: named (String) or positional (1-based Int).

    AttrVal

    pub(all) enum AttrVal {
    Str(String)
    Int(Int)
    Float(Double)
    Bool(Bool)
    List(Array[String])
    Nil
    } derive(Eq,
    Debug
    )

    An attribute value. Ruby Asciidoctor stores strings, integers, floats, booleans and nil in attribute hashes; this enum mirrors that.

    AttrVal::is_str

    fn AttrVal::is_str(self : AttrVal, s : String) -> Bool

    Ruby == against a string.

    AttrVal::to_f

    fn AttrVal::to_f(self : AttrVal) -> Double

    Ruby to_f of the value.

    AttrVal::to_i

    fn AttrVal::to_i(self : AttrVal) -> Int

    Ruby to_i of the value.

    AttrVal::to_s

    fn AttrVal::to_s(self : AttrVal) -> String

    Ruby to_s of the value (nil → "").

    AttrVal::truthy

    fn AttrVal::truthy(self : AttrVal) -> Bool

    Ruby truthiness: only nil and false are falsy.

    AttributeEntry

    pub(all) struct AttributeEntry {
    name : String
    value : String?
    negate : Bool
    } derive(
    Debug
    )

    A document attribute assignment recorded in the body of a document and replayed during conversion (Ruby Document::AttributeEntry).

    AttributeEntry::new

    fn AttributeEntry::new(name : String, value : String?, negate? : Bool) -> AttributeEntry

    Attributes

    pub struct Attributes {
    entries : Array[AttributeEntry]?
    // private fields
    }

    An insertion-ordered attribute map (Ruby Hash semantics) plus the attribute entries that Ruby stores under the :attribute_entries key.

    Attributes::clear

    fn Attributes::clear(self : Attributes) -> Unit

    Attributes::clear_entries

    fn Attributes::clear_entries(self : Attributes) -> Unit

    Ruby attrs.delete :attribute_entries.

    Attributes::contains

    fn Attributes::contains(self : Attributes, name : String) -> Bool

    Ruby attrs.key?(name).

    Attributes::contains_pos

    fn Attributes::contains_pos(self : Attributes, i : Int) -> Bool

    Attributes::copy

    fn Attributes::copy(self : Attributes) -> Attributes

    Shallow copy (Ruby Hash#merge with no arguments).

    Attributes::from_array

    fn Attributes::from_array(pairs : Array[(String, AttrVal)]) -> Attributes

    Attributes::get

    fn Attributes::get(self : Attributes, name : String) -> AttrVal?

    Raw value of a named attribute.

    Attributes::get_key

    fn Attributes::get_key(self : Attributes, k : AttrKey) -> AttrVal?

    Attributes::get_pos

    fn Attributes::get_pos(self : Attributes, i : Int) -> AttrVal?

    Raw value of a positional attribute.

    Attributes::is_empty

    fn Attributes::is_empty(self : Attributes) -> Bool

    Whether the map is empty (the attribute entries count as a key, as in Ruby).

    Attributes::iter

    fn Attributes::iter(self : Attributes) -> Iter2[AttrKey, AttrVal]

    Iterates over (key, value) pairs in insertion order.

    Attributes::length

    fn Attributes::length(self : Attributes) -> Int

    Attributes::names

    fn Attributes::names(self : Attributes) -> Array[String]

    Named keys in insertion order.

    Attributes::new

    fn Attributes::new() -> Attributes

    Attributes::pos_str

    fn Attributes::pos_str(self : Attributes, i : Int) -> String?

    Positional attribute as string when truthy.

    Attributes::remove

    fn Attributes::remove(self : Attributes, name : String) -> AttrVal?

    Removes a named attribute, returning its value.

    Attributes::remove_key

    fn Attributes::remove_key(self : Attributes, k : AttrKey) -> Unit

    Attributes::remove_pos

    fn Attributes::remove_pos(self : Attributes, i : Int) -> AttrVal?

    Attributes::remove_str

    fn Attributes::remove_str(self : Attributes, name : String) -> String?

    Removes a named attribute, returning its value as a string when truthy.

    Attributes::replace

    fn Attributes::replace(self : Attributes, other : Attributes) -> Unit

    Replaces all contents with those of other (Ruby Hash#replace).

    Attributes::save_entry

    fn Attributes::save_entry(self : Attributes, entry : AttributeEntry) -> Unit

    Records an attribute entry (Ruby AttributeEntry#save_to).

    Attributes::set

    fn Attributes::set(self : Attributes, name : String, v : AttrVal) -> Unit

    Attributes::set_default

    fn Attributes::set_default(self : Attributes, name : String, v : AttrVal) -> Unit

    Ruby attrs[name] ||= value.

    Attributes::set_key

    fn Attributes::set_key(self : Attributes, k : AttrKey, v : AttrVal) -> Unit

    Attributes::set_pos

    fn Attributes::set_pos(self : Attributes, i : Int, v : AttrVal) -> Unit

    Attributes::set_str

    fn Attributes::set_str(self : Attributes, name : String, v : String) -> Unit

    Attributes::str

    fn Attributes::str(self : Attributes, name : String) -> String?

    Ruby attrs[name] coerced to a string when truthy (nil/false → None).

    Attributes::truthy

    fn Attributes::truthy(self : Attributes, name : String) -> Bool

    Whether a named attribute has a truthy value (Ruby if attrs[name]).

    Attributes::update

    fn Attributes::update(self : Attributes, other : Attributes) -> Unit

    Merges other into self, overwriting (Ruby Hash#update).

    Author

    pub(all) struct Author {
    name : String?
    firstname : String?
    middlename : String?
    lastname : String?
    initials : String?
    email : String?
    } derive(
    Debug
    )

    A document author (Ruby Document::Author).

    BackendTraits

    pub(all) struct BackendTraits {
    basebackend : String
    filetype : String
    htmlsyntax : String?
    outfilesuffix : String
    supports_templates : Bool
    } derive(
    Debug
    )

    Traits describing a backend (Ruby Converter::BackendTraits).

    BlockMacroProcessor

    pub(all) struct BlockMacroProcessor {
    name : String
    config : ExtensionConfig
    process : (Node, String, Attributes) -> Node? raise
    }

    BlockProcessor

    pub(all) struct BlockProcessor {
    name : String
    config : ExtensionConfig
    process : (Node, Reader, Attributes) -> Node? raise
    }

    BlockSubs

    pub(all) enum BlockSubs {
    DefaultSubs(Array[Sub]?)
    ExplicitSubs(Array[Sub])
    SubsSpec(String)
    NoSubs
    }

    How the subs of a new block are specified (Ruby opts[:subs]).

    Callouts

    pub struct Callouts {
    // private fields
    }

    Tracks callouts across listing blocks and callout lists (Ruby Callouts).

    Callouts::callout_ids

    fn Callouts::callout_ids(self : Callouts, li_ordinal : Int) -> String

    Space-separated ids of the callouts with the given ordinal.

    Callouts::new

    fn Callouts::new() -> Callouts

    Callouts::next_list

    fn Callouts::next_list(self : Callouts) -> Unit

    Callouts::read_next_id

    fn Callouts::read_next_id(self : Callouts) -> String?

    Reads the id of the next callout in the current list.

    Callouts::register

    fn Callouts::register(self : Callouts, li_ordinal : String) -> String

    Registers a callout with the given ordinal; returns its id.

    Callouts::rewind

    fn Callouts::rewind(self : Callouts) -> Unit

    Catalog

    pub struct Catalog {
    refs : Map[String, Node]
    footnotes : Array[Footnote]
    links : Array[String]
    images : Array[ImageReference]
    callouts : Callouts
    includes : Map[String, Bool]
    }

    Document catalog (Ruby Document#catalog).

    CellData

    pub struct CellData {
    text : String
    colspan : Int?
    rowspan : Int?
    inner_document : Node?
    // private fields
    }

    Table cell data.

    ColSpec

    pub(all) struct ColSpec {
    width : Int
    halign : String?
    valign : String?
    style : String?
    } derive(
    Debug
    )

    A column spec (Ruby Hash with width, halign, valign, style).

    Compliance

    pub(all) struct Compliance {
    block_terminates_paragraph : Bool
    strict_verbatim_paragraphs : Bool
    underline_style_section_titles : Bool
    unwrap_standalone_preamble : Bool
    attribute_missing : String
    attribute_undefined : String
    shorthand_property_syntax : Bool
    natural_xrefs : Bool
    unique_id_start_index : Int
    markdown_syntax : Bool
    }

    Global compliance settings (Ruby Asciidoctor::Compliance).

    CompositeConverter

    pub struct CompositeConverter {
    handlers : Map[String, (Node) -> String]
    delegate : &Converter
    }

    A converter that dispatches individual transforms to handler functions and falls back to a delegate (Ruby CompositeConverter / converter subclassing).

    CompositeConverter::new

    fn CompositeConverter::new(delegate : &Converter, handlers? : Map[String, (Node) -> String]) -> CompositeConverter

    ContentModel

    pub(all) enum ContentModel {
    Compound
    Simple
    Verbatim
    Raw
    Empty
    Skip
    Attributes
    } derive(Eq,
    Debug
    )

    How the content of a block is processed.

    ContentModel::name

    fn ContentModel::name(self : ContentModel) -> String

    Context

    pub(all) enum Context {
    Document
    Section
    Preamble
    Paragraph
    Admonition
    Listing
    Literal
    Example
    Sidebar
    Quote
    Verse
    Open
    Pass
    Stem
    Image
    Audio
    Video
    ThematicBreak
    PageBreak
    FloatingTitle
    Toc
    Ulist
    Olist
    Dlist
    Colist
    ListItem
    Table
    TableCell
    TableColumn
    Anchor
    Break
    Button
    Callout
    Footnote
    Indexterm
    Kbd
    Menu
    Quoted
    Source
    FencedCode
    Comment
    Abstract
    PartIntro
    LatexMath
    AsciiMath
    Custom(String)
    } derive(Eq, Hash,
    Debug
    )

    The context (kind) of a node. Mirrors the Ruby symbols (:paragraph, ...).

    Context::from_name

    fn Context::from_name(s : String) -> Context

    Parses a Ruby context name (Ruby String#to_sym).

    Context::name

    fn Context::name(self : Context) -> String

    The Ruby name of the context (:floating_title → "floating_title").

    Cursor

    pub(all) struct Cursor {
    file : String?
    dir : String?
    path : String?
    lineno : Int
    } derive(Eq,
    Debug
    )

    A source location (Ruby Reader::Cursor).

    Cursor::advance

    fn Cursor::advance(self : Cursor, num : Int) -> Unit

    Cursor::dup

    fn Cursor::dup(self : Cursor) -> Cursor

    Cursor::line_info

    fn Cursor::line_info(self : Cursor) -> String

    path: line N (Ruby Cursor#line_info / to_s).

    Cursor::new

    fn Cursor::new(file? : String, dir? : String, path? : String, lineno? : Int) -> Cursor

    DlistItem

    pub(all) struct DlistItem {
    terms : Array[Node]
    desc : Node?
    }

    An entry of a description list: one or more terms and an optional description.

    DocData

    type DocData

    Data specific to a document node (Ruby Document instance variables).

    DocTitle

    pub(all) struct DocTitle {
    main : String
    subtitle : String?
    combined : String
    sanitized : Bool
    } derive(
    Debug
    )

    A parsed document title (Ruby Document::Title).

    DocTitle::has_subtitle

    fn DocTitle::has_subtitle(self : DocTitle) -> Bool

    DocTitle::new

    fn DocTitle::new(val : String, sanitize? : Bool, separator? : String) -> DocTitle

    DocinfoOptions

    pub(all) struct DocinfoOptions {
    linkcss : Bool
    cdn_base_url : String
    self_closing_tag_slash : String
    }

    Options passed to SyntaxHighlighter::docinfo.

    DocinfoOptions::new

    fn DocinfoOptions::new(linkcss? : Bool, cdn_base_url? : String, self_closing_tag_slash? : String) -> DocinfoOptions

    DocinfoProcessor

    pub(all) struct DocinfoProcessor {
    location : String
    process : (Node) -> String? raise
    }

    ExtensionConfig

    pub(all) struct ExtensionConfig {
    content_model : ContentModel?
    positional_attrs : Array[String]
    default_attrs : Array[(String, String)]
    contexts : Array[Context]
    format : String?
    regexp :
    Regex
    ?
    }

    Configuration shared by block, block macro and inline macro processors (Ruby extension config Hash).

    ExtensionConfig::new

    fn ExtensionConfig::new(content_model? : ContentModel, positional_attrs? : Array[String], default_attrs? : Array[(String, String)], contexts? : Array[Context], format? : String, regexp? :
    Regex
    ) -> ExtensionConfig

    Extensions

    pub struct Extensions {
    document : Node?
    // private fields
    }

    An extension registry (Ruby Extensions::Registry). Register processors directly or through groups (run on activation); pass the registry with Options::new(extensions=...) or register groups globally with register_global_extensions.

    Extensions::activate

    fn Extensions::activate(self : Extensions, doc : Node) -> Extensions

    Activates the registry for a document: returns a fresh registry containing the direct registrations plus those made by the global and own groups.

    Extensions::add_group

    fn Extensions::add_group(self : Extensions, group : (Extensions) -> Unit) -> Unit

    Adds a group (a function that registers processors on activation).

    Extensions::block

    fn Extensions::block(self : Extensions, name : String, process : (Node, Reader, Attributes) -> Node? raise, contexts? : Array[Context], content_model? : ContentModel, positional_attrs? : Array[String], default_attrs? : Array[(String, String)]) -> Unit

    Registers a block processor for a style name on contexts (default: open and paragraph).

    Extensions::block_macro

    fn Extensions::block_macro(self : Extensions, name : String, process : (Node, String, Attributes) -> Node? raise, content_model? : ContentModel, positional_attrs? : Array[String], default_attrs? : Array[(String, String)]) -> Unit raise ArgumentError

    Registers a block macro processor (name::target[attrs]).

    Extensions::docinfo_processor

    fn Extensions::docinfo_processor(self : Extensions, process : (Node) -> String? raise, location? : String, prefer? : Bool) -> Unit

    Registers a docinfo processor for location (head or footer).

    Extensions::include_processor

    fn Extensions::include_processor(self : Extensions, process : (Node, Reader, String, Attributes) -> Unit raise, handles? : (Node, String) -> Bool, prefer? : Bool) -> Unit

    Registers an include processor.

    Extensions::inline_macro

    fn Extensions::inline_macro(self : Extensions, name : String, process : (Node, String, Attributes) -> InlineResult? raise, format? : String, regexp? :
    Regex
    , content_model? : ContentModel, positional_attrs? : Array[String], default_attrs? : Array[(String, String)]) -> Unit raise ArgumentError

    Registers an inline macro processor (name:target[attrs], or name:[attrs] with format="short", or a custom regexp).

    Extensions::new

    fn Extensions::new(group? : (Extensions) -> Unit) -> Extensions

    Creates an empty registry, optionally with a group to run on activation.

    Extensions::postprocessor

    fn Extensions::postprocessor(self : Extensions, process : (Node, String) -> String raise, prefer? : Bool) -> Unit

    Registers a postprocessor (transforms the converted output).

    Extensions::preprocessor

    fn Extensions::preprocessor(self : Extensions, process : (Node, Reader) -> Reader? raise, prefer? : Bool) -> Unit

    Registers a preprocessor. With prefer, it runs before the others.

    Extensions::tree_processor

    fn Extensions::tree_processor(self : Extensions, process : (Node) -> Node? raise, prefer? : Bool) -> Unit

    Registers a tree processor; returning a document replaces the document.

    FindVerdict

    pub(all) enum FindVerdict {
    Accept
    Reject
    Prune
    Stop
    Skip
    }

    Selector for find_by.

    Footnote

    pub(all) struct Footnote {
    index : Int
    id : String?
    text : String
    } derive(
    Debug
    )

    A footnote registered in the document catalog.

    FormatOptions

    pub(all) struct FormatOptions {
    nowrap : Bool
    css_mode : String?
    style : String?
    }

    Options passed to SyntaxHighlighter::format.

    FormatOptions::new

    fn FormatOptions::new(nowrap? : Bool, css_mode? : String, style? : String) -> FormatOptions

    HeaderOption

    pub(all) enum HeaderOption {
    NoHeader
    ExplicitHeader
    ImplicitHeader
    UnsetHeader
    } derive(Eq,
    Debug
    )

    Implicit/explicit header state (Ruby has_header_option: true, :implicit, nil/false).

    HighlightOptions

    pub(all) struct HighlightOptions {
    callouts : Map[Int, Array[(AttrVal, String)]]?
    css_mode : String
    highlight_lines : Array[Int]?
    number_lines : String?
    start_line_number : Int?
    style : String?
    }

    Options passed to SyntaxHighlighter::highlight (Ruby's opts Hash).

    HighlightOptions::new

    fn HighlightOptions::new(callouts? : Map[Int, Array[(AttrVal, String)]], css_mode? : String, highlight_lines? : Array[Int], number_lines? : String, start_line_number? : Int, style? : String) -> HighlightOptions

    Creates highlight options (defaults as Ruby's opts Hash with no entries, except css_mode, which Asciidoctor always sets).

    ImageReference

    pub(all) struct ImageReference {
    target : String
    imagesdir : String?
    } derive(
    Debug
    )

    An image reference registered in the catalog (when catalog_assets is set).

    IncludeProcessor

    pub(all) struct IncludeProcessor {
    handles : (Node, String) -> Bool
    process : (Node, Reader, String, Attributes) -> Unit raise
    }

    InlineMacroProcessor

    pub(all) struct InlineMacroProcessor {
    name : String
    config : ExtensionConfig
    process : (Node, String, Attributes) -> InlineResult? raise
    }

    InlineResult

    pub(all) enum InlineResult {
    InlineNode(Node)
    InlineText(String)
    }

    Result of an inline macro: a node to convert, or literal text.

    LogMessage

    pub(all) struct LogMessage {
    severity : Severity
    text : String
    source_location : Cursor?
    include_location : Cursor?
    } derive(
    Debug
    )

    A log message with optional source context (Ruby message_with_context).

    LogMessage::to_string

    fn LogMessage::to_string(self : LogMessage) -> String

    path: line N: text when a source location is present (Ruby AutoFormattingMessage#inspect).

    Logger

    pub struct Logger {
    level : Severity
    max_severity : Severity?
    // private fields
    }

    A logger. Messages below level are dropped (except by a memory logger, which records everything, like Ruby's MemoryLogger).

    Logger::add

    fn Logger::add(self : Logger, m : LogMessage) -> Unit

    Logger::is_debug

    fn Logger::is_debug(self : Logger) -> Bool

    Logger::is_info

    fn Logger::is_info(self : Logger) -> Bool

    Logger::memory

    fn Logger::memory(messages : Array[LogMessage]) -> Logger

    A logger that records every message into messages. Like Ruby's MemoryLogger, its level is Unknown; unlike Ruby, is_debug/is_info report true so that callers capturing messages for later replay (see io.run_with_files) see debug and info messages too.

    Logger::new

    fn Logger::new(sink : (LogMessage) -> Unit, level? : Severity) -> Logger

    Creates a logger that forwards messages at or above level to sink.

    Logger::null

    fn Logger::null() -> Logger

    A logger that discards messages but tracks the maximum severity.

    Logger::recording

    fn Logger::recording(messages : Array[LogMessage], level~ : Severity) -> Logger

    A logger that records every message into messages (whatever its severity, like a hook on Ruby's Logger#add) while is_debug/is_info answer according to level, as for a Ruby logger with that level.

    Logger::set_level

    fn Logger::set_level(self : Logger, level : Severity) -> Unit

    Sets the minimum severity of messages forwarded to the sink.

    MemoryVfs

    pub struct MemoryVfs {
    files : Map[String, Bytes]
    working_dir : String
    home_dir : String
    }

    An in-memory file system: a map from absolute path to contents.
    impl Vfs for MemoryVfs

    MemoryVfs::add_bytes

    fn MemoryVfs::add_bytes(self : MemoryVfs, path : String, data : Bytes) -> Unit

    MemoryVfs::add_text

    fn MemoryVfs::add_text(self : MemoryVfs, path : String, text : String) -> Unit

    Adds a text file (encoded as UTF-8).

    MemoryVfs::new

    fn MemoryVfs::new(cwd? : String, home? : String) -> MemoryVfs

    Node

    pub(all) struct Node {
    context : Context
    node_name : String
    attributes : Attributes
    id : String?
    blocks : Array[Node]
    content_model : ContentModel
    level : Int
    numeral : String?
    source_location : Cursor?
    style : String?
    subs : Array[Sub]
    lines : Array[String]
    index : Int
    sectname : String?
    special : Bool
    numbered : Numbered
    marker : String?
    dlist_items : Array[DlistItem]
    inline_type : String?
    target : String?
    // private fields
    }

    A node of the document tree. Ruby's class hierarchy (AbstractNode, AbstractBlock, Document, Section, Block, List, ListItem, Table, Table::Column, Table::Cell, Inline) is flattened into this one struct; the context tells which fields are meaningful.

    Node::abort_processing

    fn Node::abort_processing(self : Node, error : Error) -> Unit

    Aborts the processing of the document self belongs to with error (Ruby: raising from a converter or an extension). The pure pipeline cannot unwind through converters and extension callbacks, so the error is recorded on the root document (the first error wins) and processing continues; its output must be discarded. @asciidoctor.convert raises the recorded error, and processing_error returns it.

    Node::add_role

    fn Node::add_role(self : Node, name : String) -> Bool

    Node::alt

    fn Node::alt(self : Node) -> String

    The alt text of an image block, with special characters escaped.

    Node::append

    fn Node::append(self : Node, block : Node) -> Unit

    Appends a child block (Ruby <<), assigning section numbers as needed.

    Node::apply_header_subs

    fn Node::apply_header_subs(self : Node, text : String) -> String

    Node::apply_normal_subs

    fn Node::apply_normal_subs(self : Node, text : String) -> String

    Node::apply_reftext_subs

    fn Node::apply_reftext_subs(self : Node, text : String) -> String

    Node::apply_subs

    fn Node::apply_subs(self : Node, text : String, subs : Array[Sub]) -> String

    Applies substitutions to text (Ruby apply_subs).

    Node::apply_subs_lines

    fn Node::apply_subs_lines(self : Node, lines : Array[String], subs : Array[Sub]) -> Array[String]

    Applies substitutions to lines (Ruby apply_subs with an Array).

    Node::apply_title_subs

    fn Node::apply_title_subs(self : Node, text : String) -> String

    Node::assign_caption

    fn Node::assign_caption(self : Node, value : String?, caption_context? : String) -> Unit

    Ruby assign_caption(value, caption_context).

    Node::assign_numeral

    fn Node::assign_numeral(self : Node, section : Node) -> Unit

    Assigns the next index and numeral to the child section.

    Node::attr

    fn Node::attr(self : Node, name : String, default? : String, inherited? : Bool, fallback_name? : String) -> String?

    Ruby attr(name, default, fallback): the attribute value as a string if truthy; otherwise, if fallback is set and the node has a parent, the document attribute; otherwise default.

    Node::attribute_locked

    fn Node::attribute_locked(self : Node, name : String) -> Bool

    Whether the attribute is locked by an API/CLI override.

    Node::author

    fn Node::author(self : Node) -> String?

    Node::authors

    fn Node::authors(self : Node) -> Array[Author]

    Node::backend

    fn Node::backend(self : Node) -> String

    Node::base_dir

    fn Node::base_dir(self : Node) -> String

    Node::callouts

    fn Node::callouts(self : Node) -> Callouts

    Node::caption

    fn Node::caption(self : Node) -> String?

    The caption (for admonitions, the textlabel attribute).

    Node::captioned_title

    fn Node::captioned_title(self : Node) -> String

    The caption followed by the title.

    Node::catalog

    fn Node::catalog(self : Node) -> Catalog

    Node::cell_data

    fn Node::cell_data(self : Node) -> CellData

    Node::cell_lines

    fn Node::cell_lines(self : Node) -> Array[String]

    Lines of a table cell text.

    Node::cell_paragraphs

    fn Node::cell_paragraphs(self : Node) -> Array[String]

    Content of a table cell as an array of paragraphs.

    Node::colspan

    fn Node::colspan(self : Node) -> Int?

    Node::column

    fn Node::column(self : Node) -> Node?

    The column of a table cell, or the table of a column.

    Node::columns

    fn Node::columns(self : Node) -> Array[Node]

    Node::commit_subs

    fn Node::commit_subs(self : Node) -> Unit

    Resolves and stores the subs of this block (Ruby commit_subs).

    Node::compat_mode

    fn Node::compat_mode(self : Node) -> Bool

    Node::content

    fn Node::content(self : Node) -> String

    Content of this block: converted children (compound), substituted text (simple), or substituted lines (verbatim/raw).

    Node::convert

    fn Node::convert(self : Node) -> String

    Converts this node using the document's converter.

    Node::convert_with

    fn Node::convert_with(self : Node, standalone? : Bool, outfile? : String, outdir? : String) -> String

    Converts the document. standalone overrides the load option; outfile/outdir set the corresponding attributes.

    Node::converter

    fn Node::converter(self : Node) -> &Converter

    The converter of the document.

    Node::counter

    fn Node::counter(self : Node, name : String, seed? : String) -> String

    Ruby Document#counter(name, seed).

    Node::delete_attribute

    fn Node::delete_attribute(self : Node, name : String) -> Bool

    Deletes a document attribute unless locked.

    Node::doc_source

    fn Node::doc_source(self : Node) -> String?

    The normalized source of the document.

    Node::docinfo

    fn Node::docinfo(self : Node, location? : String, suffix? : String) -> String

    Docinfo content for location (head, header, footer).

    Node::doctitle

    fn Node::doctitle(self : Node, use_fallback? : Bool, sanitize? : Bool) -> String?

    Ruby Document#doctitle(opts) without partitioning.

    Node::doctitle_partitioned

    fn Node::doctitle_partitioned(self : Node, use_fallback? : Bool, sanitize? : Bool, separator? : String) -> DocTitle?

    Ruby Document#doctitle(partition: ...).

    Node::doctype

    fn Node::doctype(self : Node) -> String

    Node::document

    fn Node::document(self : Node) -> Node

    The document this node belongs to.

    Node::enabled_options

    fn Node::enabled_options(self : Node) -> Array[String]

    Ruby enabled_options.

    Node::expand_subs

    fn Node::expand_subs(self : Node, subs : String, subject? : String) -> Array[Sub]?

    Expands a subs spec (Ruby expand_subs); None means no subs.

    Node::extensions

    fn Node::extensions(self : Node) -> Extensions?

    Node::file

    fn Node::file(self : Node) -> String?

    Node::find_by

    fn Node::find_by(self : Node, context? : Context, style? : String, role? : String, id? : String, traverse_documents? : Bool, filter? : (Node) -> FindVerdict) -> Array[Node]

    Ruby find_by(selector) {|node| ... }: walks the tree and collects matching nodes.

    Node::first_section

    fn Node::first_section(self : Node) -> Node?

    The header, or the first section.

    Node::fold_first

    fn Node::fold_first(self : Node) -> Unit

    Folds the first block into the text of a list item.

    Node::footnotes

    fn Node::footnotes(self : Node) -> Array[Footnote]

    Node::generate_data_uri

    fn Node::generate_data_uri(self : Node, target_image : String, asset_dir_key? : String) -> String

    Ruby generate_data_uri(target_image, asset_dir_key).

    Node::generate_id

    fn Node::generate_id(self : Node) -> String

    Generates an id for this section from its title.

    Node::has_attr

    fn Node::has_attr(self : Node, name : String, expected? : String, inherited? : Bool) -> Bool

    Ruby attr?(name, expected, fallback).

    Node::has_blocks

    fn Node::has_blocks(self : Node) -> Bool

    Node::has_docinfo_processors

    fn Node::has_docinfo_processors(self : Node, location? : String) -> Bool

    Node::has_extensions

    fn Node::has_extensions(self : Node) -> Bool

    Node::has_footnotes

    fn Node::has_footnotes(self : Node) -> Bool

    Node::has_header

    fn Node::has_header(self : Node) -> Bool

    Node::has_option

    fn Node::has_option(self : Node, name : String) -> Bool

    Ruby option?(name).

    Node::has_reftext

    fn Node::has_reftext(self : Node) -> Bool

    Node::has_role

    fn Node::has_role(self : Node, name : String) -> Bool

    Node::has_sections

    fn Node::has_sections(self : Node) -> Bool

    Whether this node has child sections.

    Node::has_sub

    fn Node::has_sub(self : Node, name : Sub) -> Bool

    Node::has_text

    fn Node::has_text(self : Node) -> Bool

    Node::has_title

    fn Node::has_title(self : Node) -> Bool

    Node::header

    fn Node::header(self : Node) -> Node?

    The document header section, if any.

    Node::icon_uri

    fn Node::icon_uri(self : Node, name : String) -> String

    Ruby icon_uri(name).

    Node::image_uri

    fn Node::image_uri(self : Node, target_image : String, asset_dir_key? : String?) -> String

    Ruby image_uri(target, asset_dir_key).

    Node::increment_and_store_counter

    fn Node::increment_and_store_counter(self : Node, counter_name : String, block : Node) -> String

    Increments a counter and records an attribute entry on block.

    Node::inner_document

    fn Node::inner_document(self : Node) -> Node?

    Node::is_basebackend

    fn Node::is_basebackend(self : Node, base : String) -> Bool

    Node::is_block

    fn Node::is_block(self : Node) -> Bool

    Node::is_compound

    fn Node::is_compound(self : Node) -> Bool

    Node::is_embedded

    fn Node::is_embedded(self : Node) -> Bool

    Node::is_inline

    fn Node::is_inline(self : Node) -> Bool

    Node::is_list

    fn Node::is_list(self : Node) -> Bool

    Whether this is a list (ulist, olist, dlist or colist).

    Node::is_multipart

    fn Node::is_multipart(self : Node) -> Bool

    Whether a book document has parts.

    Node::is_nested

    fn Node::is_nested(self : Node) -> Bool

    Node::is_outline

    fn Node::is_outline(self : Node) -> Bool

    Whether this list is an outline (ulist or olist).

    Node::is_parsed

    fn Node::is_parsed(self : Node) -> Bool

    Node::is_simple

    fn Node::is_simple(self : Node) -> Bool

    Whether a list item is simple (no blocks, or only a nested outline list).

    Node::items

    fn Node::items(self : Node) -> Array[Node]

    The items of a list (for dlists, use dlist_items).

    Node::lineno

    fn Node::lineno(self : Node) -> Int?

    Node::list_marker_keyword

    fn Node::list_marker_keyword(self : Node, list_type? : String) -> String?

    Node::media_uri

    fn Node::media_uri(self : Node, target : String, asset_dir_key? : String?) -> String

    Ruby media_uri(target, asset_dir_key).

    Node::new_block

    fn Node::new_block(parent : Node, context : Context, content_model? : ContentModel, subs? : BlockSubs, source? : Array[String], source_text? : String, attributes? : Attributes) -> Node

    Creates a block (Ruby Block.new parent, context, opts).

    Node::new_inline

    fn Node::new_inline(parent : Node, context : Context, text? : String, id? : String, type_? : String, target? : String, attributes? : Attributes) -> Node

    Creates an inline node (Ruby Inline.new parent, context, text, opts).

    Node::new_list

    fn Node::new_list(parent : Node, context : Context, attributes? : Attributes) -> Node

    Creates a list (Ruby List.new parent, context).

    Node::new_list_item

    fn Node::new_list_item(parent : Node, text? : String) -> Node

    Creates a list item (Ruby ListItem.new list, text).

    Node::new_section

    fn Node::new_section(parent : Node?, level? : Int, numbered? : Bool, attributes? : Attributes) -> Node

    Creates a section (Ruby Section.new parent, level, numbered).

    Node::new_table

    fn Node::new_table(parent : Node, attributes : Attributes) -> Node

    Creates a table (Ruby Table.new parent, attributes).

    Node::next_adjacent_block

    fn Node::next_adjacent_block(self : Node) -> Node?

    The next block after this one, walking up the tree (Ruby next_adjacent_block).

    Node::nofooter

    fn Node::nofooter(self : Node) -> Bool

    Node::noheader

    fn Node::noheader(self : Node) -> Bool

    Node::normalize_asset_path

    fn Node::normalize_asset_path(self : Node, asset_ref : String, asset_name? : String, autocorrect? : Bool) -> String raise SecurityError

    Ruby normalize_asset_path. Raises SecurityError when the path is outside of the jail and autocorrect is false.

    Node::normalize_system_path

    fn Node::normalize_system_path(self : Node, target : String, start? : String, jail? : String, target_name? : String) -> String

    Ruby normalize_system_path(target, start, jail, opts) (recovering mode).

    Node::normalize_system_path_checked

    fn Node::normalize_system_path_checked(self : Node, target : String, start? : String, jail? : String, target_name? : String, recover? : Bool) -> String raise SecurityError

    Like normalize_system_path but raises on jail violations when recover is false.

    Node::normalize_web_path

    fn Node::normalize_web_path(self : Node, target : String, start? : String, preserve_uri_target? : Bool) -> String

    Ruby normalize_web_path(target, start, preserve_uri_target).

    Node::notitle

    fn Node::notitle(self : Node) -> Bool

    Node::number

    fn Node::number(self : Node) -> AttrVal

    Ruby number: the numeral as an integer when possible.

    Node::options

    fn Node::options(self : Node) -> Options

    Node::outfilesuffix

    fn Node::outfilesuffix(self : Node) -> String

    Node::parent

    fn Node::parent(self : Node) -> Node?

    The parent node (None for a document).

    Node::parent_document

    fn Node::parent_document(self : Node) -> Node?

    Node::parse

    fn Node::parse(self : Node, data? : Array[String]) -> Node

    Parses the document (Ruby Document#parse).

    Node::parse_attributes

    fn Node::parse_attributes(self : Node, attrlist : String, posattrs : Array[String?], unescape_input? : Bool, sub_input? : Bool, sub_result? : Bool, into? : Attributes) -> Attributes

    Parses an attribute list (Ruby parse_attributes).

    Node::path_resolver

    fn Node::path_resolver(self : Node) -> PathResolver

    Node::playback_attributes

    fn Node::playback_attributes(self : Node, block_attributes : Attributes) -> Unit

    Replays attribute entries recorded on a block (Ruby playback_attributes).

    Node::processing_error

    fn Node::processing_error(self : Node) -> Error?

    The error that aborted the processing of this document, if any (see abort_processing). A document whose backend has no registered converter reports MissingConverter right after it is created (and is not parsed).

    Node::raw_text

    fn Node::raw_text(self : Node) -> String?

    The raw text of a list item, inline node or table cell.

    Node::raw_title

    fn Node::raw_title(self : Node) -> String?

    The raw (unsubstituted) title.

    Node::read_asset

    fn Node::read_asset(self : Node, path : String, normalize? : Bool, warn_on_failure? : Bool, label? : String) -> String?

    Reads an asset from the VFS (Ruby read_asset).

    Node::read_contents

    fn Node::read_contents(self : Node, target : String, start? : String, normalize? : Bool, warn_on_failure? : Bool, warn_if_empty? : Bool, label? : String) -> String?

    Reads contents of a local target (URIs are not supported by the pure core).

    Node::reader

    fn Node::reader(self : Node) -> Reader?

    The reader of the document (Ruby Document#reader); None before the document has a source.

    Node::reftext

    fn Node::reftext(self : Node) -> String?

    Ruby reftext: the reftext attribute with reftext substitutions applied.

    Node::register_footnote

    fn Node::register_footnote(self : Node, fn_ : Footnote) -> Unit

    Node::register_image

    fn Node::register_image(self : Node, target : String) -> Unit

    fn Node::register_link(self : Node, target : String) -> Unit

    Node::register_ref

    fn Node::register_ref(self : Node, id : String, node : Node) -> Bool

    Registers a reference; returns false if the id is already taken.

    Node::reindex_sections

    fn Node::reindex_sections(self : Node) -> Unit

    Recomputes section indexes and numerals.

    Node::remove_attr

    fn Node::remove_attr(self : Node, name : String) -> AttrVal?

    Node::remove_role

    fn Node::remove_role(self : Node, name : String) -> Bool

    Node::remove_sub

    fn Node::remove_sub(self : Node, sub : Sub) -> Unit

    Node::resolve_block_subs

    fn Node::resolve_block_subs(self : Node, subs : String, defaults : Array[Sub]?, subject : String) -> Array[Sub]

    Node::resolve_id

    fn Node::resolve_id(self : Node, text : String) -> String?

    Resolves an id from reference text (Ruby resolve_id).

    Node::resolve_pass_subs

    fn Node::resolve_pass_subs(self : Node, subs : String, subject? : String) -> Array[Sub]

    Node::resolve_subs

    fn Node::resolve_subs(_self : Node, subs : String, type_? : String, defaults? : Array[Sub], subject? : String) -> Array[Sub]

    Resolves a subs attribute value (Ruby resolve_subs). Returns an empty array when subs is empty.

    Node::restore_attributes

    fn Node::restore_attributes(self : Node) -> Unit

    Restores the attributes to the snapshot taken at the end of the header (Ruby Document#restore_attributes).

    Node::revdate

    fn Node::revdate(self : Node) -> String?

    Node::role

    fn Node::role(self : Node) -> String?

    Node::role_is

    fn Node::role_is(self : Node, expected? : String) -> Bool

    Ruby role?(expected).

    Node::roles

    fn Node::roles(self : Node) -> Array[String]

    Node::rows

    fn Node::rows(self : Node) -> TableRows

    Node::rowspan

    fn Node::rowspan(self : Node) -> Int?

    Node::safe

    fn Node::safe(self : Node) -> Int

    Node::sections

    fn Node::sections(self : Node) -> Array[Node]

    The child sections.

    Node::sectnum

    fn Node::sectnum(self : Node, delimiter? : String, append? : String?) -> String

    Section number, e.g. 2.3. (Ruby Section#sectnum).

    Node::set_attr

    fn Node::set_attr(self : Node, name : String, value? : AttrVal, overwrite? : Bool) -> Bool

    Ruby set_attr(name, value, overwrite).

    Node::set_attribute

    fn Node::set_attribute(self : Node, name : String, value? : String) -> String?

    Sets a document attribute unless locked; returns the resolved value.

    Node::set_caption

    fn Node::set_caption(self : Node, caption : String?) -> Unit

    Node::set_context

    fn Node::set_context(self : Node, context : Context) -> Unit

    Sets the context (and node name) of this node.

    Node::set_header_attribute

    fn Node::set_header_attribute(self : Node, name : String, value? : String, overwrite? : Bool) -> Bool

    Sets an attribute in the header attribute snapshot.

    Node::set_id

    fn Node::set_id(self : Node, id : String?) -> Unit

    Sets (or clears) the id of this node (Ruby node.id = value).

    Node::set_option

    fn Node::set_option(self : Node, name : String) -> Bool

    Ruby set_option(name): returns false if the option was already set.

    Node::set_parent

    fn Node::set_parent(self : Node, parent : Node) -> Unit

    Sets the parent (and the document) of this node.

    Node::set_role

    fn Node::set_role(self : Node, names : String) -> Unit

    Node::set_sourcemap

    fn Node::set_sourcemap(self : Node, value : Bool) -> Unit

    Ruby Document#sourcemap=: enables source mapping before parsing.

    Node::set_text

    fn Node::set_text(self : Node, text : String?) -> Unit

    Node::set_title

    fn Node::set_title(self : Node, val : String?) -> Unit

    Node::source

    fn Node::source(self : Node) -> String

    The source (lines joined by LF).

    Node::source_lines

    fn Node::source_lines(self : Node) -> Array[String]?

    Node::sourcemap

    fn Node::sourcemap(self : Node) -> Bool

    Node::sub_attributes

    fn Node::sub_attributes(self : Node, text : String, attribute_missing? : String, drop_line_ignore? : Bool) -> String

    Replaces attribute references (Ruby sub_attributes).

    Node::sub_callouts

    fn Node::sub_callouts(self : Node, text : String) -> String

    Replaces callout markers with callout nodes.

    Node::sub_macros

    fn Node::sub_macros(self : Node, text : String) -> String

    Replaces inline macros (Ruby sub_macros).

    Node::sub_post_replacements

    fn Node::sub_post_replacements(self : Node, text : String) -> String

    Applies post replacements (hard line breaks).

    Node::sub_quotes

    fn Node::sub_quotes(self : Node, text : String) -> String

    Applies inline quote substitutions.

    Node::sub_replacements

    fn Node::sub_replacements(_self : Node, text : String) -> String

    Applies textual replacements (Ruby sub_replacements).

    Node::sub_source

    fn Node::sub_source(self : Node, source : String, process_callouts : Bool) -> String

    Escapes special characters and optionally processes callouts.

    Node::syntax_highlighter

    fn Node::syntax_highlighter(self : Node) -> &SyntaxHighlighter?

    Node::table

    fn Node::table(self : Node) -> Node?

    The table of a column.

    Node::table_data

    fn Node::table_data(self : Node) -> TableData

    Node::text

    fn Node::text(self : Node) -> String?

    Converted text: for list items and cells the text with subs applied; for inline nodes the raw text.

    Node::title

    fn Node::title(self : Node) -> String?

    The converted title (title substitutions applied), memoized.

    Node::update_attributes

    fn Node::update_attributes(self : Node, new_attributes : Attributes) -> Unit

    Node::vfs

    fn Node::vfs(self : Node) -> &Vfs

    Node::xreftext

    fn Node::xreftext(self : Node, xrefstyle? : String) -> String?

    Ruby xreftext(xrefstyle).

    NullVfs

    pub struct NullVfs {
    // private fields
    }

    A file system without any files.
    impl Vfs for NullVfs

    NullVfs::new

    fn NullVfs::new(cwd? : String) -> &Vfs

    Numbered

    pub(all) enum Numbered {
    NotNumbered
    Numbered
    NumberedChapter
    } derive(Eq,
    Debug
    )

    Whether a section is numbered, and if so whether like a chapter.

    Options

    pub(all) struct Options {
    attributes : Array[(String, AttrVal)]
    safe : Int?
    backend : String?
    doctype : String?
    standalone : Bool?
    base_dir : String?
    to_file : String?
    to_dir : String?
    mkdirs : Bool
    sourcemap : Bool
    parse_header_only : Bool
    catalog_assets : Bool
    parse : Bool
    input_mtime : Int64?
    converter : &Converter?
    extensions : Extensions?
    vfs : &Vfs?
    timings : Timings?
    syntax_highlighter_factory : (String, String, Node) -> &SyntaxHighlighter??
    parent : Node?
    cursor : Cursor?
    }

    Options for loading/converting a document (Ruby options Hash).

    Options::new

    fn Options::new(attributes? : Array[(String, AttrVal)], safe? : Int, backend? : String, doctype? : String, standalone? : Bool, base_dir? : String, to_file? : String, to_dir? : String, mkdirs? : Bool, sourcemap? : Bool, parse_header_only? : Bool, catalog_assets? : Bool, parse? : Bool, converter? : &Converter, extensions? : Extensions, vfs? : &Vfs, timings? : Timings) -> Options

    PathResolver

    pub struct PathResolver {
    working_dir : String
    // private fields
    }

    Resolves system and web paths (Ruby PathResolver). POSIX separators only.

    PathResolver::descends_from

    fn PathResolver::descends_from(_self : PathResolver, path : String, base : String) -> Int?

    Offset at which path descends from base, or None.

    PathResolver::expand_path

    fn PathResolver::expand_path(self : PathResolver, path : String) -> String

    Resolves .. segments (Ruby expand_path, no filesystem access).

    PathResolver::is_absolute

    fn PathResolver::is_absolute(_self : PathResolver, path : String) -> Bool

    PathResolver::is_root

    fn PathResolver::is_root(self : PathResolver, path : String) -> Bool

    PathResolver::is_unc

    fn PathResolver::is_unc(_self : PathResolver, path : String) -> Bool

    PathResolver::is_web_root

    fn PathResolver::is_web_root(_self : PathResolver, path : String) -> Bool

    PathResolver::new

    fn PathResolver::new(working_dir? : String) -> PathResolver

    PathResolver::partition_path

    fn PathResolver::partition_path(self : PathResolver, path : String, web? : Bool) -> (Array[String], String?)

    Splits a path into segments and root.

    PathResolver::posixify

    fn PathResolver::posixify(_self : PathResolver, path : String?) -> String

    PathResolver::relative_path

    fn PathResolver::relative_path(self : PathResolver, path : String, base : String) -> String

    Path of path relative to base (Ruby relative_path).

    PathResolver::system_path

    fn PathResolver::system_path(self : PathResolver, target : String?, start? : String, jail? : String, target_name? : String, recover? : Bool) -> String raise SecurityError

    Resolves a system path (Ruby system_path), recovering from jail violations with a warning unless recover is false.

    PathResolver::web_path

    fn PathResolver::web_path(self : PathResolver, target : String, start? : String) -> String

    Resolves a web path (Ruby web_path).

    Postprocessor

    pub(all) struct Postprocessor {
    process : (Node, String) -> String raise
    }

    Preprocessor

    pub(all) struct Preprocessor {
    process : (Node, Reader) -> Reader? raise
    }

    Reader

    pub struct Reader {
    source_lines : Array[String]
    process_lines : Bool
    unterminated : Bool
    // private fields
    }

    A line reader over AsciiDoc source (Ruby Reader), optionally with preprocessing of conditionals and includes (Ruby PreprocessorReader).

    Reader::advance

    fn Reader::advance(self : Reader) -> Bool

    Advances past the next line; returns whether a line was consumed.

    Reader::cursor

    fn Reader::cursor(self : Reader) -> Cursor

    Reader::cursor_at_line

    fn Reader::cursor_at_line(self : Reader, lineno : Int) -> Cursor

    Reader::cursor_at_mark

    fn Reader::cursor_at_mark(self : Reader) -> Cursor

    Reader::cursor_at_prev_line

    fn Reader::cursor_at_prev_line(self : Reader) -> Cursor

    Reader::cursor_before_mark

    fn Reader::cursor_before_mark(self : Reader) -> Cursor

    Reader::dir

    fn Reader::dir(self : Reader) -> String

    Reader::discard_save

    fn Reader::discard_save(self : Reader) -> Unit

    Reader::file

    fn Reader::file(self : Reader) -> String?

    Reader::from_string

    fn Reader::from_string(data : String, cursor? : Cursor) -> Reader

    Creates a reader from a string (Ruby Reader.new str: chomp + split on LF).

    Reader::has_more_lines

    fn Reader::has_more_lines(self : Reader) -> Bool

    Whether there are more lines (processing directives as needed).

    Reader::include_depth

    fn Reader::include_depth(self : Reader) -> Int

    Current include depth.

    Reader::is_empty

    fn Reader::is_empty(self : Reader) -> Bool

    Reader::line_info

    fn Reader::line_info(self : Reader) -> String

    Reader::lineno

    fn Reader::lineno(self : Reader) -> Int

    Reader::lines

    fn Reader::lines(self : Reader) -> Array[String]

    The remaining lines (in order).

    Reader::mark

    fn Reader::mark(self : Reader) -> Cursor

    Marks the current position; returns the marked cursor.

    Reader::new

    fn Reader::new(data : Array[String], cursor? : Cursor, normalize? : Bool) -> Reader

    Creates a reader over data (lines without line terminators).

    Reader::new_preprocessor

    fn Reader::new_preprocessor(document : Node, data : Array[String], cursor? : Cursor, normalize? : Bool) -> Reader

    Creates a preprocessor reader (Ruby PreprocessorReader.new).

    Reader::next_line_empty

    fn Reader::next_line_empty(self : Reader) -> Bool

    Reader::path

    fn Reader::path(self : Reader) -> String

    Reader::peek_line

    fn Reader::peek_line(self : Reader, direct? : Bool) -> String?

    The next line without consuming it.

    Reader::peek_lines

    fn Reader::peek_lines(self : Reader, num? : Int, direct? : Bool) -> Array[String]

    Peeks up to num lines (processing directives unless direct).

    Reader::push_include_lines

    fn Reader::push_include_lines(self : Reader, data : Array[String], file? : String, path? : String, lineno? : Int, attributes? : Attributes) -> Unit

    Pushes include content (Ruby push_include), also usable by include processors.

    Reader::read

    fn Reader::read(self : Reader) -> String

    Reads all remaining lines joined with LF.

    Reader::read_line

    fn Reader::read_line(self : Reader) -> String?

    Reads (consumes) the next line.

    Reader::read_lines

    fn Reader::read_lines(self : Reader) -> Array[String]

    Reads all remaining lines.

    Reader::read_lines_until

    fn Reader::read_lines_until(self : Reader, terminator? : String, skip_processing? : Bool, break_on_blank_lines? : Bool, break_on_list_continuation? : Bool, skip_line_comments? : Bool, skip_first_line? : Bool, read_last_line? : Bool, preserve_last_line? : Bool, context? : String?, cursor? : Cursor, cursor_at_mark? : Bool, break_if? : (String) -> Bool) -> Array[String]

    Reads lines until a terminator or break condition (Ruby read_lines_until). context: None → use terminator in the warning; Some(None) → no warning.

    Reader::replace_next_line

    fn Reader::replace_next_line(self : Reader, replacement : String) -> Bool

    Replaces the next line (Ruby replace_next_line).

    Reader::restore_save

    fn Reader::restore_save(self : Reader) -> Unit

    Restores the saved reader state.

    Reader::save

    fn Reader::save(self : Reader) -> Unit

    Saves the reader state.

    Reader::shift

    fn Reader::shift(self : Reader) -> String?

    Consumes the next line.

    Reader::skip_blank_lines

    fn Reader::skip_blank_lines(self : Reader) -> Int?

    Skips blank lines; returns the number skipped, or None if at end.

    Reader::skip_comment_lines

    fn Reader::skip_comment_lines(self : Reader) -> Unit

    Skips comment lines and comment blocks.

    Reader::skip_line_comments

    fn Reader::skip_line_comments(self : Reader) -> Array[String]

    Skips single-line comments, returning them.

    Reader::source

    fn Reader::source(self : Reader) -> String

    The source lines joined by LF.

    Reader::string

    fn Reader::string(self : Reader) -> String

    The remaining lines joined by LF.

    Reader::terminate

    fn Reader::terminate(self : Reader) -> Unit

    Discards all remaining lines.

    Reader::unshift_line

    fn Reader::unshift_line(self : Reader, line : String) -> Unit

    Reader::unshift_lines

    fn Reader::unshift_lines(self : Reader, lines : Array[String]) -> Unit

    Severity

    pub(all) enum Severity {
    Debug
    Info
    Warn
    Error
    Fatal
    Unknown
    } derive(Eq,
    Debug
    )

    Log severity (Ruby ::Logger::Severity).

    Severity::label

    fn Severity::label(self : Severity) -> String

    Label used by the basic formatter (WARN → WARNING, FATAL → FAILED).

    Severity::to_int

    fn Severity::to_int(self : Severity) -> Int

    Sub

    pub(all) enum Sub {
    SpecialCharacters
    Quotes
    Attributes
    Replacements
    Macros
    PostReplacements
    Callouts
    Highlight
    } derive(Eq, Hash,
    Debug
    )

    A substitution step.

    Sub::name

    fn Sub::name(self : Sub) -> String

    TableData

    pub struct TableData {
    rows : TableRows
    columns : Array[Node]
    has_header_option : HeaderOption
    }

    Table-specific data.

    TableRows

    pub struct TableRows {
    head : Array[Array[Node]]
    body : Array[Array[Node]]
    foot : Array[Array[Node]]
    }

    Rows of a table grouped by section.

    Timings

    pub struct Timings {
    // private fields
    }

    Records how long the processing phases (read, parse, convert, write) take (Ruby Timings). The core is pure, so the clock is supplied by the caller: a function returning the current time in seconds (ideally from a monotonic clock). Pass it with Options::new(timings=...); loading records read and parse, converting the document records convert.

    Timings::convert

    fn Timings::convert(self : Timings) -> Double?

    Timings::new

    fn Timings::new(clock : () -> Double) -> Timings

    Timings::parse

    fn Timings::parse(self : Timings) -> Double?

    Timings::read

    fn Timings::read(self : Timings) -> Double?

    Timings::read_parse

    fn Timings::read_parse(self : Timings) -> Double?

    Timings::read_parse_convert

    fn Timings::read_parse_convert(self : Timings) -> Double?

    Timings::record

    fn Timings::record(self : Timings, key : String) -> Unit

    Stops the timer for key and records the elapsed time.

    Timings::report

    fn Timings::report(self : Timings, subject? : String) -> String

    The timings report (Ruby Timings#print_report), one line per phase.

    test {
    let t = @core.Timings::new(() => 0.0)
    t.set("read", 0.00001)
    t.set("parse", 0.00003)
    t.set("convert", 0.00005)
    inspect(
    t.report(subject="doc.adoc"),
    content=(
    #|Input file: doc.adoc
    #| Time to read and parse source: 0.00004
    #| Time to convert document: 0.00005
    #| Total time (read, parse and convert): 0.00009
    #|
    ),
    )
    }

    Timings::set

    fn Timings::set(self : Timings, key : String, seconds : Double) -> Unit

    Sets the recorded time of key directly.

    Timings::start

    fn Timings::start(self : Timings, key : String) -> Unit

    Starts the timer for key.

    Timings::time

    fn Timings::time(self : Timings, keys : Array[String]) -> Double?

    The sum of the times recorded for keys, or None if it is not positive.

    Timings::total

    fn Timings::total(self : Timings) -> Double?

    Timings::write

    fn Timings::write(self : Timings) -> Double?

    TreeProcessor

    pub(all) struct TreeProcessor {
    process : (Node) -> Node? raise
    }

    DEFAULT_BACKEND

    let DEFAULT_BACKEND : String

    DEFAULT_DOCTYPE

    let DEFAULT_DOCTYPE : String

    SAFE_SAFE

    let SAFE_SAFE : Int

    SAFE_SECURE

    let SAFE_SECURE : Int

    SAFE_SERVER

    let SAFE_SERVER : Int

    SAFE_UNSAFE

    let SAFE_UNSAFE : Int

    Safe mode levels (Ruby SafeMode).

    VERSION

    let VERSION : String

    Version of Asciidoctor this port tracks.

    base64_encode

    fn base64_encode(data : Bytes) -> String

    Base64 encodes bytes (Ruby [data].pack 'm0').

    basename

    fn basename(filename : String, drop_ext? : Bool) -> String

    Last path segment, optionally without extension (Ruby Helpers.basename).

    basic_subs

    let basic_subs : Array[Sub]

    compliance

    let compliance : Compliance

    The global compliance settings.

    create_anchor

    fn create_anchor(parent : Node, text : String?, type_ : String, target? : String, id? : String, attributes? : Attributes) -> Node

    Creates an anchor (link or xref) inline node.

    create_block

    fn create_block(parent : Node, context : Context, source : Array[String]?, attrs : Attributes, content_model? : ContentModel, subs? : BlockSubs) -> Node

    Creates a block (Ruby create_block parent, context, source, attrs, opts).

    create_example_block

    fn create_example_block(parent : Node, source : Array[String]?, attrs : Attributes) -> Node

    create_image_block

    fn create_image_block(parent : Node, attrs : Attributes) -> Node raise ArgumentError

    Creates an image block; attrs must contain target.

    create_inline

    fn create_inline(parent : Node, context : Context, text : String?, type_? : String, target? : String, id? : String, attributes? : Attributes) -> Node

    Creates an inline node (quoted nodes default to type unquoted).

    create_list

    fn create_list(parent : Node, context : Context, attrs? : Attributes) -> Node

    Creates a list (ulist, olist, dlist or colist).

    create_list_item

    fn create_list_item(parent : Node, text? : String) -> Node

    create_listing_block

    fn create_listing_block(parent : Node, source : Array[String], attrs : Attributes) -> Node

    create_literal_block

    fn create_literal_block(parent : Node, source : Array[String], attrs : Attributes) -> Node

    create_open_block

    fn create_open_block(parent : Node, source : Array[String]?, attrs : Attributes) -> Node

    Creates an open block (children parsed with parse_content).

    create_paragraph

    fn create_paragraph(parent : Node, source : Array[String], attrs : Attributes) -> Node

    Creates a paragraph block from lines.

    create_pass_block

    fn create_pass_block(parent : Node, source : Array[String], attrs : Attributes) -> Node

    create_section

    fn create_section(parent : Node, title : String, attrs : Attributes, level? : Int, numbered? : Bool) -> Node

    Creates a section (Ruby create_section parent, title, attrs, opts).

    create_syntax_highlighter

    fn create_syntax_highlighter(name : String, backend : String, doc : Node) -> &SyntaxHighlighter?

    Creates the registered syntax highlighter for name, if any (Ruby SyntaxHighlighter.create).

    decode_text

    fn decode_text(data : Bytes) -> String

    Decodes file contents as text: strips a UTF-8 BOM, decodes UTF-16 with a BOM, otherwise decodes UTF-8 (invalid sequences become U+FFFD).

    decode_text_with

    fn decode_text_with(data : Bytes, encoding : String?) -> String

    Decodes file contents using the named encoding (Ruby File.read with an encoding mode). Supports UTF-8 (default), ISO-8859-1/Latin-1 and US-ASCII; unknown encodings fall back to UTF-8, like Ruby ignoring invalid names.

    derive_backend_traits

    fn derive_backend_traits(backend : String, basebackend? : String) -> BackendTraits

    Derives backend traits from a backend name (Ruby Converter.derive_backend_traits).

    dirname

    fn dirname(path : String) -> String

    Directory part of a path (Ruby File.dirname).

    encode_spaces_in_uri

    fn encode_spaces_in_uri(str : String) -> String

    Replaces spaces with %20.

    encode_uri_component

    fn encode_uri_component(str : String) -> String

    Percent-encodes a URI component (Ruby CGI.escapeURIComponent).

    expand_path_from

    fn expand_path_from(cwd : String, path : String) -> String

    Expands path against cwd (Ruby File.expand_path, no symlinks).

    extname

    fn extname(path : String, fallback? : String) -> String

    The file extension including the dot, or fallback.

    format_log_message

    fn format_log_message(m : LogMessage) -> String

    Formats a message like Ruby's Asciidoctor::Logger::BasicFormatter.

    format_source

    fn format_source(pre_class : String, node : Node, lang : String?, nowrap : Bool, pre_style? : String) -> String

    Ruby SyntaxHighlighter::Base#format: wraps the converted content of node in <pre class="<pre_class> highlight"><code data-lang="<lang>">. pre_style adds a style attribute to the <pre> element (the Ruby :transform hook used by the Pygments and Rouge adapters).

    generate_section_id

    fn generate_section_id(title : String, document : Node) -> String

    Ruby Section.generate_id(title, document).

    has_extname

    fn has_extname(path : String) -> Bool

    Whether the path has a file extension.

    header_subs

    let header_subs : Array[Sub]

    is_uriish

    fn is_uriish(str : String) -> Bool

    Whether str looks like a URI (Ruby Helpers.uriish?).

    logger

    fn logger() -> Logger

    The global logger (Ruby LoggerManager.logger).

    lookup_converter

    fn lookup_converter(backend : String) -> (String, String?, Node) -> &Converter?

    Looks up the converter factory registered for a backend.

    new_document

    fn new_document(data : Array[String]?, options : Options) -> Node

    Creates a document (Ruby Document.new data, options). The document is not parsed yet unless it is nested (has a parent).

    no_subs

    let no_subs : Array[Sub]

    normal_subs

    let normal_subs : Array[Sub]

    parse_attribute_list

    fn parse_attribute_list(source : String, positional_attrs? : Array[String?], block? : Node, delimiter? : String) -> Attributes

    Parses an attribute list into a new Attributes map.

    parse_content

    fn parse_content(parent : Node, content : Array[String], attributes? : Attributes) -> Node

    Parses AsciiDoc lines as child blocks of parent (Ruby parse_content).

    parse_content_from_reader

    fn parse_content_from_reader(parent : Node, reader : Reader, attributes? : Attributes) -> Node

    Parses the remaining lines of reader as child blocks of parent.

    parse_extension_attributes

    fn parse_extension_attributes(block : Node, attrlist : String, positional_attributes? : Array[String], sub_attributes? : Bool) -> Attributes

    Parses an attribute list for an extension (Ruby Processor#parse_attributes).

    prepare_source_array

    fn prepare_source_array(data : Array[String], trim_end? : Bool) -> Array[String]

    Ruby Helpers.prepare_source_array.

    prepare_source_string

    fn prepare_source_string(data : String, trim_end? : Bool) -> Array[String]

    Splits a string into lines, trimming trailing whitespace (or only the line ending when trim_end is false). Ruby Helpers.prepare_source_string.

    primary_stylesheet_data

    let primary_stylesheet_data : String

    The default Asciidoctor stylesheet (asciidoctor-default.css).

    reftext_subs

    let reftext_subs : Array[Sub]

    regex_escape

    fn regex_escape(s : String) -> String

    Escapes regex metacharacters (Ruby Regexp.escape).

    register_converter

    fn register_converter(backends : Array[String], factory : (String, String?, Node) -> &Converter) -> Unit

    Registers a converter factory for the given backend names.

    register_global_extensions

    fn register_global_extensions(group : (Extensions) -> Unit) -> Unit

    Registers a global extension group (Ruby Asciidoctor::Extensions.register).

    register_syntax_highlighter

    fn register_syntax_highlighter(names : Array[String], factory : (String, String, Node) -> &SyntaxHighlighter?) -> Unit

    Registers a syntax highlighter factory under the given names (Ruby SyntaxHighlighter.register); replaces an existing registration, such as the "library not available" fallbacks of rouge, coderay and pygments.

    registered_backends

    fn registered_backends() -> Array[String]

    Names of the registered backends.

    rekey_attributes

    fn rekey_attributes(attributes : Attributes, positional_attrs : Array[String?]) -> Attributes

    Copies positional attributes to named keys (Ruby AttributeList.rekey).

    reset_compliance

    fn reset_compliance() -> Unit

    Restores the default compliance settings.

    resolve_lines_to_highlight

    fn resolve_lines_to_highlight(source : String, spec : String, start? : Int) -> Array[Int]

    Line numbers to highlight (Ruby resolve_lines_to_highlight).

    restore_process_state

    fn restore_process_state(keys : Array[String]) -> Unit

    Restores the process-wide one-time state. Used by drivers that rerun the pipeline (e.g. @io) so each run observes the same state.

    roman_to_int

    fn roman_to_int(val : String) -> Int

    Ruby Helpers.roman_to_int.

    rootname

    fn rootname(filename : String) -> String

    Removes the file extension (Ruby Helpers.rootname).

    safe_mode_name_for_value

    fn safe_mode_name_for_value(value : Int) -> String?

    safe_mode_value_for_name

    fn safe_mode_value_for_name(name : String) -> Int?

    Safe mode value for a (case-insensitive) name.

    set_logger

    fn set_logger(l : Logger) -> Logger

    Replaces the global logger; returns the previous one.

    set_now_epoch

    fn set_now_epoch(f : () -> Int64) -> Unit

    Sets the clock used for date attributes.

    set_source_date_epoch

    fn set_source_date_epoch(epoch : Int64?) -> Unit

    Sets (or clears) SOURCE_DATE_EPOCH (reproducible builds).

    set_utc_offset

    fn set_utc_offset(offset : (Int64) -> Int) -> Unit

    Sets the local time zone used for localtime, doctime and friends (the core defaults to UTC; @io and the CLI install the system time zone). offset(epoch) returns the offset from UTC in seconds at epoch.

    snapshot_process_state

    fn snapshot_process_state() -> Array[String]

    Snapshot of the process-wide one-time state (see restore_process_state).

    sub_placeholder

    fn sub_placeholder(format : String, arg : String) -> String

    Ruby sprintf(format, arg) for a format with one %s.

    sub_specialchars

    fn sub_specialchars(text : String) -> String

    Escapes <, > and & (Ruby sub_specialchars).

    unregister_all_global_extensions

    fn unregister_all_global_extensions() -> Unit

    Removes all global extension groups.

    verbatim_subs

    let verbatim_subs : Array[Sub]

    with_memory_logger

    fn[T] with_memory_logger(f : () -> T raise?) -> (T, Array[LogMessage]) raise?

    Runs f with a memory logger installed and returns the recorded messages.