Skip to content

Commit 0d2da5c

Browse files
committed
Release RDoc 2.3.0
1 parent d9a6c18 commit 0d2da5c

14 files changed

+292
-160
lines changed

History.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
=== 2.3.0 / 200?-??-??
1+
=== 2.3.0 / 2009-01-28
22

3-
* X Major Enhancements
4-
* rdoc/discover.rb files are loaded automatically from installed gems
5-
* Michael Granger's Darkfish generator is now the default
3+
* 3 Major Enhancements
4+
* Michael Granger's Darkfish generator is now the default for HTML output
65
* Various rdoc generation speedups by Hongli Lai. Patches #22555, #22556,
76
#22557, #22562, #22565.
7+
* rdoc/discover.rb files are loaded automatically from installed gems
88

9-
* Y Minor Enhancements
9+
* 8 Minor Enhancements
1010
* Added a space after the commas in ri class method lists. RubyForge
1111
enhancement #22182.
1212
* Improved ri --interactive
@@ -17,7 +17,7 @@
1717
* Converted to minitest
1818
* Known classes and modules list outputs once per line now for grep
1919

20-
* Z Bug Fixes
20+
* 11 Bug Fixes
2121
* Fix missing superclass in ri output
2222
* Fix an RDoc crash when told to parse an empty file
2323
* Ignore nonexistent files instead of crashing

Manifest.txt

+4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ lib/rdoc/generator/template/darkfish/classpage.rhtml
2323
lib/rdoc/generator/template/darkfish/filepage.rhtml
2424
lib/rdoc/generator/template/darkfish/images/brick.png
2525
lib/rdoc/generator/template/darkfish/images/brick_link.png
26+
lib/rdoc/generator/template/darkfish/images/bug.png
2627
lib/rdoc/generator/template/darkfish/images/bullet_black.png
28+
lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png
29+
lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png
2730
lib/rdoc/generator/template/darkfish/images/date.png
31+
lib/rdoc/generator/template/darkfish/images/find.png
2832
lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif
2933
lib/rdoc/generator/template/darkfish/images/macFFBgHack.png
3034
lib/rdoc/generator/template/darkfish/images/package.png

lib/rdoc/generator/darkfish.rb

+59-40
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,7 @@
11
#!ruby
2-
#
3-
# Darkfish RDoc HTML Generator
4-
# $Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $
5-
#
6-
# Author: Michael Granger <[email protected]>
7-
#
8-
# == License
9-
#
10-
# Copyright (c) 2007, 2008, The FaerieMUD Consortium
11-
# All rights reserved.
12-
#
13-
# Permission is hereby granted, free of charge, to any person obtaining a copy
14-
# of this software and associated documentation files (the "Software"), to deal
15-
# in the Software without restriction, including without limitation the rights
16-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17-
# copies of the Software, and to permit persons to whom the Software is
18-
# furnished to do so, subject to the following conditions:
19-
#
20-
# The above copyright notice and this permission notice shall be included in
21-
# all copies or substantial portions of the Software.
22-
#
23-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29-
# THE SOFTWARE.
30-
#
312

323
require 'rubygems'
33-
gem 'rdoc', '>= 2.0.0'
4+
gem 'rdoc', '>= 2.3'
345

356
require 'pp'
367
require 'pathname'
@@ -42,25 +13,71 @@
4213
require 'rdoc/generator/xml'
4314
require 'rdoc/generator/html'
4415

45-
### A erb-based RDoc HTML generator
16+
#
17+
# Darkfish RDoc HTML Generator
18+
#
19+
# $Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $
20+
#
21+
# == Author/s
22+
# * Michael Granger ([email protected])
23+
#
24+
# == Contributors
25+
# * Mahlon E. Smith ([email protected])
26+
# * Eric Hodel ([email protected])
27+
#
28+
# == License
29+
#
30+
# Copyright (c) 2007, 2008, Michael Granger. All rights reserved.
31+
#
32+
# Redistribution and use in source and binary forms, with or without
33+
# modification, are permitted provided that the following conditions are met:
34+
#
35+
# * Redistributions of source code must retain the above copyright notice,
36+
# this list of conditions and the following disclaimer.
37+
#
38+
# * Redistributions in binary form must reproduce the above copyright notice,
39+
# this list of conditions and the following disclaimer in the documentation
40+
# and/or other materials provided with the distribution.
41+
#
42+
# * Neither the name of the author/s, nor the names of the project's
43+
# contributors may be used to endorse or promote products derived from this
44+
# software without specific prior written permission.
45+
#
46+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
47+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
49+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
50+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
51+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
52+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
53+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
54+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
55+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56+
#
4657
class RDoc::Generator::Darkfish < RDoc::Generator::XML
4758

