rdoc-f95 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +79 -0
  3. data/PostInstall.txt +7 -0
  4. data/README.rdoc +147 -0
  5. data/Rakefile +28 -0
  6. data/bin/rdoc-f95 +70 -0
  7. data/lib/rdoc-f95.rb +306 -0
  8. data/lib/rdoc-f95/code_objects.rb +776 -0
  9. data/lib/rdoc-f95/diagram.rb +342 -0
  10. data/lib/rdoc-f95/dot.rb +249 -0
  11. data/lib/rdoc-f95/generator.rb +1088 -0
  12. data/lib/rdoc-f95/generator/chm.rb +113 -0
  13. data/lib/rdoc-f95/generator/chm/chm.rb +98 -0
  14. data/lib/rdoc-f95/generator/html.rb +370 -0
  15. data/lib/rdoc-f95/generator/html/hefss.rb +414 -0
  16. data/lib/rdoc-f95/generator/html/html.rb +708 -0
  17. data/lib/rdoc-f95/generator/html/kilmer.rb +418 -0
  18. data/lib/rdoc-f95/generator/html/one_page_html.rb +121 -0
  19. data/lib/rdoc-f95/generator/ri.rb +229 -0
  20. data/lib/rdoc-f95/generator/xhtml.rb +106 -0
  21. data/lib/rdoc-f95/generator/xhtml/ctop.xsl +1318 -0
  22. data/lib/rdoc-f95/generator/xhtml/mathml.xsl +42 -0
  23. data/lib/rdoc-f95/generator/xhtml/pmathml.xsl +612 -0
  24. data/lib/rdoc-f95/generator/xhtml/pmathmlcss.xsl +872 -0
  25. data/lib/rdoc-f95/generator/xhtml/xhtml.rb +732 -0
  26. data/lib/rdoc-f95/generator/xml.rb +120 -0
  27. data/lib/rdoc-f95/generator/xml/rdf.rb +113 -0
  28. data/lib/rdoc-f95/generator/xml/xml.rb +111 -0
  29. data/lib/rdoc-f95/install.rb +166 -0
  30. data/lib/rdoc-f95/markup.rb +506 -0
  31. data/lib/rdoc-f95/markup/formatter.rb +14 -0
  32. data/lib/rdoc-f95/markup/fragments.rb +337 -0
  33. data/lib/rdoc-f95/markup/inline.rb +361 -0
  34. data/lib/rdoc-f95/markup/install.rb +57 -0
  35. data/lib/rdoc-f95/markup/lines.rb +152 -0
  36. data/lib/rdoc-f95/markup/mathml_wrapper.rb +91 -0
  37. data/lib/rdoc-f95/markup/preprocess.rb +71 -0
  38. data/lib/rdoc-f95/markup/sample/rdoc2latex.rb +16 -0
  39. data/lib/rdoc-f95/markup/sample/sample.rb +42 -0
  40. data/lib/rdoc-f95/markup/to_flow.rb +185 -0
  41. data/lib/rdoc-f95/markup/to_html.rb +357 -0
  42. data/lib/rdoc-f95/markup/to_html_crossref.rb +123 -0
  43. data/lib/rdoc-f95/markup/to_latex.rb +328 -0
  44. data/lib/rdoc-f95/markup/to_test.rb +50 -0
  45. data/lib/rdoc-f95/markup/to_xhtml_texparser.rb +234 -0
  46. data/lib/rdoc-f95/options.rb +745 -0
  47. data/lib/rdoc-f95/parsers/parse_c.rb +775 -0
  48. data/lib/rdoc-f95/parsers/parse_f95.rb +2499 -0
  49. data/lib/rdoc-f95/parsers/parse_rb.rb +2587 -0
  50. data/lib/rdoc-f95/parsers/parse_simple.rb +39 -0
  51. data/lib/rdoc-f95/parsers/parserfactory.rb +99 -0
  52. data/lib/rdoc-f95/ri.rb +2 -0
  53. data/lib/rdoc-f95/ri/cache.rb +188 -0
  54. data/lib/rdoc-f95/ri/descriptions.rb +147 -0
  55. data/lib/rdoc-f95/ri/display.rb +244 -0
  56. data/lib/rdoc-f95/ri/driver.rb +435 -0
  57. data/lib/rdoc-f95/ri/formatter.rb +603 -0
  58. data/lib/rdoc-f95/ri/paths.rb +105 -0
  59. data/lib/rdoc-f95/ri/reader.rb +106 -0
  60. data/lib/rdoc-f95/ri/util.rb +81 -0
  61. data/lib/rdoc-f95/ri/writer.rb +64 -0
  62. data/lib/rdoc-f95/stats.rb +23 -0
  63. data/lib/rdoc-f95/template.rb +64 -0
  64. data/lib/rdoc-f95/tokenstream.rb +33 -0
  65. data/lib/rdoc-f95/usage.rb +210 -0
  66. data/script/console +10 -0
  67. data/script/destroy +14 -0
  68. data/script/generate +14 -0
  69. data/test/test_helper.rb +3 -0
  70. data/test/test_rdoc-f95.rb +11 -0
  71. metadata +156 -0
