Module: Coradoc::Parser::Asciidoc::Bibliography

Included in:
Base
Defined in:
lib/coradoc/parser/asciidoc/bibliography.rb

Instance Method Summary collapse

Instance Method Details

#bib_entryObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/coradoc/parser/asciidoc/bibliography.rb', line 14

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

#bibliographyObject



6
7
8
9
10
11
12
# File 'lib/coradoc/parser/asciidoc/bibliography.rb', line 6

def bibliography
  (section_id.maybe >>
  str("[bibliography]\n") >>
  str("== ") >> match("[^\n]").repeat(1).as(:title) >> str("\n") >>
  bib_entry.repeat(1).as(:entries)
  ).as(:bibliography)
end