Crst::Parser
Inherits Reference < Object
Main parser class for reStructuredText documents
This class handles the parsing of RST text into an abstract syntax tree (AST) composed of Node objects. The parsing is done line by line, recognizing various RST constructs.
Example:
parser = Crst::Parser.new("Hello World")
doc = parser.parse
Constructors
new(input : String, config : Config = Config.new)
Initialize the parser with RST input text and configuration
Instance methods
depth
Sourcedepth=(depth : Int32)
Sourceparse
Parse the input text and return the root Document node
Returns a Document containing all parsed nodes
parse_block(lines : Array(String), line_offset : Int32 = 0, allow_sections : Bool = true) : Array(Node)
delegate to BlockParser
parse_directive(reader : LineReader, name : String, arguments : Array(String), line_offset : Int32) : Node
delegate to DirectiveParser
parse_explicit_markup(reader : LineReader, line_offset : Int32) : Node
delegate to ExplicitMarkupParser
section_levels
Sourcesection_levels=(section_levels : Array(Char))
Sourcetry_parse_section(reader : LineReader, document : Document, line_offset : Int32 = 0) : Bool
Source