rdoc 2.4.3 → 2.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rdoc might be problematic. Click here for more details.

Files changed (139) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +3 -1
  3. data/History.txt +68 -0
  4. data/LICENSE.txt +57 -0
  5. data/Manifest.txt +37 -19
  6. data/README.txt +2 -12
  7. data/Rakefile +12 -12
  8. data/bin/rdoc +4 -4
  9. data/lib/rdoc.rb +32 -9
  10. data/lib/rdoc/alias.rb +2 -2
  11. data/lib/rdoc/any_method.rb +108 -16
  12. data/lib/rdoc/attr.rb +87 -1
  13. data/lib/rdoc/class_module.rb +131 -5
  14. data/lib/rdoc/code_object.rb +28 -5
  15. data/lib/rdoc/constant.rb +22 -0
  16. data/lib/rdoc/context.rb +80 -37
  17. data/lib/rdoc/gauntlet.rb +48 -0
  18. data/lib/rdoc/generator/darkfish.rb +25 -23
  19. data/lib/rdoc/generator/markup.rb +6 -29
  20. data/lib/rdoc/generator/ri.rb +39 -189
  21. data/lib/rdoc/generator/template/darkfish/classpage.rhtml +17 -1
  22. data/lib/rdoc/generator/template/darkfish/filepage.rhtml +10 -0
  23. data/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  24. data/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  25. data/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  26. data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  27. data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  28. data/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  29. data/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  30. data/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  31. data/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  32. data/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  33. data/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  34. data/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  35. data/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  36. data/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  37. data/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  38. data/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  39. data/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  40. data/lib/rdoc/generator/template/darkfish/index.rhtml +2 -2
  41. data/lib/rdoc/generator/template/darkfish/rdoc.css +38 -33
  42. data/lib/rdoc/include.rb +22 -0
  43. data/lib/rdoc/markup.rb +10 -262
  44. data/lib/rdoc/markup/attribute_manager.rb +57 -50
  45. data/lib/rdoc/markup/blank_line.rb +19 -0
  46. data/lib/rdoc/markup/document.rb +72 -0
  47. data/lib/rdoc/markup/formatter.rb +118 -0
  48. data/lib/rdoc/markup/formatter_test_case.rb +341 -0
  49. data/lib/rdoc/markup/heading.rb +17 -0
  50. data/lib/rdoc/markup/inline.rb +6 -5
  51. data/lib/rdoc/markup/list.rb +78 -0
  52. data/lib/rdoc/markup/list_item.rb +83 -0
  53. data/lib/rdoc/markup/paragraph.rb +66 -0
  54. data/lib/rdoc/markup/parser.rb +528 -0
  55. data/lib/rdoc/markup/rule.rb +17 -0
  56. data/lib/rdoc/markup/to_ansi.rb +72 -0
  57. data/lib/rdoc/markup/to_bs.rb +74 -0
  58. data/lib/rdoc/markup/to_html.rb +106 -172
  59. data/lib/rdoc/markup/to_html_crossref.rb +10 -4
  60. data/lib/rdoc/markup/to_rdoc.rb +243 -0
  61. data/lib/rdoc/markup/to_test.rb +27 -16
  62. data/lib/rdoc/markup/verbatim.rb +42 -0
  63. data/lib/rdoc/normal_class.rb +38 -1
  64. data/lib/rdoc/normal_module.rb +38 -8
  65. data/lib/rdoc/options.rb +39 -151
  66. data/lib/rdoc/parser.rb +36 -18
  67. data/lib/rdoc/parser/c.rb +102 -109
  68. data/lib/rdoc/parser/ruby.rb +359 -1662
  69. data/lib/rdoc/parser/ruby_tools.rb +157 -0
  70. data/lib/rdoc/parser/simple.rb +0 -2
  71. data/lib/rdoc/rdoc.rb +142 -82
  72. data/lib/rdoc/ri.rb +10 -0
  73. data/lib/rdoc/ri/driver.rb +674 -444
  74. data/lib/rdoc/ri/formatter.rb +2 -651
  75. data/lib/rdoc/ri/paths.rb +70 -45
  76. data/lib/rdoc/ri/store.rb +248 -0
  77. data/lib/rdoc/ruby_lex.rb +1284 -0
  78. data/lib/rdoc/ruby_token.rb +416 -0
  79. data/lib/rdoc/single_class.rb +5 -0
  80. data/lib/rdoc/stats.rb +152 -83
  81. data/lib/rdoc/task.rb +27 -49
  82. data/lib/rdoc/text.rb +130 -0
  83. data/lib/rdoc/tokenstream.rb +28 -9
  84. data/lib/rdoc/top_level.rb +49 -43
  85. data/test/hidden.zip.txt +1 -0
  86. data/test/test_attribute_manager.rb +9 -16
  87. data/test/test_rdoc_any_method.rb +23 -0
  88. data/test/test_rdoc_attr.rb +40 -0
  89. data/test/test_rdoc_class_module.rb +100 -0
  90. data/test/test_rdoc_code_object.rb +18 -2
  91. data/test/test_rdoc_context.rb +41 -0
  92. data/test/test_rdoc_generator_ri.rb +56 -0
  93. data/test/test_rdoc_markup.rb +21 -610
  94. data/test/test_rdoc_markup_attribute_manager.rb +14 -17
  95. data/test/test_rdoc_markup_document.rb +51 -0
  96. data/test/test_rdoc_markup_paragraph.rb +27 -0
  97. data/test/test_rdoc_markup_parser.rb +1327 -0
  98. data/test/test_rdoc_markup_to_ansi.rb +426 -0
  99. data/test/test_rdoc_markup_to_bs.rb +443 -0
  100. data/test/test_rdoc_markup_to_html.rb +183 -18
  101. data/test/test_rdoc_markup_to_html_crossref.rb +1 -3
  102. data/test/test_rdoc_markup_to_rdoc.rb +426 -0
  103. data/test/test_rdoc_normal_class.rb +17 -0
  104. data/test/test_rdoc_normal_module.rb +6 -6
  105. data/test/test_rdoc_options.rb +41 -0
  106. data/test/test_rdoc_parser.rb +66 -13
  107. data/test/test_rdoc_parser_c.rb +93 -38
  108. data/test/test_rdoc_parser_perl.rb +2 -3
  109. data/test/test_rdoc_parser_ruby.rb +291 -28
  110. data/test/test_rdoc_parser_simple.rb +48 -0
  111. data/test/test_rdoc_rdoc.rb +66 -0
  112. data/test/test_rdoc_ri_driver.rb +752 -38
  113. data/test/test_rdoc_ri_paths.rb +39 -0
  114. data/test/test_rdoc_ri_store.rb +309 -0
  115. data/test/test_rdoc_text.rb +157 -0
  116. data/test/test_rdoc_top_level.rb +35 -9
  117. data/test/xref_data.rb +9 -1
  118. data/test/xref_test_case.rb +8 -3
  119. metadata +110 -38
  120. metadata.gz.sig +0 -0
  121. data/lib/rdoc/cache.rb +0 -41
  122. data/lib/rdoc/diagram.rb +0 -340
  123. data/lib/rdoc/dot.rb +0 -249
  124. data/lib/rdoc/markup/fragments.rb +0 -377
  125. data/lib/rdoc/markup/lines.rb +0 -156
  126. data/lib/rdoc/markup/to_flow.rb +0 -211
  127. data/lib/rdoc/markup/to_latex.rb +0 -328
  128. data/lib/rdoc/markup/to_texinfo.rb +0 -73
  129. data/lib/rdoc/ri/cache.rb +0 -187
  130. data/lib/rdoc/ri/descriptions.rb +0 -156
  131. data/lib/rdoc/ri/display.rb +0 -340
  132. data/lib/rdoc/ri/reader.rb +0 -106
  133. data/lib/rdoc/ri/util.rb +0 -79
  134. data/lib/rdoc/ri/writer.rb +0 -68
  135. data/test/test_rdoc_ri_attribute_formatter.rb +0 -44
  136. data/test/test_rdoc_ri_default_display.rb +0 -302
  137. data/test/test_rdoc_ri_formatter.rb +0 -320
  138. data/test/test_rdoc_ri_html_formatter.rb +0 -141
  139. data/test/test_rdoc_ri_overstrike_formatter.rb +0 -71
