rdoc 2.0.0 → 2.1.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 (52) hide show
  1. data.tar.gz.sig +1 -0
  2. data/History.txt +30 -0
  3. data/Manifest.txt +18 -6
  4. data/Rakefile +52 -0
  5. data/lib/rdoc.rb +69 -69
  6. data/lib/rdoc/code_objects.rb +331 -112
  7. data/lib/rdoc/generator.rb +172 -144
  8. data/lib/rdoc/generator/html.rb +45 -18
  9. data/lib/rdoc/generator/html/frameless.rb +795 -0
  10. data/lib/rdoc/generator/html/hefss.rb +11 -11
  11. data/lib/rdoc/generator/html/html.rb +81 -87
  12. data/lib/rdoc/generator/html/kilmer.rb +10 -10
  13. data/lib/rdoc/generator/html/one_page_html.rb +9 -9
  14. data/lib/rdoc/generator/ri.rb +5 -8
  15. data/lib/rdoc/generator/texinfo.rb +84 -0
  16. data/lib/rdoc/generator/texinfo/class.texinfo.erb +44 -0
  17. data/lib/rdoc/generator/texinfo/file.texinfo.erb +6 -0
  18. data/lib/rdoc/generator/texinfo/method.texinfo.erb +6 -0
  19. data/lib/rdoc/generator/texinfo/texinfo.erb +28 -0
  20. data/lib/rdoc/known_classes.rb +69 -0
  21. data/lib/rdoc/markup.rb +3 -3
  22. data/lib/rdoc/markup/attribute_manager.rb +0 -9
  23. data/lib/rdoc/markup/fragments.rb +1 -1
  24. data/lib/rdoc/markup/preprocess.rb +10 -6
  25. data/lib/rdoc/markup/to_html.rb +55 -8
  26. data/lib/rdoc/markup/to_html_crossref.rb +21 -5
  27. data/lib/rdoc/markup/to_texinfo.rb +69 -0
  28. data/lib/rdoc/options.rb +37 -14
  29. data/lib/rdoc/parser.rb +109 -0
  30. data/lib/rdoc/parser/c.rb +656 -0
  31. data/lib/rdoc/parser/f95.rb +1835 -0
  32. data/lib/rdoc/{parsers/parse_rb.rb → parser/ruby.rb} +1436 -1191
  33. data/lib/rdoc/parser/simple.rb +38 -0
  34. data/lib/rdoc/rdoc.rb +48 -32
  35. data/lib/rdoc/ri.rb +5 -1
  36. data/lib/rdoc/ri/descriptions.rb +8 -5
  37. data/lib/rdoc/ri/driver.rb +148 -49
  38. data/lib/rdoc/stats.rb +94 -4
  39. data/test/test_rdoc_info_formatting.rb +175 -0
  40. data/test/test_rdoc_info_sections.rb +136 -0
  41. data/test/test_rdoc_markup_to_html.rb +30 -0
  42. data/test/test_rdoc_markup_to_html_crossref.rb +18 -0
  43. data/test/{test_rdoc_c_parser.rb → test_rdoc_parser_c.rb} +8 -11
  44. data/test/test_rdoc_parser_ruby.rb +539 -0
  45. data/test/test_rdoc_ri_default_display.rb +17 -16
  46. data/test/test_rdoc_ri_driver.rb +92 -0
  47. metadata +54 -12
  48. metadata.gz.sig +0 -0
  49. data/lib/rdoc/parsers/parse_c.rb +0 -775
  50. data/lib/rdoc/parsers/parse_f95.rb +0 -1841
  51. data/lib/rdoc/parsers/parse_simple.rb +0 -40
  52. data/lib/rdoc/parsers/parserfactory.rb +0 -99
