Sha256: 5a1168b22ffc1feb5571d8b539116892f7818d391f76651328c5d71d14a96f1b

Contents?: true

Size: 783 Bytes

Versions: 6

Compression:

Stored size: 783 Bytes

Contents

module Coradoc
  module Parser
    module Asciidoc
      module Header

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

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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
coradoc-1.1.6 lib/coradoc/parser/asciidoc/header.rb
coradoc-1.1.5 lib/coradoc/parser/asciidoc/header.rb
coradoc-1.1.4 lib/coradoc/parser/asciidoc/header.rb
coradoc-1.1.3 lib/coradoc/parser/asciidoc/header.rb
coradoc-1.1.2 lib/coradoc/parser/asciidoc/header.rb
coradoc-1.1.1 lib/coradoc/parser/asciidoc/header.rb