Module: Coradoc::AsciiDoc::Parser::Bibliography
- Defined in:
- lib/coradoc/asciidoc/parser/bibliography.rb
Instance Method Summary collapse
Instance Method Details
#bib_entry ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/coradoc/asciidoc/parser/bibliography.rb', line 15 def bib_entry (match('^*') >> str(' [[[') >> match('[^,\[\]\n]').repeat(1).as(:anchor_name) >> (str(',') >> match('[^\]\n]').repeat(1).as(:document_id) ).maybe >> str(']]]') >> (text_line.repeat(0, 1) >> text_line.repeat(0) ).as(:ref_text).maybe >> line_ending.repeat(1).as(:line_break).maybe ).as(:bibliography_entry) end |
#bibliography ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/coradoc/asciidoc/parser/bibliography.rb', line 7 def bibliography (element_id.maybe >> str("[bibliography]\n") >> str('== ') >> match("[^\n]").repeat(1).as(:title) >> str("\n") >> bib_entry.repeat(1).as(:entries) ).as(:bibliography) end |