48-
RDoc::RDoc.add_generator self
59+
RDoc::RDoc.add_generator( self )
4960

5061
include ERB::Util
5162

5263
# Subversion rev
53-
SVNRev = %$Rev: 35 $
64+
SVNRev = %$Rev: 52 $
5465

5566
# Subversion ID
56-
SVNId = %$Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $
67+
SVNId = %$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $
5768

5869
# Path to this file's parent directory. Used to find templates and other
5970
# resources.
6071
GENERATOR_DIR = Pathname.new( __FILE__ ).expand_path.dirname
6172

6273
# Release Version
63-
VERSION = '1.1.5'
74+
VERSION = '1.1.6'
75+
76+
# Directory where generated classes live relative to the root
77+
CLASS_DIR = nil
78+
79+
# Directory where generated files live relative to the root
80+
FILE_DIR = nil
6481

6582

6683
#################################################################
@@ -78,7 +95,7 @@ def self::for( options )
7895
#################################################################
7996

8097
### Initialize a few instance variables before we start
81-
def initialize(options)
98+
def initialize( options )
8299
@template = nil
83100
@template_dir = GENERATOR_DIR + 'template/darkfish'
84101

@@ -170,8 +187,7 @@ def generate_xhtml( options, files, classes )
170187
# Make a hash of file info keyed by path
171188
files_by_path = files.inject({}) {|hash, fileinfo|
172189
hash[ fileinfo[:full_path] ] = fileinfo
173-
hash[ fileinfo[:full_path] ][:outfile] =
174-
fileinfo[:full_path] + '.html'
190+
hash[ fileinfo[:full_path] ][:outfile] = fileinfo[:full_path] + '.html'
175191
hash
176192
}
177193

@@ -261,6 +277,7 @@ def generate_class_files( options, files, classes )
261277
rel_prefix = outputdir.relative_path_from( outfile.dirname )
262278
svninfo = self.get_svninfo( classinfo )
263279

280+
debug_msg " rendering #{outfile}"
264281
self.render_template( templatefile, binding(), outfile )
265282
end
266283
end
@@ -272,13 +289,15 @@ def generate_file_files( options, files, classes )
272289
debug_msg "Generating file documentation in #@outputdir"
273290
templatefile = @template_dir + 'filepage.rhtml'
274291

292+
modsort = self.get_sorted_module_list( classes )
293+
275294
files.sort_by {|k,v| k }.each do |path, fileinfo|
276295
outfile = @outputdir + fileinfo[:outfile]
277296
debug_msg " working on %s (%s)" % [ path, outfile ]
278297
rel_prefix = @outputdir.relative_path_from( outfile.dirname )
279298
context = binding()
280299

281-
debug_msg " rending #{outfile}"
300+
debug_msg " rendering #{outfile}"
282301
self.render_template( templatefile, binding(), outfile )
283302
end
284303
end
@@ -301,7 +320,7 @@ def time_delta_string( seconds )
301320
end
302321

303322

304-
# %q$Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $"
323+
# %q$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $"
305324
SVNID_PATTERN = /
306325
\$Id:\s
307326
(\S+)\s # filename

lib/rdoc/generator/template/darkfish/classpage.rhtml

+44-32
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@
1818
<script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
1919
charset="utf-8"></script>
2020

21-
<script type="text/javascript" charset="utf-8">
22-
$(document).ready( function() {
23-
hookSourceViews();
24-
hookQuickSearch();
25-
highlightLocationTarget();
26-
27-
$('ul.link-list a').bind( "click", highlightClickTarget );
28-
});
29-
</script>
30-
3121
</head>
3222
<body class="<%= classinfo[:classmod].downcase %>">
3323

@@ -38,7 +28,7 @@
3828
<div class="section-body">
3929
<ul>
4030
<% classinfo[:infiles].each do |file| %>
41-
<li><a href="<%= rel_prefix %>/<%= file[:full_path] %>.html?TB_iframe=true&height=400&width=600"
31+
<li><a href="<%= rel_prefix %>/<%= file[:full_path] %>.html?TB_iframe=true&amp;height=550&amp;width=785"
4232
class="thickbox" title="<%= file[:full_path] %>"><%= file[:full_path] %></a></li>
4333
<% end %>
4434
</ul>
@@ -80,20 +70,19 @@
8070
<% end %>
8171

