rdoc 2.0.0

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 (62) hide show
  1. data/History.txt +13 -0
  2. data/Manifest.txt +61 -0
  3. data/README.txt +34 -0
  4. data/Rakefile +10 -0
  5. data/bin/rdoc +22 -0
  6. data/bin/ri +6 -0
  7. data/lib/rdoc.rb +277 -0
  8. data/lib/rdoc/code_objects.rb +776 -0
  9. data/lib/rdoc/diagram.rb +338 -0
  10. data/lib/rdoc/dot.rb +249 -0
  11. data/lib/rdoc/generator.rb +1048 -0
  12. data/lib/rdoc/generator/chm.rb +113 -0
  13. data/lib/rdoc/generator/chm/chm.rb +98 -0
  14. data/lib/rdoc/generator/html.rb +370 -0
  15. data/lib/rdoc/generator/html/hefss.rb +414 -0
  16. data/lib/rdoc/generator/html/html.rb +704 -0
  17. data/lib/rdoc/generator/html/kilmer.rb +418 -0
  18. data/lib/rdoc/generator/html/one_page_html.rb +121 -0
  19. data/lib/rdoc/generator/ri.rb +229 -0
  20. data/lib/rdoc/generator/xml.rb +120 -0
  21. data/lib/rdoc/generator/xml/rdf.rb +113 -0
  22. data/lib/rdoc/generator/xml/xml.rb +111 -0
  23. data/lib/rdoc/markup.rb +473 -0
  24. data/lib/rdoc/markup/attribute_manager.rb +274 -0
  25. data/lib/rdoc/markup/formatter.rb +14 -0
  26. data/lib/rdoc/markup/fragments.rb +337 -0
  27. data/lib/rdoc/markup/inline.rb +101 -0
  28. data/lib/rdoc/markup/lines.rb +152 -0
  29. data/lib/rdoc/markup/preprocess.rb +71 -0
  30. data/lib/rdoc/markup/to_flow.rb +185 -0
  31. data/lib/rdoc/markup/to_html.rb +353 -0
  32. data/lib/rdoc/markup/to_html_crossref.rb +86 -0
  33. data/lib/rdoc/markup/to_latex.rb +328 -0
  34. data/lib/rdoc/markup/to_test.rb +50 -0
  35. data/lib/rdoc/options.rb +616 -0
  36. data/lib/rdoc/parsers/parse_c.rb +775 -0
  37. data/lib/rdoc/parsers/parse_f95.rb +1841 -0
  38. data/lib/rdoc/parsers/parse_rb.rb +2584 -0
  39. data/lib/rdoc/parsers/parse_simple.rb +40 -0
  40. data/lib/rdoc/parsers/parserfactory.rb +99 -0
  41. data/lib/rdoc/rdoc.rb +277 -0
  42. data/lib/rdoc/ri.rb +4 -0
  43. data/lib/rdoc/ri/cache.rb +188 -0
  44. data/lib/rdoc/ri/descriptions.rb +150 -0
  45. data/lib/rdoc/ri/display.rb +274 -0
  46. data/lib/rdoc/ri/driver.rb +452 -0
  47. data/lib/rdoc/ri/formatter.rb +616 -0
  48. data/lib/rdoc/ri/paths.rb +102 -0
  49. data/lib/rdoc/ri/reader.rb +106 -0
  50. data/lib/rdoc/ri/util.rb +81 -0
  51. data/lib/rdoc/ri/writer.rb +68 -0
  52. data/lib/rdoc/stats.rb +25 -0
  53. data/lib/rdoc/template.rb +64 -0
  54. data/lib/rdoc/tokenstream.rb +33 -0
  55. data/test/test_rdoc_c_parser.rb +261 -0
  56. data/test/test_rdoc_markup.rb +613 -0
  57. data/test/test_rdoc_markup_attribute_manager.rb +224 -0
  58. data/test/test_rdoc_ri_attribute_formatter.rb +42 -0
  59. data/test/test_rdoc_ri_default_display.rb +295 -0
  60. data/test/test_rdoc_ri_formatter.rb +318 -0
  61. data/test/test_rdoc_ri_overstrike_formatter.rb +69 -0
  62. metadata +134 -0