@@ -0,0 +1,414 @@
1
+ require 'rdoc-f95/generator/html'
2
+ require 'rdoc-f95/generator/html/html'
3
+
4
+ module RDocF95::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,708 @@
1
+ require 'rdoc-f95/generator/html'
2
+ require 'rdoc-f95/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 RDocF95::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: scroll;
219
+ }
220
+
221
+ div.method-source-code pre {
222
+ color: #ffdead;
223
+ overflow: visible;
224
+ }
225
+
226
+
227
+ /* --- Ruby keyword styles --------------------- */
228
+
229
+ .standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
230
+
231
+ .ruby-constant { color: #7fffd4; background: transparent; }
232
+ .ruby-keyword { color: #00ffff; background: transparent; }
233
+ .ruby-ivar { color: #eedd82; background: transparent; }
234
+ .ruby-operator { color: #00ffee; background: transparent; }
235
+ .ruby-identifier { color: #ffdead; background: transparent; }
236
+ .ruby-node { color: #ffa07a; background: transparent; }
237
+ .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
238
+ .ruby-regexp { color: #ffa07a; background: transparent; }
239
+ .ruby-value { color: #7fffd4; background: transparent; }
240
+ EOF
241
+
242
+
243
+ #####################################################################
244
+ ### H E A D E R T E M P L A T E
245
+ #####################################################################
246
+
247
+ XHTML_PREAMBLE = <<-EOF
248
+ <?xml version="1.0" encoding="<%= values["charset"] %>"?>
249
+ <!DOCTYPE html
250
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
251
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
252
+ EOF
253
+
254
+ HEADER = XHTML_PREAMBLE + <<-EOF
255
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
256
+ <head>
257
+ <title><%= values["title"] %></title>
258
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
259
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
260
+ <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
261
+ <script type="text/javascript">
262
+ // <![CDATA[
263
+
264
+ function popupCode( url ) {
265
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
266
+ }
267
+
268
+ function toggleCode( id ) {
269
+ if ( document.getElementById )
270
+ elem = document.getElementById( id );
271
+ else if ( document.all )
272
+ elem = eval( "document.all." + id );
273
+ else
274
+ return false;
275
+
276
+ elemStyle = elem.style;
277
+
278
+ if ( elemStyle.display != "block" ) {
279
+ elemStyle.display = "block"
280
+ } else {
281
+ elemStyle.display = "none"
282
+ }
283
+
284
+ return true;
285
+ }
286
+
287
+ // Make codeblocks hidden by default
288
+ document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }</style>" )
289
+
290
+ // ]]>
291
+ </script>
292
+
293
+ </head>
294
+ <body>
295
+ EOF
296
+
297
+ #####################################################################
298
+ ### C O N T E X T C O N T E N T T E M P L A T E
299
+ #####################################################################
300
+
301
+ CONTEXT_CONTENT = %{
302
+ }
303
+
304
+ #####################################################################
305
+ ### F O O T E R T E M P L A T E
306
+ #####################################################################
307
+
308
+ FOOTER = <<-EOF
309
+ <div id="validator-badges">
310
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
311
+ </div>
312
+
313
+ </body>
314
+ </html>
315
+ EOF
316
+
317
+
318
+ #####################################################################
319
+ ### F I L E P A G E H E A D E R T E M P L A T E
320
+ #####################################################################
321
+
322
+ FILE_PAGE = <<-EOF
323
+ <div id="fileHeader">
324
+ <h1><%= values["short_name"] %></h1>
325
+ <table class="header-table">
326
+ <tr class="top-aligned-row">
327
+ <td><strong>Path:</strong></td>
328
+ <td><%= values["full_path"] %>
329
+ <% if values["cvsurl"] then %>
330
+ &nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
331
+ <% end %>
332
+ </td>
333
+ </tr>
334
+ <tr class="top-aligned-row">
335
+ <td><strong>Last Update:</strong></td>
336
+ <td><%= values["dtm_modified"] %></td>
337
+ </tr>
338
+ </table>
339
+ </div>
340
+ EOF
341
+
342
+ #####################################################################
343
+ ### C L A S S P A G E H E A D E R T E M P L A T E
344
+ #####################################################################
345
+
346
+ CLASS_PAGE = <<-EOF
347
+ <div id="classHeader">
348
+ <table class="header-table">
349
+ <tr class="top-aligned-row">
350
+ <td><strong><%= values["classmod"] %></strong></td>
351
+ <td class="class-name-in-header"><%= values["full_name"] %></td>
352
+ </tr>
353
+ <tr class="top-aligned-row">
354
+ <td><strong>In:</strong></td>
355
+ <td>
356
+ <% values["infiles"].each do |infiles| %>
357
+ <% if infiles["full_path_url"] then %>
358
+ <a href="<%= infiles["full_path_url"] %>">
359
+ <% end %>
360
+ <%= infiles["full_path"] %>
361
+ <% if infiles["full_path_url"] then %>
362
+ </a>
363
+ <% end %>
364
+ <% if infiles["cvsurl"] then %>
365
+ &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
366
+ <% end %>
367
+ <br />
368
+ <% end # values["infiles"] %>
369
+ </td>
370
+ </tr>
371
+
372
+ <% if values["parent"] then %>
373
+ <tr class="top-aligned-row">
374
+ <td><strong>Parent:</strong></td>
375
+ <td>
376
+ <% if values["par_url"] then %>
377
+ <a href="<%= values["par_url"] %>">
378
+ <% end %>
379
+ <%= values["parent"] %>
380
+ <% if values["par_url"] then %>
381
+ </a>
382
+ <% end %>
383
+ </td>
384
+ </tr>
385
+ <% end %>
386
+ </table>
387
+ </div>
388
+ EOF
389
+
390
+ #####################################################################
391
+ ### M E T H O D L I S T T E M P L A T E
392
+ #####################################################################
393
+
394
+ METHOD_LIST = <<-EOF
395
+
396
+ <div id="contextContent">
397
+ <% if values["diagram"] then %>
398
+ <div id="diagram">
399
+ <%= values["diagram"] %>
400
+ </div>
401
+ <% end %>
402
+
403
+ <% if values["description"] then %>
404
+ <div id="description">
405
+ <%= values["description"] %>
406
+ </div>
407
+ <% end %>
408
+
409
+ <% if values["requires"] then %>
410
+ <div id="requires-list">
411
+ <h3 class="section-bar">Required files</h3>
412
+
413
+ <div class="name-list">
414
+ <% values["requires"].each do |requires| %>
415
+ <%= href requires["aref"], requires["name"] %>&nbsp;&nbsp;
416
+ <% end # values["requires"] %>
417
+ </div>
418
+ </div>
419
+ <% end %>
420
+
421
+ <% if values["toc"] then %>
422
+ <div id="contents-list">
423
+ <h3 class="section-bar">Contents</h3>
424
+ <ul>
425
+ <% values["toc"].each do |toc| %>
426
+ <li><a href="#<%= values["href"] %>"><%= values["secname"] %></a></li>
427
+ <% end # values["toc"] %>
428
+ </ul>
429
+ <% end %>
430
+ </div>
431
+
432
+ <% if values["methods"] then %>
433
+ <div id="method-list">
434
+ <h3 class="section-bar">Methods</h3>
435
+
436
+ <div class="name-list">
437
+ <% values["methods"].each do |methods| %>
438
+ <%= href methods["aref"], methods["name"] %>&nbsp;&nbsp;
439
+ <% end # values["methods"] %>
440
+ </div>
441
+ </div>
442
+ <% end %>
443
+
444
+ </div>
445
+
446
+
447
+ <!-- if includes -->
448
+ <% if values["includes"] then %>
449
+ <div id="includes">
450
+ <h3 class="section-bar">Included Modules</h3>
451
+
452
+ <div id="includes-list">
453
+ <% values["includes"].each do |includes| %>
454
+ <span class="include-name"><%= href includes["aref"], includes["name"] %></span>
455
+ <% end # values["includes"] %>
456
+ </div>
457
+ </div>
458
+ <% end %>
459
+
460
+ <% values["sections"].each do |sections| %>
461
+ <div id="section">
462
+ <% if sections["sectitle"] then %>
463
+ <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
464
+ <% if sections["seccomment"] then %>
465
+ <div class="section-comment">
466
+ <%= sections["seccomment"] %>
467
+ </div>
468
+ <% end %>
469
+ <% end %>
470
+
471
+ <% if values["classlist"] then %>
472
+ <div id="class-list">
473
+ <h3 class="section-bar">Classes and Modules</h3>
474
+
475
+ <%= values["classlist"] %>
476
+ </div>
477
+ <% end %>
478
+
479
+ <% if values["constants"] then %>
480
+ <div id="constants-list">
481
+ <h3 class="section-bar">Constants</h3>
482
+
483
+ <div class="name-list">
484
+ <table summary="Constants">
485
+ <% values["constants"].each do |constants| %>
486
+ <tr class="top-aligned-row context-row">
487
+ <td class="context-item-name"><%= constants["name"] %></td>
488
+ <td>=</td>
489
+ <td class="context-item-value"><%= constants["value"] %></td>
490
+ <% if values["desc"] then %>
491
+ <td width="3em">&nbsp;</td>
492
+ <td class="context-item-desc"><%= constants["desc"] %></td>
493
+ <% end %>
494
+ </tr>
495
+ <% end # values["constants"] %>
496
+ </table>
497
+ </div>
498
+ </div>
499
+ <% end %>
500
+
501
+ <% if values["aliases"] then %>
502
+ <div id="aliases-list">
503
+ <h3 class="section-bar">External Aliases</h3>
504
+
505
+ <div class="name-list">
506
+ <table summary="aliases">
507
+ <% values["aliases"].each do |aliases| $stderr.puts({ :aliases => aliases }.inspect) %>
508
+ <tr class="top-aligned-row context-row">
509
+ <td class="context-item-name"><%= values["old_name"] %></td>
510
+ <td>-&gt;</td>
511
+ <td class="context-item-value"><%= values["new_name"] %></td>
512
+ </tr>
513
+ <% if values["desc"] then %>
514
+ <tr class="top-aligned-row context-row">
515
+ <td>&nbsp;</td>
516
+ <td colspan="2" class="context-item-desc"><%= values["desc"] %></td>
517
+ </tr>
518
+ <% end %>
519
+ <% end # values["aliases"] %>
520
+ </table>
521
+ </div>
522
+ </div>
523
+ <% end %>
524
+
525
+
526
+ <% if values["attributes"] then %>
527
+ <div id="attribute-list">
528
+ <h3 class="section-bar">Attributes</h3>
529
+
530
+ <div class="name-list">
531
+ <table>
532
+ <% values["attributes"].each do |attributes| $stderr.puts({ :attributes => attributes }.inspect) %>
533
+ <tr class="top-aligned-row context-row">
534
+ <td class="context-item-name"><%= values["name"] %></td>
535
+ <% if values["rw"] then %>
536
+ <td class="context-item-value">&nbsp;[<%= values["rw"] %>]&nbsp;</td>
537
+ <% end %>
538
+ <% unless values["rw"] then %>
539
+ <td class="context-item-value">&nbsp;&nbsp;</td>
540
+ <% end %>
541
+ <td class="context-item-desc"><%= values["a_desc"] %></td>
542
+ </tr>
543
+ <% end # values["attributes"] %>
544
+ </table>
545
+ </div>
546
+ </div>
547
+ <% end %>
548
+
549
+
550
+
551
+ <!-- if method_list -->
552
+ <% if sections["method_list"] then %>
553
+ <div id="methods">
554
+ <% sections["method_list"].each do |method_list| %>
555
+ <% if method_list["methods"] then %>
556
+ <h3 class="section-bar"><%= method_list["type"] %> <%= method_list["category"] %> methods</h3>
557
+
558
+ <% method_list["methods"].each do |methods| %>
559
+ <div id="method-<%= methods["aref"] %>" class="method-detail">
560
+ <a name="<%= methods["aref"] %>"></a>
561
+
562
+ <div class="method-heading">
563
+ <% if methods["codeurl"] then %>
564
+ <a href="<%= methods["codeurl"] %>" target="Code" class="method-signature"
565
+ onclick="popupCode('<%= methods["codeurl"] %>');return false;">
566
+ <% end %>
567
+ <% if methods["sourcecode"] then %>
568
+ <a href="#<%= methods["aref"] %>" class="method-signature">
569
+ <% end %>
570
+ <% if methods["callseq"] then %>
571
+ <span class="method-name"><%= methods["callseq"] %></span>
572
+ <% end %>
573
+ <% unless methods["callseq"] then %>
574
+ <span class="method-name"><%= methods["name"] %></span><span class="method-args"><%= methods["params"] %></span>
575
+ <% end %>
576
+ <% if methods["codeurl"] then %>
577
+ </a>
578
+ <% end %>
579
+ <% if methods["sourcecode"] then %>
580
+ </a>
581
+ <% end %>
582
+ </div>
583
+
584
+ <div class="method-description">
585
+ <% if methods["m_desc"] then %>
586
+ <%= methods["m_desc"] %>
587
+ <% end %>
588
+ <% if methods["sourcecode"] then %>
589
+ <p><a class="source-toggle" href="#"
590
+ onclick="toggleCode('<%= methods["aref"] %>-source');return false;">[Source]</a></p>
591
+ <div class="method-source-code" id="<%= methods["aref"] %>-source">
592
+ <pre>
593
+ <%= methods["sourcecode"] %>
594
+ </pre>
595
+ </div>
596
+ <% end %>
597
+ </div>
598
+ </div>
599
+
600
+ <% end # method_list["methods"] %>
601
+ <% end %>
602
+ <% end # sections["method_list"] %>
603
+
604
+ </div>
605
+ <% end %>
606
+ <% end # values["sections"] %>
607
+ EOF
608
+
609
+ #####################################################################
610
+ ### B O D Y T E M P L A T E
611
+ #####################################################################
612
+
613
+ BODY = HEADER + %{
614
+
615
+ <%= template_include %> <!-- banner header -->
616
+
617
+ <div id="bodyContent">
618
+
619
+ } + METHOD_LIST + %{
620
+
621
+ </div>
622
+
623
+ } + FOOTER
624
+
625
+ #####################################################################
626
+ ### S O U R C E C O D E T E M P L A T E
627
+ #####################################################################
628
+
629
+ SRC_PAGE = XHTML_PREAMBLE + <<-EOF
630
+ <html>
631
+ <head>
632
+ <title><%= values["title"] %></title>
633
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
634
+ <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
635
+ </head>
636
+ <body class="standalone-code">
637
+ <pre><%= values["code"] %></pre>
638
+ </body>
639
+ </html>
640
+ EOF
641
+
642
+
643
+ #####################################################################
644
+ ### I N D E X F I L E T E M P L A T E S
645
+ #####################################################################
646
+
647
+ FR_INDEX_BODY = %{
648
+ <%= template_include %>
649
+ }
650
+
651
+ FILE_INDEX = XHTML_PREAMBLE + <<-EOF
652
+ <!--
653
+
654
+ <%= values["list_title"] %>
655
+
656
+ -->
657
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
658
+ <head>
659
+ <title><%= values["list_title"] %></title>
660
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
661
+ <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" />
662
+ <base target="docwin" />
663
+ </head>
664
+ <body>
665
+ <div id="index">
666
+ <h1 class="section-bar"><%= values["list_title"] %></h1>
667
+ <div id="index-entries">
668
+ <% values["entries"].each do |entries| %>
669
+ <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
670
+ <% end # values["entries"] %>
671
+ </div>
672
+ </div>
673
+ </body>
674
+ </html>
675
+ EOF
676
+
677
+ CLASS_INDEX = FILE_INDEX
678
+ METHOD_INDEX = FILE_INDEX
679
+
680
+ INDEX = <<-EOF
681
+ <?xml version="1.0" encoding="<%= values["charset"] %>"?>
682
+ <!DOCTYPE html
683
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
684
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
685
+
686
+ <!--
687
+
688
+ <%= values["title"] %>
689
+
690
+ -->
691
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
692
+ <head>
693
+ <title><%= values["title"] %></title>
694
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
695
+ </head>
696
+ <frameset rows="20%, 80%">
697
+ <frameset cols="25%,35%,45%">
698
+ <frame src="fr_file_index.html" title="Files" name="Files" />
699
+ <frame src="fr_class_index.html" name="Classes" />
700
+ <frame src="fr_method_index.html" name="Methods" />
701
+ </frameset>
702
+ <frame src="<%= values["initial_page"] %>" name="docwin" />
703
+ </frameset>
704
+ </html>
705
+ EOF
706
+
707
+ end
708
+