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

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

Instance Method Summary collapse

Instance Method Details

#authorObject



16
17
18
19
20
# 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(">") >> newline
end

#headerObject



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

def header
  header_title >>
    author.maybe.as(:author) >>
    revision.maybe.as(:revision) >> newline.maybe
end

#header_titleObject



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

def header_title
  match("^=") >> str('=').absent? >> space? >> text.as(:title) >> newline
end

#revisionObject



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

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