@@ -0,0 +1,414 @@
1
+ require 'rdoc/generator/html'
2
+ require 'rdoc/generator/html/html'
3
+
4
+ module RDoc::Generator::HTML::HEFSS
5
+
6
+ FONTS = "Verdana, Arial, Helvetica, sans-serif"
7
+
8
+ STYLE = <<-EOF
9
+ body,p { font-family: Verdana, Arial, Helvetica, sans-serif;
10
+ color: #000040; background: #BBBBBB;
11
+ }
12
+
13
+ td { font-family: Verdana, Arial, Helvetica, sans-serif;
14
+ color: #000040;
15
+ }
16
+
17
+ .attr-rw { font-size: small; color: #444488 }
18
+
19
+ .title-row {color: #eeeeff;
20
+ background: #BBBBDD;
21
+ }
22
+
23
+ .big-title-font { color: white;
24
+ font-family: Verdana, Arial, Helvetica, sans-serif;
25
+ font-size: large;
26
+ height: 50px}
27
+
28
+ .small-title-font { color: purple;
29
+ font-family: Verdana, Arial, Helvetica, sans-serif;
30
+ font-size: small; }
31
+
32
+ .aqua { color: purple }
33
+
34
+ .method-name, attr-name {
35
+ font-family: monospace; font-weight: bold;
36
+ }
37
+
38
+ .tablesubtitle {
39
+ width: 100%;
40
+ margin-top: 1ex;
41
+ margin-bottom: .5ex;
42
+ padding: 5px 0px 5px 20px;
43
+ font-size: large;
44
+ color: purple;
45
+ background: #BBBBCC;
46
+ }
47
+
48
+ .tablesubsubtitle {
49
+ width: 100%;
50
+ margin-top: 1ex;
51
+ margin-bottom: .5ex;
52
+ padding: 5px 0px 5px 20px;
53
+ font-size: medium;
54
+ color: white;
55
+ background: #BBBBCC;
56
+ }
57
+
58
+ .name-list {
59
+ font-family: monospace;
60
+ margin-left: 40px;
61
+ margin-bottom: 2ex;
62
+ line-height: 140%;
63
+ }
64
+
65
+ .description {
66
+ margin-left: 40px;
67
+ margin-bottom: 2ex;
68
+ line-height: 140%;
69
+ }
70
+
71
+ .methodtitle {
72
+ font-size: medium;
73
+ text_decoration: none;
74
+ padding: 3px 3px 3px 20px;
75
+ color: #0000AA;
76
+ }
77
+
78
+ .column-title {
79
+ font-size: medium;
80
+ font-weight: bold;
81
+ text_decoration: none;
82
+ padding: 3px 3px 3px 20px;
83
+ color: #3333CC;
84
+ }
85
+
86
+ .variable-name {
87
+ font-family: monospace;
88
+ font-size: medium;
89
+ text_decoration: none;
90
+ padding: 3px 3px 3px 20px;
91
+ color: #0000AA;
92
+ }
93
+
94
+ .row-name {
95
+ font-size: medium;
96
+ font-weight: medium;
97
+ font-family: monospace;
98
+ text_decoration: none;
99
+ padding: 3px 3px 3px 20px;
100
+ }
101
+
102
+ .paramsig {
103
+ font-size: small;
104
+ }
105
+
106
+ .srcbut { float: right }
107
+
108
+ EOF
109
+
110
+ BODY = <<-EOF
111
+ <html><head>
112
+ <title><%= values["title"] %></title>
113
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
114
+ <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
115
+ <script type="text/javascript" language="JavaScript">
116
+ <!--
117
+ function popCode(url) {
118
+ parent.frames.source.location = url
119
+ }
120
+ //-->
121
+ </script>
122
+ </head>
123
+ <body bgcolor="#BBBBBB">
124
+
125
+ <%= template_include %> <!-- banner header -->
126
+
127
+ <% if values["diagram"] then %>
128
+ <table width="100%"><tr><td align="center">
129
+ <%= values["diagram"] %>
130
+ </td></tr></table>
131
+ <% end %>
132
+
133
+ <% if values["description"] then %>
134
+ <div class="description"><%= values["description"] %></div>
135
+ <% end %>
136
+
137
+ <% if values["requires"] then %>
138
+ <table cellpadding="5" width="100%">
139
+ <tr><td class="tablesubtitle">Required files</td></tr>
140
+ </table><br />
141
+ <div class="name-list">
142
+ <% values["requires"].each do |requires| %>
143
+ <%= href requires["aref"], requires["name"] %>
144
+ <% end # values["requires"] %>
145
+ <% end %>
146
+ </div>
147
+
148
+ <% if values["sections"] then %>
149
+ <% values["sections"].each do |sections| %>
150
+ <% if sections["method_list"] then %>
151
+ <% sections["method_list"].each do |method_list| %>
152
+ <% if method_list["methods"] then %>
153
+ <table cellpadding="5" width="100%">
154
+ <tr><td class="tablesubtitle">Subroutines and Functions</td></tr>
155
+ </table><br />
156
+ <div class="name-list">
157
+ <% method_list["methods"].each do |methods| %>
158
+ <a href="<%= methods["codeurl"] %>" target="source"><%= methods["name"] %></a>
159
+ <% end # values["methods"] %>
160
+ </div>
161
+ <% end %>
162
+ <% end # values["method_list"] %>
163
+ <% end %>
164
+
165
+ <% if sections["attributes"] then %>
166
+ <table cellpadding="5" width="100%">
167
+ <tr><td class="tablesubtitle">Arguments</td></tr>
168
+ </table><br />
169
+ <table cellspacing="5">
170
+ <% sections["attributes"].each do |attributes| %>
171
+ <tr valign="top">
172
+ <% if attributes["rw"] then %>
173
+ <td align="center" class="attr-rw">&nbsp;[<%= attributes["rw"] %>]&nbsp;</td>
174
+ <% end %>
175
+ <% unless attributes["rw"] then %>
176
+ <td></td>
177
+ <% end %>
178
+ <td class="attr-name"><%= attributes["name"] %></td>
179
+ <td><%= attributes["a_desc"] %></td>
180
+ </tr>
181
+ <% end # values["attributes"] %>
182
+ </table>
183
+ <% end %>
184
+ <% end # values["sections"] %>
185
+ <% end %>
186
+
187
+ <% if values["classlist"] then %>
188
+ <table cellpadding="5" width="100%">
189
+ <tr><td class="tablesubtitle">Modules</td></tr>
190
+ </table><br />
191
+ <%= values["classlist"] %><br />
192
+ <% end %>
193
+
194
+ <%= template_include %> <!-- method descriptions -->
195
+
196
+ </body>
197
+ </html>
198
+ EOF
199
+
200
+ FILE_PAGE = <<-EOF
201
+ <table width="100%">
202
+ <tr class="title-row">
203
+ <td><table width="100%"><tr>
204
+ <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font><%= values["short_name"] %></td>
205
+ <td align="right"><table cellspacing="0" cellpadding="2">
206
+ <tr>
207
+ <td class="small-title-font">Path:</td>
208
+ <td class="small-title-font"><%= values["full_path"] %>
209
+ <% if values["cvsurl"] then %>
210
+ &nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
211
+ <% end %>
212
+ </td>
213
+ </tr>
214
+ <tr>
215
+ <td class="small-title-font">Modified:</td>
216
+ <td class="small-title-font"><%= values["dtm_modified"] %></td>
217
+ </tr>
218
+ </table>
219
+ </td></tr></table></td>
220
+ </tr>
221
+ </table><br />
222
+ EOF
223
+
224
+ CLASS_PAGE = <<-EOF
225
+ <table width="100%" border="0" cellspacing="0">
226
+ <tr class="title-row">
227
+ <td class="big-title-font">
228
+ <font size="-3"><b><%= values["classmod"] %></b><br /></font><%= values["full_name"] %>
229
+ </td>
230
+ <td align="right">
231
+ <table cellspacing="0" cellpadding="2">
232
+ <tr valign="top">
233
+ <td class="small-title-font">In:</td>
234
+ <td class="small-title-font">
235
+ <% values["infiles"].each do |infiles| %>
236
+ <%= href infiles["full_path_url"], infiles["full_path"] %>
237
+ <% if infiles["cvsurl"] then %>
238
+ &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
239
+ <% end %>
240
+ <% end # values["infiles"] %>
241
+ </td>
242
+ </tr>
243
+ <% if values["parent"] then %>
244
+ <tr>
245
+ <td class="small-title-font">Parent:</td>
246
+ <td class="small-title-font">
247
+ <% if values["par_url"] then %>
248
+ <a href="<%= values["par_url"] %>" class="cyan">
249
+ <% end %>
250
+ <%= values["parent"] %>
251
+ <% if values["par_url"] then %>
252
+ </a>
253
+ <% end %>
254
+ </td>
255
+ </tr>
256
+ <% end %>
257
+ </table>
258
+ </td>
259
+ </tr>
260
+ </table><br />
261
+ EOF
262
+
263
+ METHOD_LIST = <<-EOF
264
+ <% if values["includes"] then %>
265
+ <div class="tablesubsubtitle">Uses</div><br />
266
+ <div class="name-list">
267
+ <% values["includes"].each do |includes| %>
268
+ <span class="method-name"><%= href includes["aref"], includes["name"] %></span>
269
+ <% end # values["includes"] %>
270
+ </div>
271
+ <% end %>
272
+
273
+ <% if values["sections"] then %>
274
+ <% values["sections"].each do |sections| %>
275
+ <% if sections["method_list"] then %>
276
+ <% sections["method_list"].each do |method_list| %>
277
+ <% if method_list["methods"] then %>
278
+ <table cellpadding="5" width="100%">
279
+ <tr><td class="tablesubtitle"><%= method_list["type"] %> <%= method_list["category"] %> methods</td></tr>
280
+ </table>
281
+ <% method_list["methods"].each do |methods| %>
282
+ <table width="100%" cellspacing="0" cellpadding="5" border="0">
283
+ <tr><td class="methodtitle">
284
+ <a name="<%= methods["aref"] %>">
285
+ <b><%= methods["name"] %></b><%= methods["params"] %>
286
+ <% if methods["codeurl"] then %>
287
+ <a href="<%= methods["codeurl"] %>" target="source" class="srclink">src</a>
288
+ <% end %>
289
+ </a></td></tr>
290
+ </table>
291
+ <% if method_list["m_desc"] then %>
292
+ <div class="description">
293
+ <%= method_list["m_desc"] %>
294
+ </div>
295
+ <% end %>
296
+ <% end # method_list["methods"] %>
297
+ <% end %>
298
+ <% end # sections["method_list"] %>
299
+ <% end %>
300
+ <% end # values["sections"] %>
301
+ <% end %>
302
+ EOF
303
+
304
+ SRC_PAGE = <<-EOF
305
+ <html>
306
+ <head><title><%= values["title"] %></title>
307
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
308
+ <style type="text/css">
309
+ .kw { color: #3333FF; font-weight: bold }
310
+ .cmt { color: green; font-style: italic }
311
+ .str { color: #662222; font-style: italic }
312
+ .re { color: #662222; }
313
+ .ruby-comment { color: green; font-style: italic }
314
+ .ruby-constant { color: #4433aa; font-weight: bold; }
315
+ .ruby-identifier { color: #222222; }
316
+ .ruby-ivar { color: #2233dd; }
317
+ .ruby-keyword { color: #3333FF; font-weight: bold }
318
+ .ruby-node { color: #777777; }
319
+ .ruby-operator { color: #111111; }
320
+ .ruby-regexp { color: #662222; }
321
+ .ruby-value { color: #662222; font-style: italic }
322
+ </style>
323
+ </head>
324
+ <body bgcolor="#BBBBBB">
325
+ <pre><%= values["code"] %></pre>
326
+ </body>
327
+ </html>
328
+ EOF
329
+
330
+ FR_INDEX_BODY = %{
331
+ <%= template_include %>
332
+ }
333
+
334
+ FILE_INDEX = <<-EOF
335
+ <html>
336
+ <head>
337
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
338
+ <style type="text/css">
339
+ <!--
340
+ body {
341
+ background-color: #bbbbbb;
342
+ font-family: #{FONTS};
343
+ font-size: 11px;
344
+ font-style: normal;
345
+ line-height: 14px;
346
+ color: #000040;
347
+ }
348
+ div.banner {
349
+ background: #bbbbcc;
350
+ color: white;
351
+ padding: 1;
352
+ margin: 0;
353
+ font-size: 90%;
354
+ font-weight: bold;
355
+ line-height: 1.1;
356
+ text-align: center;
357
+ width: 100%;
358
+ }
359
+
360
+ -->
361
+ </style>
362
+ <base target="docwin">
363
+ </head>
364
+ <body>
365
+ <div class="banner"><%= values["list_title"] %></div>
366
+ <% values["entries"].each do |entries| %>
367
+ <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
368
+ <% end # values["entries"] %>
369
+ </body></html>
370
+ EOF
371
+
372
+ CLASS_INDEX = FILE_INDEX
373
+ METHOD_INDEX = FILE_INDEX
374
+
375
+ INDEX = <<-EOF
376
+ <html>
377
+ <head>
378
+ <title><%= values["title"] %></title>
379
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
380
+ </head>
381
+
382
+ <frameset cols="20%,*">
383
+ <frameset rows="15%,35%,50%">
384
+ <frame src="fr_file_index.html" title="Files" name="Files">
385
+ <frame src="fr_class_index.html" name="Modules">
386
+ <frame src="fr_method_index.html" name="Subroutines and Functions">
387
+ </frameset>
388
+ <frameset rows="80%,20%">
389
+ <frame src="<%= values["initial_page"] %>" name="docwin">
390
+ <frame src="blank.html" name="source">
391
+ </frameset>
392
+ <noframes>
393
+ <body bgcolor="#BBBBBB">
394
+ Click <a href="html/index.html">here</a> for a non-frames
395
+ version of this page.
396
+ </body>
397
+ </noframes>
398
+ </frameset>
399
+
400
+ </html>
401
+ EOF
402
+
403
+ # Blank page to use as a target
404
+ BLANK = %{
405
+ <html><body bgcolor="#BBBBBB"></body></html>
406
+ }
407
+
408
+ def write_extra_pages
409
+ template = TemplatePage.new(BLANK)
410
+ File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
411
+ end
412
+
413
+ end
414
+
@@ -0,0 +1,704 @@
1
+ require 'rdoc/generator/html'
2
+ require 'rdoc/generator/html/one_page_html'
3
+
4
+ ##
5
+ # = CSS2 RDoc HTML template
6
+ #
7
+ # This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
8
+ # bit more of the appearance of the output to cascading stylesheets than the
9
+ # default. It was designed for clean inline code display, and uses DHTMl to
10
+ # toggle the visbility of each method's source with each click on the '[source]'
11
+ # link.
12
+ #
13
+ # == Authors
14
+ #
15
+ # * Michael Granger <ged@FaerieMUD.org>
16
+ #
17
+ # Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
18
+ #
19
+ # This work is licensed under the Creative Commons Attribution License. To view
20
+ # a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or
21
+ # send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
22
+ # 94305, USA.
23
+
24
+ module RDoc::Generator::HTML::HTML
25
+
26
+ FONTS = "Verdana,Arial,Helvetica,sans-serif"
27
+
28
+ STYLE = <<-EOF
29
+ body {
30
+ font-family: Verdana,Arial,Helvetica,sans-serif;
31
+ font-size: 90%;
32
+ margin: 0;
33
+ margin-left: 40px;
34
+ padding: 0;
35
+ background: white;
36
+ }
37
+
38
+ h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
39
+ h1 { font-size: 150%; }
40
+ h2,h3,h4 { margin-top: 1em; }
41
+
42
+ a { background: #eef; color: #039; text-decoration: none; }
43
+ a:hover { background: #039; color: #eef; }
44
+
45
+ /* Override the base stylesheet's Anchor inside a table cell */
46
+ td > a {
47
+ background: transparent;
48
+ color: #039;
49
+ text-decoration: none;
50
+ }
51
+
52
+ /* and inside a section title */
53
+ .section-title > a {
54
+ background: transparent;
55
+ color: #eee;
56
+ text-decoration: none;
57
+ }
58
+
59
+ /* === Structural elements =================================== */
60
+
61
+ div#index {
62
+ margin: 0;
63
+ margin-left: -40px;
64
+ padding: 0;
65
+ font-size: 90%;
66
+ }
67
+
68
+
69
+ div#index a {
70
+ margin-left: 0.7em;
71
+ }
72
+
73
+ div#index .section-bar {
74
+ margin-left: 0px;
75
+ padding-left: 0.7em;
76
+ background: #ccc;
77
+ font-size: small;
78
+ }
79
+
80
+
81
+ div#classHeader, div#fileHeader {
82
+ width: auto;
83
+ color: white;
84
+ padding: 0.5em 1.5em 0.5em 1.5em;
85
+ margin: 0;
86
+ margin-left: -40px;
87
+ border-bottom: 3px solid #006;
88
+ }
89
+
90
+ div#classHeader a, div#fileHeader a {
91
+ background: inherit;
92
+ color: white;
93
+ }
94
+
95
+ div#classHeader td, div#fileHeader td {
96
+ background: inherit;
97
+ color: white;
98
+ }
99
+
100
+
101
+ div#fileHeader {
102
+ background: #057;
103
+ }
104
+
105
+ div#classHeader {
106
+ background: #048;
107
+ }
108
+
109
+
110
+ .class-name-in-header {
111
+ font-size: 180%;
112
+ font-weight: bold;
113
+ }
114
+
115
+
116
+ div#bodyContent {
117
+ padding: 0 1.5em 0 1.5em;
118
+ }
119
+
120
+ div#description {
121
+ padding: 0.5em 1.5em;
122
+ background: #efefef;
123
+ border: 1px dotted #999;
124
+ }
125
+
126
+ div#description h1,h2,h3,h4,h5,h6 {
127
+ color: #125;;
128
+ background: transparent;
129
+ }
130
+
131
+ div#validator-badges {
132
+ text-align: center;
133
+ }
134
+ div#validator-badges img { border: 0; }
135
+
136
+ div#copyright {
137
+ color: #333;
138
+ background: #efefef;
139
+ font: 0.75em sans-serif;
140
+ margin-top: 5em;
141
+ margin-bottom: 0;
142
+ padding: 0.5em 2em;
143
+ }
144
+
145
+
146
+ /* === Classes =================================== */
147
+
148
+ table.header-table {
149
+ color: white;
150
+ font-size: small;
151
+ }
152
+
153
+ .type-note {
154
+ font-size: small;
155
+ color: #DEDEDE;
156
+ }
157
+
158
+ .xxsection-bar {
159
+ background: #eee;
160
+ color: #333;
161
+ padding: 3px;
162
+ }
163
+
164
+ .section-bar {
165
+ color: #333;
166
+ border-bottom: 1px solid #999;
167
+ margin-left: -20px;
168
+ }
169
+
170
+
171
+ .section-title {
172
+ background: #79a;
173
+ color: #eee;
174
+ padding: 3px;
175
+ margin-top: 2em;
176
+ margin-left: -30px;
177
+ border: 1px solid #999;
178
+ }
179
+
180
+ .top-aligned-row { vertical-align: top }
181
+ .bottom-aligned-row { vertical-align: bottom }
182
+
183
+ /* --- Context section classes ----------------------- */
184
+
185
+ .context-row { }
186
+ .context-item-name { font-family: monospace; font-weight: bold; color: black; }
187
+ .context-item-value { font-size: small; color: #448; }
188
+ .context-item-desc { color: #333; padding-left: 2em; }
189
+
190
+ /* --- Method classes -------------------------- */
191
+ .method-detail {
192
+ background: #efefef;
193
+ padding: 0;
194
+ margin-top: 0.5em;
195
+ margin-bottom: 1em;
196
+ border: 1px dotted #ccc;
197
+ }
198
+ .method-heading {
199
+ color: black;
200
+ background: #ccc;
201
+ border-bottom: 1px solid #666;
202
+ padding: 0.2em 0.5em 0 0.5em;
203
+ }
204
+ .method-signature { color: black; background: inherit; }
205
+ .method-name { font-weight: bold; }
206
+ .method-args { font-style: italic; }
207
+ .method-description { padding: 0 0.5em 0 0.5em; }
208
+
209
+ /* --- Source code sections -------------------- */
210
+
211
+ a.source-toggle { font-size: 90%; }
212
+ div.method-source-code {
213
+ background: #262626;
214
+ color: #ffdead;
215
+ margin: 1em;
216
+ padding: 0.5em;
217
+ border: 1px dashed #999;
218
+ overflow: hidden;
219
+ }
220
+
221
+ div.method-source-code pre { color: #ffdead; overflow: hidden; }
222
+
223
+ /* --- Ruby keyword styles --------------------- */
224
+
225
+ .standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
226
+
227
+ .ruby-constant { color: #7fffd4; background: transparent; }
228
+ .ruby-keyword { color: #00ffff; background: transparent; }
229
+ .ruby-ivar { color: #eedd82; background: transparent; }
230
+ .ruby-operator { color: #00ffee; background: transparent; }
231
+ .ruby-identifier { color: #ffdead; background: transparent; }
232
+ .ruby-node { color: #ffa07a; background: transparent; }
233
+ .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
234
+ .ruby-regexp { color: #ffa07a; background: transparent; }
235
+ .ruby-value { color: #7fffd4; background: transparent; }
236
+ EOF
237
+
238
+
239
+ #####################################################################
240
+ ### H E A D E R T E M P L A T E
241
+ #####################################################################
242
+
243
+ XHTML_PREAMBLE = <<-EOF
244
+ <?xml version="1.0" encoding="<%= values["charset"] %>"?>
245
+ <!DOCTYPE html
246
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
247
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
248
+ EOF
249
+
250
+ HEADER = XHTML_PREAMBLE + <<-EOF
251
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
252
+ <head>
253
+ <title><%= values["title"] %></title>
254
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
255
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
256
+ <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
257
+ <script type="text/javascript">
258
+ // <![CDATA[
259
+
260
+ function popupCode( url ) {
261
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
262
+ }
263
+
264
+ function toggleCode( id ) {
265
+ if ( document.getElementById )
266
+ elem = document.getElementById( id );
267
+ else if ( document.all )
268
+ elem = eval( "document.all." + id );
269
+ else
270
+ return false;
271
+
272
+ elemStyle = elem.style;
273
+
274
+ if ( elemStyle.display != "block" ) {
275
+ elemStyle.display = "block"
276
+ } else {
277
+ elemStyle.display = "none"
278
+ }
279
+
280
+ return true;
281
+ }
282
+
283
+ // Make codeblocks hidden by default
284
+ document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }</style>" )
285
+
286
+ // ]]>
287
+ </script>
288
+
289
+ </head>
290
+ <body>
291
+ EOF
292
+
293
+ #####################################################################
294
+ ### C O N T E X T C O N T E N T T E M P L A T E
295
+ #####################################################################
296
+
297
+ CONTEXT_CONTENT = %{
298
+ }
299
+
300
+ #####################################################################
301
+ ### F O O T E R T E M P L A T E
302
+ #####################################################################
303
+
304
+ FOOTER = <<-EOF
305
+ <div id="validator-badges">
306
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
307
+ </div>
308
+
309
+ </body>
310
+ </html>
311
+ EOF
312
+
313
+
314
+ #####################################################################
315
+ ### F I L E P A G E H E A D E R T E M P L A T E
316
+ #####################################################################
317
+
318
+ FILE_PAGE = <<-EOF
319
+ <div id="fileHeader">
320
+ <h1><%= values["short_name"] %></h1>
321
+ <table class="header-table">
322
+ <tr class="top-aligned-row">
323
+ <td><strong>Path:</strong></td>
324
+ <td><%= values["full_path"] %>
325
+ <% if values["cvsurl"] then %>
326
+ &nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
327
+ <% end %>
328
+ </td>
329
+ </tr>
330
+ <tr class="top-aligned-row">
331
+ <td><strong>Last Update:</strong></td>
332
+ <td><%= values["dtm_modified"] %></td>
333
+ </tr>
334
+ </table>
335
+ </div>
336
+ EOF
337
+
338
+ #####################################################################
339
+ ### C L A S S P A G E H E A D E R T E M P L A T E
340
+ #####################################################################
341
+
342
+ CLASS_PAGE = <<-EOF
343
+ <div id="classHeader">
344
+ <table class="header-table">
345
+ <tr class="top-aligned-row">
346
+ <td><strong><%= values["classmod"] %></strong></td>
347
+ <td class="class-name-in-header"><%= values["full_name"] %></td>
348
+ </tr>
349
+ <tr class="top-aligned-row">
350
+ <td><strong>In:</strong></td>
351
+ <td>
352
+ <% values["infiles"].each do |infiles| %>
353
+ <% if infiles["full_path_url"] then %>
354
+ <a href="<%= infiles["full_path_url"] %>">
355
+ <% end %>
356
+ <%= infiles["full_path"] %>
357
+ <% if infiles["full_path_url"] then %>
358
+ </a>
359
+ <% end %>
360
+ <% if infiles["cvsurl"] then %>
361
+ &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
362
+ <% end %>
363
+ <br />
364
+ <% end # values["infiles"] %>
365
+ </td>
366
+ </tr>
367
+
368
+ <% if values["parent"] then %>
369
+ <tr class="top-aligned-row">
370
+ <td><strong>Parent:</strong></td>
371
+ <td>
372
+ <% if values["par_url"] then %>
373
+ <a href="<%= values["par_url"] %>">
374
+ <% end %>
375
+ <%= values["parent"] %>
376
+ <% if values["par_url"] then %>
377
+ </a>
378
+ <% end %>
379
+ </td>
380
+ </tr>
381
+ <% end %>
382
+ </table>
383
+ </div>
384
+ EOF
385
+
386
+ #####################################################################
387
+ ### M E T H O D L I S T T E M P L A T E
388
+ #####################################################################
389
+
390
+ METHOD_LIST = <<-EOF
391
+
392
+ <div id="contextContent">
393
+ <% if values["diagram"] then %>
394
+ <div id="diagram">
395
+ <%= values["diagram"] %>
396
+ </div>
397
+ <% end %>
398
+
399
+ <% if values["description"] then %>
400
+ <div id="description">
401
+ <%= values["description"] %>
402
+ </div>
403
+ <% end %>
404
+
405
+ <% if values["requires"] then %>
406
+ <div id="requires-list">
407
+ <h3 class="section-bar">Required files</h3>
408
+
409
+ <div class="name-list">
410
+ <% values["requires"].each do |requires| %>
411
+ <%= href requires["aref"], requires["name"] %>&nbsp;&nbsp;
412
+ <% end # values["requires"] %>
413
+ </div>
414
+ </div>
415
+ <% end %>
416
+
417
+ <% if values["toc"] then %>
418
+ <div id="contents-list">
419
+ <h3 class="section-bar">Contents</h3>
420
+ <ul>
421
+ <% values["toc"].each do |toc| %>
422
+ <li><a href="#<%= values["href"] %>"><%= values["secname"] %></a></li>
423
+ <% end # values["toc"] %>
424
+ </ul>
425
+ <% end %>
426
+ </div>
427
+
428
+ <% if values["methods"] then %>
429
+ <div id="method-list">
430
+ <h3 class="section-bar">Methods</h3>
431
+
432
+ <div class="name-list">
433
+ <% values["methods"].each do |methods| %>
434
+ <%= href methods["aref"], methods["name"] %>&nbsp;&nbsp;
435
+ <% end # values["methods"] %>
436
+ </div>
437
+ </div>
438
+ <% end %>
439
+
440
+ </div>
441
+
442
+
443
+ <!-- if includes -->
444
+ <% if values["includes"] then %>
445
+ <div id="includes">
446
+ <h3 class="section-bar">Included Modules</h3>
447
+
448
+ <div id="includes-list">
449
+ <% values["includes"].each do |includes| %>
450
+ <span class="include-name"><%= href includes["aref"], includes["name"] %></span>
451
+ <% end # values["includes"] %>
452
+ </div>
453
+ </div>
454
+ <% end %>
455
+
456
+ <% values["sections"].each do |sections| %>
457
+ <div id="section">
458
+ <% if sections["sectitle"] then %>
459
+ <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
460
+ <% if sections["seccomment"] then %>
461
+ <div class="section-comment">
462
+ <%= sections["seccomment"] %>
463
+ </div>
464
+ <% end %>
465
+ <% end %>
466
+
467
+ <% if values["classlist"] then %>
468
+ <div id="class-list">
469
+ <h3 class="section-bar">Classes and Modules</h3>
470
+
471
+ <%= values["classlist"] %>
472
+ </div>
473
+ <% end %>
474
+
475
+ <% if values["constants"] then %>
476
+ <div id="constants-list">
477
+ <h3 class="section-bar">Constants</h3>
478
+
479
+ <div class="name-list">
480
+ <table summary="Constants">
481
+ <% values["constants"].each do |constants| %>
482
+ <tr class="top-aligned-row context-row">
483
+ <td class="context-item-name"><%= constants["name"] %></td>
484
+ <td>=</td>
485
+ <td class="context-item-value"><%= constants["value"] %></td>
486
+ <% if values["desc"] then %>
487
+ <td width="3em">&nbsp;</td>
488
+ <td class="context-item-desc"><%= constants["desc"] %></td>
489
+ <% end %>
490
+ </tr>
491
+ <% end # values["constants"] %>
492
+ </table>
493
+ </div>
494
+ </div>
495
+ <% end %>
496
+
497
+ <% if values["aliases"] then %>
498
+ <div id="aliases-list">
499
+ <h3 class="section-bar">External Aliases</h3>
500
+
501
+ <div class="name-list">
502
+ <table summary="aliases">
503
+ <% values["aliases"].each do |aliases| $stderr.puts({ :aliases => aliases }.inspect) %>
504
+ <tr class="top-aligned-row context-row">
505
+ <td class="context-item-name"><%= values["old_name"] %></td>
506
+ <td>-&gt;</td>
507
+ <td class="context-item-value"><%= values["new_name"] %></td>
508
+ </tr>
509
+ <% if values["desc"] then %>
510
+ <tr class="top-aligned-row context-row">
511
+ <td>&nbsp;</td>
512
+ <td colspan="2" class="context-item-desc"><%= values["desc"] %></td>
513
+ </tr>
514
+ <% end %>
515
+ <% end # values["aliases"] %>
516
+ </table>
517
+ </div>
518
+ </div>
519
+ <% end %>
520
+
521
+
522
+ <% if values["attributes"] then %>
523
+ <div id="attribute-list">
524
+ <h3 class="section-bar">Attributes</h3>
525
+
526
+ <div class="name-list">
527
+ <table>
528
+ <% values["attributes"].each do |attributes| $stderr.puts({ :attributes => attributes }.inspect) %>
529
+ <tr class="top-aligned-row context-row">
530
+ <td class="context-item-name"><%= values["name"] %></td>
531
+ <% if values["rw"] then %>
532
+ <td class="context-item-value">&nbsp;[<%= values["rw"] %>]&nbsp;</td>
533
+ <% end %>
534
+ <% unless values["rw"] then %>
535
+ <td class="context-item-value">&nbsp;&nbsp;</td>
536
+ <% end %>
537
+ <td class="context-item-desc"><%= values["a_desc"] %></td>
538
+ </tr>
539
+ <% end # values["attributes"] %>
540
+ </table>
541
+ </div>
542
+ </div>
543
+ <% end %>
544
+
545
+
546
+
547
+ <!-- if method_list -->
548
+ <% if sections["method_list"] then %>
549
+ <div id="methods">
550
+ <% sections["method_list"].each do |method_list| %>
551
+ <% if method_list["methods"] then %>
552
+ <h3 class="section-bar"><%= method_list["type"] %> <%= method_list["category"] %> methods</h3>
553
+
554
+ <% method_list["methods"].each do |methods| %>
555
+ <div id="method-<%= methods["aref"] %>" class="method-detail">
556
+ <a name="<%= methods["aref"] %>"></a>
557
+
558
+ <div class="method-heading">
559
+ <% if methods["codeurl"] then %>
560
+ <a href="<%= methods["codeurl"] %>" target="Code" class="method-signature"
561
+ onclick="popupCode('<%= methods["codeurl"] %>');return false;">
562
+ <% end %>
563
+ <% if methods["sourcecode"] then %>
564
+ <a href="#<%= methods["aref"] %>" class="method-signature">
565
+ <% end %>
566
+ <% if methods["callseq"] then %>
567
+ <span class="method-name"><%= methods["callseq"] %></span>
568
+ <% end %>
569
+ <% unless methods["callseq"] then %>
570
+ <span class="method-name"><%= methods["name"] %></span><span class="method-args"><%= methods["params"] %></span>
571
+ <% end %>
572
+ <% if methods["codeurl"] then %>
573
+ </a>
574
+ <% end %>
575
+ <% if methods["sourcecode"] then %>
576
+ </a>
577
+ <% end %>
578
+ </div>
579
+
580
+ <div class="method-description">
581
+ <% if methods["m_desc"] then %>
582
+ <%= methods["m_desc"] %>
583
+ <% end %>
584
+ <% if methods["sourcecode"] then %>
585
+ <p><a class="source-toggle" href="#"
586
+ onclick="toggleCode('<%= methods["aref"] %>-source');return false;">[Source]</a></p>
587
+ <div class="method-source-code" id="<%= methods["aref"] %>-source">
588
+ <pre>
589
+ <%= methods["sourcecode"] %>
590
+ </pre>
591
+ </div>
592
+ <% end %>
593
+ </div>
594
+ </div>
595
+
596
+ <% end # method_list["methods"] %>
597
+ <% end %>
598
+ <% end # sections["method_list"] %>
599
+
600
+ </div>
601
+ <% end %>
602
+ <% end # values["sections"] %>
603
+ EOF
604
+
605
+ #####################################################################
606
+ ### B O D Y T E M P L A T E
607
+ #####################################################################
608
+
609
+ BODY = HEADER + %{
610
+
611
+ <%= template_include %> <!-- banner header -->
612
+
613
+ <div id="bodyContent">
614
+
615
+ } + METHOD_LIST + %{
616
+
617
+ </div>
618
+
619
+ } + FOOTER
620
+
621
+ #####################################################################
622
+ ### S O U R C E C O D E T E M P L A T E
623
+ #####################################################################
624
+
625
+ SRC_PAGE = XHTML_PREAMBLE + <<-EOF
626
+ <html>
627
+ <head>
628
+ <title><%= values["title"] %></title>
629
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
630
+ <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
631
+ </head>
632
+ <body class="standalone-code">
633
+ <pre><%= values["code"] %></pre>
634
+ </body>
635
+ </html>
636
+ EOF
637
+
638
+
639
+ #####################################################################
640
+ ### I N D E X F I L E T E M P L A T E S
641
+ #####################################################################
642
+
643
+ FR_INDEX_BODY = %{
644
+ <%= template_include %>
645
+ }
646
+
647
+ FILE_INDEX = XHTML_PREAMBLE + <<-EOF
648
+ <!--
649
+
650
+ <%= values["list_title"] %>
651
+
652
+ -->
653
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
654
+ <head>
655
+ <title><%= values["list_title"] %></title>
656
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
657
+ <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" />
658
+ <base target="docwin" />
659
+ </head>
660
+ <body>
661
+ <div id="index">
662
+ <h1 class="section-bar"><%= values["list_title"] %></h1>
663
+ <div id="index-entries">
664
+ <% values["entries"].each do |entries| %>
665
+ <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
666
+ <% end # values["entries"] %>
667
+ </div>
668
+ </div>
669
+ </body>
670
+ </html>
671
+ EOF
672
+
673
+ CLASS_INDEX = FILE_INDEX
674
+ METHOD_INDEX = FILE_INDEX
675
+
676
+ INDEX = <<-EOF
677
+ <?xml version="1.0" encoding="<%= values["charset"] %>"?>
678
+ <!DOCTYPE html
679
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
680
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
681
+
682
+ <!--
683
+
684
+ <%= values["title"] %>
685
+
686
+ -->
687
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
688
+ <head>
689
+ <title><%= values["title"] %></title>
690
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
691
+ </head>
692
+ <frameset rows="20%, 80%">
693
+ <frameset cols="25%,35%,45%">
694
+ <frame src="fr_file_index.html" title="Files" name="Files" />
695
+ <frame src="fr_class_index.html" name="Classes" />
696
+ <frame src="fr_method_index.html" name="Methods" />
697
+ </frameset>
698
+ <frame src="<%= values["initial_page"] %>" name="docwin" />
699
+ </frameset>
700
+ </html>
701
+ EOF
702
+
703
+ end
704
+