method
parse
v2_2_9 -
Show latest stable
- Class:
RDoc::Markdown
parse(markdown)public
Parses `markdown` into an RDoc::Document
# File lib/rdoc/markdown.rb, line 759
def parse markdown
@references = {}
@unlinked_references = {}
markdown += "\n\n"
setup_parser markdown, @debug
peg_parse 'References'
if notes? then
@footnotes = {}
setup_parser markdown, @debug
peg_parse 'Notes'
# using note_order on the first pass would be a bug
@note_order = []
end
setup_parser markdown, @debug
peg_parse
doc = result
if notes? and not @footnotes.empty? then
doc << RDoc::Markup::Rule.new(1)
@note_order.each_with_index do |ref, index|
label = index + 1
note = @footnotes[ref]
link = "{^#{label}}[rdoc-label:footmark-#{label}:foottext-#{label}] "
note.parts.unshift link
doc << note
end
end
doc.accept @formatter
doc
end Related methods
- Instance methods
- break_on_newline
- css
- definition_lists
- emphasis
- extension
- extension?
- github
- html
- inner_parse
- link_to
- list_item_from
- note
- note_for
- notes
- orig_initialize
- paragraph
- parse
- peg_parse
- reference
- strong
- Class methods
- extension
- new
- parse