Module: Coradoc::Parser::Asciidoc::Header

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

Instance Method Summary collapse

Methods included from Base

#attribute_name, #attribute_value, #digits, #email, #empty_line, #endline, #keyword, #line_ending, #newline, #space, #space?, #special_character, #text, #word, #words

Instance Method Details

#authorObject

Author



16
17
18
19
# File 'lib/coradoc/parser/asciidoc/header.rb', line 16

def author
  words.as(:first_name) >> str(",") >> space? >> words.as(:last_name) >>
  space? >> str("<") >> email.as(:email) >> str(">") >> endline
end

#headerObject

Header



10
11
12
13
# File 'lib/coradoc/parser/asciidoc/header.rb', line 10

def header
  match("=") >> space? >> text.as(:title) >> newline >>
  author.maybe.as(:author) >> revision.maybe.as(:revision)
end

#revisionObject

Revision



22
23
24
25
26
# File 'lib/coradoc/parser/asciidoc/header.rb', line 22

def revision
  (word >> (str(".") >> word).maybe).as(:number) >>
  str(",") >> space? >> word.as(:date) >>
  str(":") >> space? >> words.as(:remark) >> newline
end