class

Crst::SectionParser

Inherits Reference < Object

Parses RST sections (titled divisions of a document)

Extracted from Parser to handle section detection, level tracking, and section content parsing.

Constants

TRANSITION_CHARS = Set.new(['!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~'])

Transition characters (RST spec)

Constructors

new(parser : Parser)
Source

Instance methods

adornment?(line : String) : Bool

Returns true when line is a flush-left section adornment: a non-empty line made of a single repeated transition character.

Source
determine_level(adornment : String) : Int32
Source
section_start?(reader : LineReader) : Bool
Source
try_parse_section(reader : LineReader, document : Document, line_offset : Int32 = 0) : Bool

Attempt to parse a section at the current reader position Returns true if a section was parsed, false otherwise

Source