Module: Coradoc::Parser::Asciidoc::DocumentAttributes
Instance Method Summary collapse
- #attribute_name ⇒ Object
- #attribute_value ⇒ Object
- #document_attribute ⇒ Object
- #document_attributes ⇒ Object
Instance Method Details
#attribute_name ⇒ Object
6 7 8 |
# File 'lib/coradoc/parser/asciidoc/document_attributes.rb', line 6 def attribute_name match("[a-zA-Z0-9_-]").repeat(1) end |
#attribute_value ⇒ Object
10 11 12 |
# File 'lib/coradoc/parser/asciidoc/document_attributes.rb', line 10 def attribute_value text | str("") >> str("\n").absent? end |
#document_attribute ⇒ Object
19 20 21 22 |
# File 'lib/coradoc/parser/asciidoc/document_attributes.rb', line 19 def document_attribute str(":") >> attribute_name.as(:key) >> str(":") >> space? >> (attribute_value | str("")).as(:value) >> line_ending end |
#document_attributes ⇒ Object
14 15 16 17 |
# File 'lib/coradoc/parser/asciidoc/document_attributes.rb', line 14 def document_attributes (document_attribute.repeat(1) ).as(:document_attributes) end |