@@ -1,211 +0,0 @@
1
- require 'rdoc/markup/formatter'
2
- require 'rdoc/markup/fragments'
3
- require 'rdoc/markup/inline'
4
- require 'cgi'
5
-
6
- class RDoc::Markup
7
-
8
- module Flow
9
-
10
- ##
11
- # Paragraph
12
-
13
- P = Struct.new(:body)
14
-
15
- ##
16
- # Verbatim
17
-
18
- VERB = Struct.new(:body)
19
-
20
- ##
21
- # Horizontal rule
22
-
23
- RULE = Struct.new(:width)
24
-
25
- ##
26
- # List
27
-
28
- class LIST
29
- attr_reader :type, :contents
30
- def initialize(type)
31
- @type = type
32
- @contents = []
33
- end
34
- def <<(stuff)
35
- @contents << stuff
36
- end
37
- end
38
-
39
- ##
40
- # List item
41
-
42
- LI = Struct.new(:label, :body)
43
-
44
- ##
45
- # Heading
46
-
47
- H = Struct.new(:level, :text)
48
-
49
- end
50
-
51
- class ToFlow < RDoc::Markup::Formatter
52
-
53
- LIST_TYPE_TO_HTML = {
54
- :BULLET => [ "<ul>", "</ul>" ],
55
- :NUMBER => [ "<ol>", "</ol>" ],
56
- :UPPERALPHA => [ "<ol>", "</ol>" ],
57
- :LOWERALPHA => [ "<ol>", "</ol>" ],
58
- :LABELED => [ "<dl>", "</dl>" ],
59
- :NOTE => [ "<table>", "</table>" ],
60
- }
61
-
62
- InlineTag = Struct.new(:bit, :on, :off)
63
-
64
- def initialize
65
- super
66
-
67
- init_tags
68
- end
69
-
70
- ##
71
- # Set up the standard mapping of attributes to HTML tags
72
-
73
- def init_tags
74
- @attr_tags = [
75
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
76
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT), "<tt>", "</tt>"),
77
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM), "<em>", "</em>"),
78
- ]
79
- end
80
-
81
- ##
82
- # Add a new set of HTML tags for an attribute. We allow separate start and
83
- # end tags for flexibility
84
-
85
- def add_tag(name, start, stop)
86
- @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
87
- end
88
-
89
- ##
90
- # Given an HTML tag, decorate it with class information and the like if
91
- # required. This is a no-op in the base class, but is overridden in HTML
92
- # output classes that implement style sheets
93
-
94
- def annotate(tag)
95
- tag
96
- end
97
-
98
- ##
99
- # :section: Visitor
100
-
101
- def start_accepting
102
- @res = []
103
- @list_stack = []
104
- end
105
-
106
- def end_accepting
107
- @res
108
- end
109
-
110
- def accept_paragraph(am, fragment)
111
- @res << Flow::P.new((convert_flow(am.flow(fragment.txt))))
112
- end
113
-
114
- def accept_verbatim(am, fragment)
115
- @res << Flow::VERB.new((convert_flow(am.flow(fragment.txt))))
116
- end
117
-
118
- def accept_rule(am, fragment)
119
- size = fragment.param
120
- size = 10 if size > 10
121
- @res << Flow::RULE.new(size)
122
- end
123
-
124
- def accept_list_start(am, fragment)
125
- @list_stack.push(@res)
126
- list = Flow::LIST.new(fragment.type)
127
- @res << list
128
- @res = list
129
- end
130
-
131
- def accept_list_end(am, fragment)
132
- @res = @list_stack.pop
133
- end
134
-
135
- def accept_list_item(am, fragment)
136
- @res << Flow::LI.new(fragment.param, convert_flow(am.flow(fragment.txt)))
137
- end
138
-
139
- def accept_blank_line(am, fragment)
140
- # @res << annotate("<p />") << "\n"
141
- end
142
-
143
- def accept_heading(am, fragment)
144
- @res << Flow::H.new(fragment.head_level, convert_flow(am.flow(fragment.txt)))
145
- end
146
-
147
- private
148
-
149
- def on_tags(res, item)
150
- attr_mask = item.turn_on
151
- return if attr_mask.zero?
152
-
153
- @attr_tags.each do |tag|
154
- if attr_mask & tag.bit != 0
155
- res << annotate(tag.on)
156
- end
157
- end
158
- end
159
-
160
- def off_tags(res, item)
161
- attr_mask = item.turn_off
162
- return if attr_mask.zero?
163
-
164
- @attr_tags.reverse_each do |tag|
165
- if attr_mask & tag.bit != 0
166
- res << annotate(tag.off)
167
- end
168
- end
169
- end
170
-
171
- def convert_flow(flow)
172
- res = ""
173
- flow.each do |item|
174
- case item
175
- when String
176
- res << convert_string(item)
177
- when AttrChanger
178
- off_tags(res, item)
179
- on_tags(res, item)
180
- when Special
181
- res << convert_special(item)
182
- else
183
- raise "Unknown flow element: #{item.inspect}"
184
- end
185
- end
186
- res
187
- end
188
-
189
- def convert_string(item)
190
- CGI.escapeHTML(item)
191
- end
192
-
193
- def convert_special(special)
194
- handled = false
195
- Attribute.each_name_of(special.type) do |name|
196
- method_name = "handle_special_#{name}"
197
- if self.respond_to? method_name
198
- special.text = send(method_name, special)
199
- handled = true
200
- end
201
- end
202
-
203
- raise "Unhandled special: #{special}" unless handled
204
-
205
- special.text
206
- end
207
-
208
- end
209
-
210
- end
211
-
@@ -1,328 +0,0 @@
1
- require 'rdoc/markup/formatter'
2
- require 'rdoc/markup/fragments'
3
- require 'rdoc/markup/inline'
4
-
5
- require 'cgi'
6
-
7
- ##
8
- # Convert SimpleMarkup to basic LaTeX report format.
9
-
10
- class RDoc::Markup::ToLaTeX < RDoc::Markup::Formatter
11
-
12
- BS = "\020" # \
13
- OB = "\021" # {
14
- CB = "\022" # }
15
- DL = "\023" # Dollar
16
-
17
- BACKSLASH = "#{BS}symbol#{OB}92#{CB}"
18
- HAT = "#{BS}symbol#{OB}94#{CB}"
19
- BACKQUOTE = "#{BS}symbol#{OB}0#{CB}"
20
- TILDE = "#{DL}#{BS}sim#{DL}"
21
- LESSTHAN = "#{DL}<#{DL}"
22
- GREATERTHAN = "#{DL}>#{DL}"
23
-
24
- def self.l(str)
25
- str.tr('\\', BS).tr('{', OB).tr('}', CB).tr('$', DL)
26
- end
27
-
28
- def l(arg)
29
- RDoc::Markup::ToLaTeX.l(arg)
30
- end
31
-
32
- LIST_TYPE_TO_LATEX = {
33
- :BULLET => [ l("\\begin{itemize}"), l("\\end{itemize}") ],
34
- :NUMBER => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\arabic" ],
35
- :UPPERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\Alph" ],
36
- :LOWERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\alph" ],
37
- :LABELED => [ l("\\begin{description}"), l("\\end{description}") ],
38
- :NOTE => [
39
- l("\\begin{tabularx}{\\linewidth}{@{} l X @{}}"),
40
- l("\\end{tabularx}") ],
41
- }
42
-
43
- InlineTag = Struct.new(:bit, :on, :off)
44
-
45
- def initialize
46
- init_tags
47
- @list_depth = 0
48
- @prev_list_types = []
49
- end
50
-
51
- ##
52
- # Set up the standard mapping of attributes to LaTeX
53
-
54
- def init_tags
55
- @attr_tags = [
56
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), l("\\textbf{"), l("}")),
57
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT), l("\\texttt{"), l("}")),
58
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM), l("\\emph{"), l("}")),
59
- ]
60
- end
61
-
62
- ##
63
- # Escape a LaTeX string
64
-
65
- def escape(str)
66
- $stderr.print "FE: ", str if $DEBUG_RDOC
67
- s = str.
68
- sub(/\s+$/, '').
69
- gsub(/([_\${}&%#])/, "#{BS}\\1").
70
- gsub(/\\/, BACKSLASH).
71
- gsub(/\^/, HAT).
72
- gsub(/~/, TILDE).
73
- gsub(/</, LESSTHAN).
74
- gsub(/>/, GREATERTHAN).
75
- gsub(/,,/, ",{},").
76
- gsub(/\`/, BACKQUOTE)
77
- $stderr.print "-> ", s, "\n" if $DEBUG_RDOC
78
- s
79
- end
80
-
81
- ##
82
- # Add a new set of LaTeX tags for an attribute. We allow
83
- # separate start and end tags for flexibility
84
-
85
- def add_tag(name, start, stop)
86
- @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
87
- end
88
-
89
- ##
90
- # This is a higher speed (if messier) version of wrap
91
-
92
- def wrap(txt, line_len = 76)
93
- res = ""
94
- sp = 0
95
- ep = txt.length
96
- while sp < ep
97
- # scan back for a space
98
- p = sp + line_len - 1
99
- if p >= ep
100
- p = ep
101
- else
102
- while p > sp and txt[p] != ?\s
103
- p -= 1
104
- end
105
- if p <= sp
106
- p = sp + line_len
107
- while p < ep and txt[p] != ?\s
108
- p += 1
109
- end
110
- end
111
- end
112
- res << txt[sp...p] << "\n"
113
- sp = p
114
- sp += 1 while sp < ep and txt[sp] == ?\s
115
- end
116
- res
117
- end
118
-
119
- ##
120
- # :section: Visitor
121
-
122
- def start_accepting
123
- @res = ""
124
- @in_list_entry = []
125
- end
126
-
127
- def end_accepting
128
- @res.tr(BS, '\\').tr(OB, '{').tr(CB, '}').tr(DL, '$')
129
- end
130
-
131
- def accept_paragraph(am, fragment)
132
- @res << wrap(convert_flow(am.flow(fragment.txt)))
133
- @res << "\n"
134
- end
135
-
136
- def accept_verbatim(am, fragment)
137
- @res << "\n\\begin{code}\n"
138
- @res << fragment.txt.sub(/[\n\s]+\Z/, '')
139
- @res << "\n\\end{code}\n\n"
140
- end
141
-
142
- def accept_rule(am, fragment)
143
- size = fragment.param
144
- size = 10 if size > 10
145
- @res << "\n\n\\rule{\\linewidth}{#{size}pt}\n\n"
146
- end
147
-
148
- def accept_list_start(am, fragment)
149
- @res << list_name(fragment.type, true) << "\n"
150
- @in_list_entry.push false
151
- end
152
-
153
- def accept_list_end(am, fragment)
154
- if tag = @in_list_entry.pop
155
- @res << tag << "\n"
156
- end
157
- @res << list_name(fragment.type, false) << "\n"
158
- end
159
-
160
- def accept_list_item(am, fragment)
161
- if tag = @in_list_entry.last
162
- @res << tag << "\n"
163
- end
164
- @res << list_item_start(am, fragment)
165
- @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
166
- @in_list_entry[-1] = list_end_for(fragment.type)
167
- end
168
-
169
- def accept_blank_line(am, fragment)
170
- # @res << "\n"
171
- end
172
-
173
- def accept_heading(am, fragment)
174
- @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
175
- end
176
-
177
- private
178
-
179
- def on_tags(res, item)
180
- attr_mask = item.turn_on
181
- return if attr_mask.zero?
182
-
183
- @attr_tags.each do |tag|
184
- if attr_mask & tag.bit != 0
185
- res << tag.on
186
- end
187
- end
188
- end
189
-
190
- def off_tags(res, item)
191
- attr_mask = item.turn_off
192
- return if attr_mask.zero?
193
-
194
- @attr_tags.reverse_each do |tag|
195
- if attr_mask & tag.bit != 0
196
- res << tag.off
197
- end
198
- end
199
- end
200
-
201
- def convert_flow(flow)
202
- res = ""
203
- flow.each do |item|
204
- case item
205
- when String
206
- $stderr.puts "Converting '#{item}'" if $DEBUG_RDOC
207
- res << convert_string(item)
208
- when AttrChanger
209
- off_tags(res, item)
210
- on_tags(res, item)
211
- when Special
212
- res << convert_special(item)
213
- else
214
- raise "Unknown flow element: #{item.inspect}"
215
- end
216
- end
217
- res
218
- end
219
-
220
- ##
221
- # some of these patterns are taken from SmartyPants...
222
-
223
- def convert_string(item)
224
- escape(item).
225
-
226
- # convert ... to elipsis (and make sure .... becomes .<elipsis>)
227
- gsub(/\.\.\.\./, '.\ldots{}').gsub(/\.\.\./, '\ldots{}').
228
-
229
- # convert single closing quote
230
- gsub(%r{([^ \t\r\n\[\{\(])\'}, '\1\'').
231
- gsub(%r{\'(?=\W|s\b)}, "'" ).
232
-
233
- # convert single opening quote
234
- gsub(/'/, '`').
235
-
236
- # convert double closing quote
237
- gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}, "\\1''").
238
-
239
- # convert double opening quote
240
- gsub(/"/, "``").
241
-
242
- # convert copyright
243
- gsub(/\(c\)/, '\copyright{}')
244
-
245
- end
246
-
247
- def convert_special(special)
248
- handled = false
249
- Attribute.each_name_of(special.type) do |name|
250
- method_name = "handle_special_#{name}"
251
- if self.respond_to? method_name
252
- special.text = send(method_name, special)
253
- handled = true
254
- end
255
- end
256
- raise "Unhandled special: #{special}" unless handled
257
- special.text
258
- end
259
-
260
- def convert_heading(level, flow)
261
- res =
262
- case level
263
- when 1 then "\\chapter{"
264
- when 2 then "\\section{"
265
- when 3 then "\\subsection{"
266
- when 4 then "\\subsubsection{"
267
- else "\\paragraph{"
268
- end +
269
- convert_flow(flow) +
270
- "}\n"
271
- end
272
-
273
- def list_name(list_type, is_open_tag)
274
- tags = LIST_TYPE_TO_LATEX[list_type] || raise("Invalid list type: #{list_type.inspect}")
275
- if tags[2] # enumerate
276
- if is_open_tag
277
- @list_depth += 1
278
- if @prev_list_types[@list_depth] != tags[2]
279
- case @list_depth
280
- when 1
281
- roman = "i"
282
- when 2
283
- roman = "ii"
284
- when 3
285
- roman = "iii"
286
- when 4
287
- roman = "iv"
288
- else
289
- raise("Too deep list: level #{@list_depth}")
290
- end
291
- @prev_list_types[@list_depth] = tags[2]
292
- return l("\\renewcommand{\\labelenum#{roman}}{#{tags[2]}{enum#{roman}}}") + "\n" + tags[0]
293
- end
294
- else
295
- @list_depth -= 1
296
- end
297
- end
298
- tags[ is_open_tag ? 0 : 1]
299
- end
300
-
301
- def list_item_start(am, fragment)
302
- case fragment.type
303
- when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA then
304
- "\\item "
305
-
306
- when :LABELED then
307
- "\\item[" + convert_flow(am.flow(fragment.param)) + "] "
308
-
309
- when :NOTE then
310
- convert_flow(am.flow(fragment.param)) + " & "
311
- else
312
- raise "Invalid list type"
313
- end
314
- end
315
-
316
- def list_end_for(fragment_type)
317
- case fragment_type
318
- when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA, :LABELED then
319
- ""
320
- when :NOTE
321
- "\\\\\n"
322
- else
323
- raise "Invalid list type"
324
- end
325
- end
326
-
327
- end
328
-