RD format parser for headings, paragraphs, lists, verbatim sections that exist as blocks.
Methods
- A
- C
- L
- N
- O
- P
Attributes
[R] | footnotes | Footnotes for this document |
[RW] | include_path | Path to find included files in |
[R] | labels | Labels for items in this document |
Class Public methods
new()
Link
Creates a new RDoc::RD::BlockParser. Use parse to parse an rd-format document.
Instance Public methods
add_footnote(content)
Link
Adds footnote content
to the document
# File lib/rdoc/rd/block_parser.rb, line 396 def add_footnote content index = @footnotes.length / 2 + 1 footmark_link = "{^#{index}}[rdoc-label:footmark-#{index}:foottext-#{index}]" @footnotes << RDoc::Markup::Paragraph.new(footmark_link, ' ', *content) @footnotes << RDoc::Markup::BlankLine.new index end
add_label(label)
Link
Adds label label
to the document
content(values)
Link
Retrieves the content of values
as a single String
line_index()
Link
Current line number
on_error(et, ev, _values)
Link
Raises a ParseError when invalid formatting is found
paragraph(value)
Link
Creates a paragraph for value
parse(src)
Link
Parses src
and returns an RDoc::Markup::Document.
# File lib/rdoc/rd/block_parser.rb, line 64 def parse src @src = src @src.push false @footnotes = [] @labels = {} # @i: index(line no.) of src @i = 0 # stack for current indentation @indent_stack = [] # how indented. @current_indent = @indent_stack.join("") # RDoc::RD::BlockParser for tmp src @subparser = nil # which part is in now @in_part = nil @part_content = [] @in_verbatim = false @yydebug = true document = do_parse unless @footnotes.empty? then blankline = document.parts.pop document.parts << RDoc::Markup::Rule.new(1) document.parts.concat @footnotes document.parts.push blankline end document end