8272
<!-- Namespace Contents -->
83-
<% if classinfo[:sections].first.key?( 'classlist' ) %>
73+
<% if classinfo[:sections].first.key?( :classlist ) %>
8474
<div id="namespace-list-section" class="section">
8575
<h3 class="section-header">Namespace</h3>
8676
<ul class="link-list">
8777
<% classinfo[:sections].first[:classlist].each do |desc| %>
88-
<!-- Desc is: <%= desc.inspect %> -->
8978
<li><%= desc.sub(/^(\w+)/, %Q{<span class="type">\\1</span>}) %></li>
9079
<% end %>
9180
</ul>
9281
</div>
9382
<% end %>
9483

9584
<!-- Method Quickref -->
96-
<% if classinfo.key?( 'methods' ) %>
85+
<% if classinfo.key?( :methods ) %>
9786
<div id="method-list-section" class="section">
9887
<h3 class="section-header">Methods</h3>
9988
<ul class="link-list">
@@ -123,24 +112,44 @@
123112
</div>
124113

125114
<div id="project-metadata">
126-
<div id="classindex-section" class="section project-section">
127-
<h3 class="section-header">Class Index</h3>
128-
<ul class="link-list">
129-
<% modsort.each do |cname| %>
130-
<% cinfo = classes[cname] %>
131-
<li><a href="<%= rel_prefix %>/<%= cinfo[:outfile] %>"><%= cname %></a></li>
115+
<% simple_files = files.select {|_, file| file[:parser] == RDoc::Parser::Simple } %>
116+
<% unless simple_files.empty? then %>
117+
<div id="fileindex-section" class="section project-section">
118+
<h3 class="section-header">Files</h3>
119+
<ul>
120+
<% simple_files.sort_by {|name,_| name }.each do |name, file| %>
121+
<li class="file"><a href="<%= rel_prefix %>/<%= file[:short_name] %>.html"><%= h file[:short_name] %></a></li>
132122
<% end %>
133123
</ul>
134-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
135-
136-
<form action="#" method="get" accept-charset="utf-8">
124+
</div>
125+
<% end %>
126+
127+
<div id="classindex-section" class="section project-section">
128+
<h3 class="section-header">Class Index
129+
<span class="search-toggle"><img src="<%= rel_prefix %>/images/find.png"
130+
height="16" width="16" alt="[+]"
131+
title="show/hide quicksearch" /></span></h3>
132+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
137133
<fieldset>
138134
<legend>Quicksearch</legend>
139135
<input type="text" name="quicksearch" value=""
140136
class="quicksearch-field" />
141137
</fieldset>
142138
</form>
139+
140+
<ul class="link-list">
141+
<% modsort.each do |cname| %>
142+
<% cinfo = classes[cname] %>
143+
<li><a href="<%= rel_prefix %>/<%= cinfo[:outfile] %>"><%= cname %></a></li>
144+
<% end %>
145+
</ul>
146+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
143147
</div>
148+
149+
<% if $DEBUG %>
150+
<div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
151+
alt="toggle debugging" height="16" width="16" /></div>
152+
<% end %>
144153
</div>
145154
</div>
146155

@@ -236,18 +245,18 @@
236245

237246
<div class="method-description">
238247
<% if methodinfo[:m_desc] %>
239-
<p><%= methodinfo[:m_desc].strip %></p>
248+
<%= methodinfo[:m_desc].strip %>
240249
<% else %>
241-
<p class="missing-docs">(Not documented)</p>
250+
<p class="missing-docs">(Not documented)</p>
242251
<% end %>
243252

244253
<% if methodinfo[:sourcecode] %>
245-
<div class="method-source-code"
254+
<div class="method-source-code"
246255
id="<%= methodinfo[:name].gsub( /[^a-z]+/, '-' ) %>-source">
247256
<pre>
248257
<%= methodinfo[:sourcecode] %>
249258
</pre>
250-
</div>
259+
</div>
251260
<% end %>
252261
</div>
253262

@@ -265,24 +274,27 @@
265274
<% end %>
266275
<% end %>
267276

268-
</div>
269277
</div>
270278

271279

272-
<div id="rdoc-debugging-section-dump">
280+
<div id="rdoc-debugging-section-dump" class="debugging-section">
281+
<% if $DEBUG %>
273282
<% classinfo[:sections].first.keys.each do |section| %>
274283
<div class="section">
275284
<h2 class="section-header"><%= section %></h2>
276285

277286
<pre><%= h classinfo[:sections].first[section].to_yaml %></pre>
278287
</div>
279288
<% end %>
289+
<% else %>
290+
<p>Disabled; run with $DEBUG to generate this.</p>
291+
<% end %>
280292
</div>
281293

282294
<div id="validator-badges">
283-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
284-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
285-
Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
295+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
296+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
297+
Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
286298
</div>
287299

288300
</body>

0 commit comments

Comments
 (0)