Module: Coradoc::Parser::Asciidoc::Citation
Instance Method Summary collapse
- #citation ⇒ Object
- #citation_noxref ⇒ Object
- #citation_xref ⇒ Object
- #cross_reference ⇒ Object
- #xref_anchor ⇒ Object
- #xref_arg ⇒ Object
- #xref_str ⇒ Object
Instance Method Details
#citation ⇒ Object
39 40 41 42 43 44 |
# File 'lib/coradoc/parser/asciidoc/citation.rb', line 39 def citation match('^[\[]') >> str(".source]\n") >> ( citation_xref | citation_noxref ).as(:citation) end |
#citation_noxref ⇒ Object
34 35 36 37 |
# File 'lib/coradoc/parser/asciidoc/citation.rb', line 34 def citation_noxref (text_line.repeat(1) ).as(:comment) end |
#citation_xref ⇒ Object
27 28 29 30 31 32 |
# File 'lib/coradoc/parser/asciidoc/citation.rb', line 27 def citation_xref cross_reference.as(:cross_reference) >> newline | cross_reference.as(:cross_reference) >> (text_line.repeat(1) ).as(:comment).maybe end |
#cross_reference ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/coradoc/parser/asciidoc/citation.rb', line 19 def cross_reference str('<<') >> xref_anchor >> ( (str(',') >> xref_arg).repeat(1) | (str(',') >> xref_str).repeat(1) ).maybe >> str('>>') end |
#xref_anchor ⇒ Object
5 6 7 |
# File 'lib/coradoc/parser/asciidoc/citation.rb', line 5 def xref_anchor match('[^,>]').repeat(1).as(:href_arg).repeat(1,1) end |
#xref_arg ⇒ Object
13 14 15 16 17 |
# File 'lib/coradoc/parser/asciidoc/citation.rb', line 13 def xref_arg (str('section') | str('paragraph') | str('clause') | str('annex') | str('table')).as(:key) >> match('[ =]').as(:delimiter) >> match('[^,>=]').repeat(1).as(:value) end |
#xref_str ⇒ Object
9 10 11 |
# File 'lib/coradoc/parser/asciidoc/citation.rb', line 9 def xref_str match('[^,>]').repeat(1).as(:text) end |