@@ -141,7 +141,7 @@ td { font-family: Verdana, Arial, Helvetica, sans-serif;
141
141
  <div class="name-list">
142
142
  <% values["requires"].each do |requires| %>
143
143
  <%= href requires["aref"], requires["name"] %>
144
- <% end # values["requires"] %>
144
+ <% end %><%# values["requires"] %>
145
145
  <% end %>
146
146
  </div>
147
147
 
@@ -156,10 +156,10 @@ td { font-family: Verdana, Arial, Helvetica, sans-serif;
156
156
  <div class="name-list">
157
157
  <% method_list["methods"].each do |methods| %>
158
158
  <a href="<%= methods["codeurl"] %>" target="source"><%= methods["name"] %></a>
159
- <% end # values["methods"] %>
159
+ <% end %><%# values["methods"] %>
160
160
  </div>
161
161
  <% end %>
162
- <% end # values["method_list"] %>
162
+ <% end %><%# values["method_list"] %>
163
163
  <% end %>
164
164
 
165
165
  <% if sections["attributes"] then %>
@@ -178,10 +178,10 @@ td { font-family: Verdana, Arial, Helvetica, sans-serif;
178
178
  <td class="attr-name"><%= attributes["name"] %></td>
179
179
  <td><%= attributes["a_desc"] %></td>
180
180
  </tr>
181
- <% end # values["attributes"] %>
181
+ <% end %><%# values["attributes"] %>
182
182
  </table>
183
183
  <% end %>
184
- <% end # values["sections"] %>
184
+ <% end %><%# values["sections"] %>
185
185
  <% end %>
186
186
 
187
187
  <% if values["classlist"] then %>
@@ -237,7 +237,7 @@ td { font-family: Verdana, Arial, Helvetica, sans-serif;
237
237
  <% if infiles["cvsurl"] then %>
238
238
  &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
239
239
  <% end %>
240
- <% end # values["infiles"] %>
240
+ <% end %><%# values["infiles"] %>
241
241
  </td>
242
242
  </tr>
243
243
  <% if values["parent"] then %>
@@ -266,7 +266,7 @@ td { font-family: Verdana, Arial, Helvetica, sans-serif;
266
266
  <div class="name-list">
267
267
  <% values["includes"].each do |includes| %>
268
268
  <span class="method-name"><%= href includes["aref"], includes["name"] %></span>
269
- <% end # values["includes"] %>
269
+ <% end %><%# values["includes"] %>
270
270
  </div>
271
271
  <% end %>
272
272
 
@@ -293,11 +293,11 @@ td { font-family: Verdana, Arial, Helvetica, sans-serif;
293
293
  <%= method_list["m_desc"] %>
294
294
  </div>
295
295
  <% end %>
296
- <% end # method_list["methods"] %>
296
+ <% end %><%# method_list["methods"] %>
297
297
  <% end %>
298
- <% end # sections["method_list"] %>
298
+ <% end %><%# sections["method_list"] %>
299
299
  <% end %>
300
- <% end # values["sections"] %>
300
+ <% end %><%# values["sections"] %>
301
301
  <% end %>
302
302
  EOF
303
303
 
@@ -365,7 +365,7 @@ div.banner {
365
365
  <div class="banner"><%= values["list_title"] %></div>
366
366
  <% values["entries"].each do |entries| %>
367
367
  <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
368
- <% end # values["entries"] %>
368
+ <% end %><%# values["entries"] %>
369
369
  </body></html>
370
370
  EOF
371
371
 
@@ -7,8 +7,8 @@ require 'rdoc/generator/html/one_page_html'
7
7
  # This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
8
8
  # bit more of the appearance of the output to cascading stylesheets than the
9
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.
10
+ # toggle the visibility of each method's source with each click on the
11
+ # '[source]' link.
12
12
  #
13
13
  # == Authors
14
14
  #
@@ -16,10 +16,10 @@ require 'rdoc/generator/html/one_page_html'
16
16
  #
17
17
  # Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
18
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.
19
+ # This work is licensed under the Creative Commons Attribution License. To
20
+ # view a copy of this license, visit
21
+ # http://creativecommons.org/licenses/by/1.0/ or send a letter to Creative
22
+ # Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
23
23
 
24
24
  module RDoc::Generator::HTML::HTML
25
25
 
@@ -361,7 +361,7 @@ EOF
361
361
  &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
362
362
  <% end %>
363
363
  <br />
364
- <% end # values["infiles"] %>
364
+ <% end %><%# values["infiles"] %>
365
365
  </td>
366
366
  </tr>
367
367
 
@@ -388,39 +388,38 @@ EOF
388
388
  #####################################################################
389
389
 
390
390
  METHOD_LIST = <<-EOF
391
-
392
391
  <div id="contextContent">
393
392
  <% if values["diagram"] then %>
394
393
  <div id="diagram">
395
394
  <%= values["diagram"] %>
396
395
  </div>
397
- <% end %>
396
+ <% end
398
397
 
399
- <% if values["description"] then %>
398
+ if values["description"] then %>
400
399
  <div id="description">
401
400
  <%= values["description"] %>
402
401
  </div>
403
- <% end %>
402
+ <% end
404
403
 
405
- <% if values["requires"] then %>
404
+ if values["requires"] then %>
406
405
  <div id="requires-list">
407
406
  <h3 class="section-bar">Required files</h3>
408
407
 
409
408
  <div class="name-list">
410
409
  <% values["requires"].each do |requires| %>
411
410
  <%= href requires["aref"], requires["name"] %>&nbsp;&nbsp;
412
- <% end # values["requires"] %>
411
+ <% end %><%# values["requires"] %>
413
412
  </div>
414
413
  </div>
415
- <% end %>
414
+ <% end
416
415
 
417
- <% if values["toc"] then %>
416
+ if values["toc"] then %>
418
417
  <div id="contents-list">
419
418
  <h3 class="section-bar">Contents</h3>
420
419
  <ul>
421
420
  <% values["toc"].each do |toc| %>
422
- <li><a href="#<%= values["href"] %>"><%= values["secname"] %></a></li>
423
- <% end # values["toc"] %>
421
+ <li><a href="#<%= toc["href"] %>"><%= toc["secname"] %></a></li>
422
+ <% end %><%# values["toc"] %>
424
423
  </ul>
425
424
  <% end %>
426
425
  </div>
@@ -430,16 +429,14 @@ EOF
430
429
  <h3 class="section-bar">Methods</h3>
431
430
 
432
431
  <div class="name-list">
433
- <% values["methods"].each do |methods| %>
432
+ <% values["methods"].each do |methods| %>
434
433
  <%= href methods["aref"], methods["name"] %>&nbsp;&nbsp;
435
- <% end # values["methods"] %>
434
+ <% end %><%# values["methods"] %>
436
435
  </div>
437
436
  </div>
438
437
  <% end %>
439
-
440
438
  </div>
441
439
 
442
-
443
440
  <!-- if includes -->
444
441
  <% if values["includes"] then %>
445
442
  <div id="includes">
@@ -448,140 +445,137 @@ EOF
448
445
  <div id="includes-list">
449
446
  <% values["includes"].each do |includes| %>
450
447
  <span class="include-name"><%= href includes["aref"], includes["name"] %></span>
451
- <% end # values["includes"] %>
448
+ <% end %><%# values["includes"] %>
452
449
  </div>
453
450
  </div>
454
- <% end %>
451
+ <% end
455
452
 
456
- <% values["sections"].each do |sections| %>
453
+ values["sections"].each do |sections| %>
457
454
  <div id="section">
458
- <% if sections["sectitle"] then %>
455
+ <% if sections["sectitle"] then %>
459
456
  <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
460
- <% if sections["seccomment"] then %>
457
+ <% if sections["seccomment"] then %>
461
458
  <div class="section-comment">
462
459
  <%= sections["seccomment"] %>
463
460
  </div>
464
- <% end %>
465
- <% end %>
461
+ <% end
462
+ end
466
463
 
467
- <% if values["classlist"] then %>
464
+ if sections["classlist"] then %>
468
465
  <div id="class-list">
469
466
  <h3 class="section-bar">Classes and Modules</h3>
470
467
 
471
- <%= values["classlist"] %>
468
+ <%= sections["classlist"] %>
472
469
  </div>
473
- <% end %>
470
+ <% end
474
471
 
475
- <% if values["constants"] then %>
472
+ if sections["constants"] then %>
476
473
  <div id="constants-list">
477
474
  <h3 class="section-bar">Constants</h3>
478
475
 
479
476
  <div class="name-list">
480
477
  <table summary="Constants">
481
- <% values["constants"].each do |constants| %>
478
+ <% sections["constants"].each do |constants| %>
482
479
  <tr class="top-aligned-row context-row">
483
480
  <td class="context-item-name"><%= constants["name"] %></td>
484
481
  <td>=</td>
485
482
  <td class="context-item-value"><%= constants["value"] %></td>
486
- <% if values["desc"] then %>
483
+ <% if sections["desc"] then %>
487
484
  <td width="3em">&nbsp;</td>
488
485
  <td class="context-item-desc"><%= constants["desc"] %></td>
489
- <% end %>
486
+ <% end %>
490
487
  </tr>
491
- <% end # values["constants"] %>
488
+ <% end %><%# sections["constants"] %>
492
489
  </table>
493
490
  </div>
494
491
  </div>
495
- <% end %>
492
+ <% end
496
493
 
497
- <% if values["aliases"] then %>
494
+ if sections["aliases"] then %>
498
495
  <div id="aliases-list">
499
496
  <h3 class="section-bar">External Aliases</h3>
500
497
 
501
498
  <div class="name-list">
502
- <table summary="aliases">
503
- <% values["aliases"].each do |aliases| $stderr.puts({ :aliases => aliases }.inspect) %>
499
+ <table summary="aliases">
500
+ <% sections["aliases"].each do |aliases| %>
504
501
  <tr class="top-aligned-row context-row">
505
- <td class="context-item-name"><%= values["old_name"] %></td>
502
+ <td class="context-item-name"><%= aliases["old_name"] %></td>
506
503
  <td>-&gt;</td>
507
- <td class="context-item-value"><%= values["new_name"] %></td>
504
+ <td class="context-item-value"><%= aliases["new_name"] %></td>
508
505
  </tr>
509
- <% if values["desc"] then %>
506
+ <% if aliases["desc"] then %>
510
507
  <tr class="top-aligned-row context-row">
511
508
  <td>&nbsp;</td>
512
- <td colspan="2" class="context-item-desc"><%= values["desc"] %></td>
509
+ <td colspan="2" class="context-item-desc"><%= aliases["desc"] %></td>
513
510
  </tr>
514
- <% end %>
515
- <% end # values["aliases"] %>
511
+ <% end
512
+ end %><%# sections["aliases"] %>
516
513
  </table>
517
514
  </div>
518
515
  </div>
519
- <% end %>
520
-
516
+ <% end %>
521
517
 
522
- <% if values["attributes"] then %>
518
+ <% if sections["attributes"] then %>
523
519
  <div id="attribute-list">
524
520
  <h3 class="section-bar">Attributes</h3>
525
521
 
526
522
  <div class="name-list">
527
523
  <table>
528
- <% values["attributes"].each do |attributes| $stderr.puts({ :attributes => attributes }.inspect) %>
524
+ <% sections["attributes"].each do |attribute| %>
529
525
  <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 %>
526
+ <td class="context-item-name"><%= attribute["name"] %></td>
527
+ <% if attribute["rw"] then %>
528
+ <td class="context-item-value">&nbsp;[<%= attribute["rw"] %>]&nbsp;</td>
529
+ <% end
530
+ unless attribute["rw"] then %>
535
531
  <td class="context-item-value">&nbsp;&nbsp;</td>
536
- <% end %>
537
- <td class="context-item-desc"><%= values["a_desc"] %></td>
532
+ <% end %>
533
+ <td class="context-item-desc"><%= attribute["a_desc"] %></td>
538
534
  </tr>
539
- <% end # values["attributes"] %>
535
+ <% end %><%# sections["attributes"] %>
540
536
  </table>
541
537
  </div>
542
538
  </div>
543
- <% end %>
544
-
545
-
539
+ <% end %>
546
540
 
547
541
  <!-- if method_list -->
548
- <% if sections["method_list"] then %>
542
+ <% if sections["method_list"] then %>
549
543
  <div id="methods">
550
- <% sections["method_list"].each do |method_list| %>
551
- <% if method_list["methods"] then %>
544
+ <% sections["method_list"].each do |method_list|
545
+ if method_list["methods"] then %>
552
546
  <h3 class="section-bar"><%= method_list["type"] %> <%= method_list["category"] %> methods</h3>
553
547
 
554
- <% method_list["methods"].each do |methods| %>
548
+ <% method_list["methods"].each do |methods| %>
555
549
  <div id="method-<%= methods["aref"] %>" class="method-detail">
556
550
  <a name="<%= methods["aref"] %>"></a>
557
551
 
558
552
  <div class="method-heading">
559
- <% if methods["codeurl"] then %>
553
+ <% if methods["codeurl"] then %>
560
554
  <a href="<%= methods["codeurl"] %>" target="Code" class="method-signature"
561
555
  onclick="popupCode('<%= methods["codeurl"] %>');return false;">
562
- <% end %>
563
- <% if methods["sourcecode"] then %>
556
+ <% end
557
+ if methods["sourcecode"] then %>
564
558
  <a href="#<%= methods["aref"] %>" class="method-signature">
565
- <% end %>
566
- <% if methods["callseq"] then %>
559
+ <% end
560
+ if methods["callseq"] then %>
567
561
  <span class="method-name"><%= methods["callseq"] %></span>
568
- <% end %>
569
- <% unless methods["callseq"] then %>
562
+ <% end
563
+ unless methods["callseq"] then %>
570
564
  <span class="method-name"><%= methods["name"] %></span><span class="method-args"><%= methods["params"] %></span>
571
- <% end %>
572
- <% if methods["codeurl"] then %>
565
+ <% end
566
+ if methods["codeurl"] then %>
573
567
  </a>
574
- <% end %>
575
- <% if methods["sourcecode"] then %>
568
+ <% end
569
+ if methods["sourcecode"] then %>
576
570
  </a>
577
- <% end %>
571
+ <% end %>
578
572
  </div>
579
573
 
580
574
  <div class="method-description">
581
- <% if methods["m_desc"] then %>
575
+ <% if methods["m_desc"] then %>
582
576
  <%= methods["m_desc"] %>
583
- <% end %>
584
- <% if methods["sourcecode"] then %>
577
+ <% end
578
+ if methods["sourcecode"] then %>
585
579
  <p><a class="source-toggle" href="#"
586
580
  onclick="toggleCode('<%= methods["aref"] %>-source');return false;">[Source]</a></p>
587
581
  <div class="method-source-code" id="<%= methods["aref"] %>-source">
@@ -589,17 +583,17 @@ EOF
589
583
  <%= methods["sourcecode"] %>
590
584
  </pre>
591
585
  </div>
592
- <% end %>
586
+ <% end %>
593
587
  </div>
594
588
  </div>
595
589
 
596
- <% end # method_list["methods"] %>
597
- <% end %>
598
- <% end # sections["method_list"] %>
590
+ <% end %><%# method_list["methods"] %><%
591
+ end
592
+ end %><%# sections["method_list"] %>
599
593
 
600
594
  </div>
601
- <% end %>
602
- <% end # values["sections"] %>
595
+ <% end %>
596
+ <% end %><%# values["sections"] %>
603
597
  EOF
604
598
 
605
599
  #####################################################################
@@ -663,7 +657,7 @@ EOF
663
657
  <div id="index-entries">
664
658
  <% values["entries"].each do |entries| %>
665
659
  <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
666
- <% end # values["entries"] %>
660
+ <% end %><%# values["entries"] %>
667
661
  </div>
668
662
  </div>
669
663
  </body>
@@ -119,7 +119,7 @@ body,td,p { font-family: <%= values["fonts"] %>;
119
119
  <div class="name-list">
120
120
  <% values["requires"].each do |requires| %>
121
121
  <%= href requires["aref"], requires["name"] %>
122
- <% end # values["requires"] %>
122
+ <% end %><%# values["requires"] %>
123
123
  <% end %>
124
124
  </div>
125
125
 
@@ -130,7 +130,7 @@ body,td,p { font-family: <%= values["fonts"] %>;
130
130
  <div class="name-list">
131
131
  <% values["methods"].each do |methods| %>
132
132
  <%= href methods["aref"], methods["name"] %>,
133
- <% end # values["methods"] %>
133
+ <% end %><%# values["methods"] %>
134
134
  </div>
135
135
  <% end %>
136
136
 
@@ -162,7 +162,7 @@ body,td,p { font-family: <%= values["fonts"] %>;
162
162
  <td class="attr-name"><%= attributes["name"] %></td>
163
163
  <td><%= attributes["a_desc"] %></td>
164
164
  </tr>
165
- <% end # sections["attributes"] %>
165
+ <% end %><%# sections["attributes"] %>
166
166
  </table>
167
167
  <% end %>
168
168
 
@@ -175,7 +175,7 @@ body,td,p { font-family: <%= values["fonts"] %>;
175
175
 
176
176
  <%= template_include %> <!-- method descriptions -->
177
177
 
178
- <% end # values["sections"] %>
178
+ <% end %><%# values["sections"] %>
179
179
 
180
180
  </body>
181
181
  </html>
@@ -221,7 +221,7 @@ body,td,p { font-family: <%= values["fonts"] %>;
221
221
  <% if infiles["cvsurl"] then %>
222
222
  &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
223
223
  <% end %>
224
- <% end # values["infiles"] %>
224
+ <% end %><%# values["infiles"] %>
225
225
  </td>
226
226
  </tr>
227
227
  <% if values["parent"] then %>
@@ -250,7 +250,7 @@ body,td,p { font-family: <%= values["fonts"] %>;
250
250
  <div class="name-list">
251
251
  <% values["includes"].each do |includes| %>
252
252
  <span class="method-name"><%= href includes["aref"], includes["name"] %></span>
253
- <% end # values["includes"] %>
253
+ <% end %><%# values["includes"] %>
254
254
  </div>
255
255
  <% end %>
256
256
 
@@ -285,7 +285,7 @@ body,td,p { font-family: <%= values["fonts"] %>;
285
285
  This method is also aliased as
286
286
  <% values["aka"].each do |aka| $stderr.puts({ :aka => aka }.inspect) %>
287
287
  <a href="<%= values["aref"] %>"><%= values["name"] %></a>
288
- <% end # values["aka"] %>
288
+ <% end %><%# values["aka"] %>
289
289
  </div>
290
290
  <% end %>
291
291
  <% if values["sourcecode"] then %>
@@ -293,9 +293,9 @@ This method is also aliased as
293
293
  <%= values["sourcecode"] %>
294
294
  </pre>
295
295
  <% end %>
296
- <% end # values["methods"] %>
296
+ <% end %><%# values["methods"] %>
297
297
  <% end %>
298
- <% end # values["method_list"] %>
298
+ <% end %><%# values["method_list"] %>
299
299
  <% end %>
300
300
  EOF
301
301
 
@@ -364,7 +364,7 @@ div.banner {
364
364
  <div class="banner"><%= values["list_title"] %></div>
365
365
  <% values["entries"].each do |entries| %>
366
366
  <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
367
- <% end # values["entries"] %>
367
+ <% end %><%# values["entries"] %>
368
368
  </body></html>
369
369
  EOF
370
370