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, #date, #digit, #digits, #email, #empty_line, #endline, #keyword, #line_ending, #newline, #rich_text, #rich_texts, #space, #space?, #special_character, #text, #word, #words

Instance Method Details

#authorObject



19
20
21
22
23
# File 'lib/coradoc/parser/asciidoc/header.rb', line 19

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

#headerObject



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

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

#header_titleObject



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

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

#revisionObject



25
26
27
28
29
# File 'lib/coradoc/parser/asciidoc/header.rb', line 25

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