Class: ReVIEW::Retrovert::ReViewDef

Inherits:
Object
  • Object
show all
Defined in:
lib/review/retrovert/reviewdef.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.r_option_innerObject

Returns the value of attribute r_option_inner.



5
6
7
# File 'lib/review/retrovert/reviewdef.rb', line 5

def r_option_inner
  @r_option_inner
end

Class Method Details

.fence_close(open) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/review/retrovert/reviewdef.rb', line 11

def fence_close(open)
  case open
  when "$", "|" then
    return open
  when "{" then
    return "}"
  end
  nil
end

.get_caption(line) ⇒ Object

キャプションを取得する



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/review/retrovert/reviewdef.rb', line 77

def get_caption(line)
  m = line.match(/^\/\/(\w+?)((\[#{r_option_inner}\])*)([$|{])*$/)
  if m
    cmd = m[1]
    options = m[2]
    if options
      if no_id_block_command().include?(cmd)
        n = options.match(/\[(#{r_option_inner})\].*/)
        return n[1] if n
      else
        n = options.match(/\[#{r_option_inner}\]\[(#{@r_option_inner})\].*/)
        return n[1] if n
      end
    end
  end
  nil
end

.id_ref_inline_commandsObject

id 参照するインラインコマンド



38
39
40
41
42
43
44
45
# File 'lib/review/retrovert/reviewdef.rb', line 38

def id_ref_inline_commands()
  [
    "list",
    "img",
    "table",
    "eq",
  ]
end

.is_has_id_block_command(cmd) ⇒ Object



7
8
9
# File 'lib/review/retrovert/reviewdef.rb', line 7

def is_has_id_block_command(cmd)
  no_id_block_command().none?(cmd)
end

.no_id_block_commandObject

id 指定しないブロックコマンド



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/review/retrovert/reviewdef.rb', line 22

def no_id_block_command()
  [
    "emlist",
    "emlistnum",
    "emtable",
    "note",
    "memo",
    "info",
    "warning",
    "important",
    "caution",
    "notice",
  ]
end

.review_jsbook_invalid_configsObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/review/retrovert/reviewdef.rb', line 47

def review_jsbook_invalid_configs()
  [
    "uplatex",
    "autodetect-engine",
    "papersize",
    "titlepage",
    "notitlepage",
    "usemag",
    "nomag",
    "nomag*",
    "a4j",
    "a5j",
    "b4j",
    "b5j",
    "winjis",
    "mingoth",
    "jis",
    "disablejfam",
    "a4paper",
    "a5paper",
    "b4paper",
    "b5paper",
    "letterpaper",
    "tombo",
    "tombow",
    "mentuke",
  ]
end