class
Crst::Parser
- Crst::Parser
- Reference
- Object
Overview
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
Defined in:
crst/parser.crConstructors
-
.new(input : String, config : Config = Config.new)
Initialize the parser with RST input text and configuration
Instance Method Summary
-
#parse : Document
Parse the input text and return the root Document node
- #section_levels : Array(Char)
- #section_levels=(section_levels : Array(Char))
Constructor Detail
Initialize the parser with RST input text and configuration
Instance Method Detail
Parse the input text and return the root Document node
Returns a Document containing all parsed nodes