Module: Coradoc::Parser::Asciidoc::Term

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

Instance Method Summary collapse

Instance Method Details

#footnoteObject



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

def footnote
  str("footnote:") >>
    keyword.as(:id).maybe >>
    str("[") >>
    match('[^\]]').repeat(1).as(:footnote) >>
    str("]")
end

#termObject



12
13
14
15
16
17
# File 'lib/coradoc/parser/asciidoc/term.rb', line 12

def term
  line_start? >>
    term_type >> str(":[") >>
    match('[^\]]').repeat(1).as(:term) >>
    str("]") >> str("\n").repeat(1).as(:line_break)
end

#term_inlineObject



27
28
29
30
31
# File 'lib/coradoc/parser/asciidoc/term.rb', line 27

def term_inline
  term_type >> str(":[") >>
    match('[^\]]').repeat(1).as(:term) >>
    str("]")
end

#term_inline2Object



33
34
35
36
37
# File 'lib/coradoc/parser/asciidoc/term.rb', line 33

def term_inline2
  line_start? >>
    match('^\[') >> term_type >> str("]#") >>
    match('[^\#]').repeat(1).as(:term2) >> str("#")
end

#term_typeObject



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

def term_type
  (str("term") |
    str("alt") |
    str("deprecated") |
    str("domain")).as(:term_type)
end