Permalink
Browse files

Release RDoc 2.3.0

  • Loading branch information...
drbrain committed Jan 29, 2009
1 parent d9a6c18 commit 0d2da5c05cb8cf8eab4b90d8054670a31db528c1
View
@@ -1,12 +1,12 @@
-=== 2.3.0 / 200?-??-??
+=== 2.3.0 / 2009-01-28
-* X Major Enhancements
- * rdoc/discover.rb files are loaded automatically from installed gems
- * Michael Granger's Darkfish generator is now the default
+* 3 Major Enhancements
+ * Michael Granger's Darkfish generator is now the default for HTML output
* Various rdoc generation speedups by Hongli Lai. Patches #22555, #22556,
#22557, #22562, #22565.
+ * rdoc/discover.rb files are loaded automatically from installed gems
-* Y Minor Enhancements
+* 8 Minor Enhancements
* Added a space after the commas in ri class method lists. RubyForge
enhancement #22182.
* Improved ri --interactive
@@ -17,7 +17,7 @@
* Converted to minitest
* Known classes and modules list outputs once per line now for grep
-* Z Bug Fixes
+* 11 Bug Fixes
* Fix missing superclass in ri output
* Fix an RDoc crash when told to parse an empty file
* Ignore nonexistent files instead of crashing
View
@@ -23,8 +23,12 @@ lib/rdoc/generator/template/darkfish/classpage.rhtml
lib/rdoc/generator/template/darkfish/filepage.rhtml
lib/rdoc/generator/template/darkfish/images/brick.png
lib/rdoc/generator/template/darkfish/images/brick_link.png
+lib/rdoc/generator/template/darkfish/images/bug.png
lib/rdoc/generator/template/darkfish/images/bullet_black.png
+lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png
+lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png
lib/rdoc/generator/template/darkfish/images/date.png
+lib/rdoc/generator/template/darkfish/images/find.png
lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif
lib/rdoc/generator/template/darkfish/images/macFFBgHack.png
lib/rdoc/generator/template/darkfish/images/package.png
@@ -1,36 +1,7 @@
#!ruby
-#
-# Darkfish RDoc HTML Generator
-# $Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $
-#
-# Author: Michael Granger <ged@FaerieMUD.org>
-#
-# == License
-#
-# Copyright (c) 2007, 2008, The FaerieMUD Consortium
-# All rights reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
require 'rubygems'
-gem 'rdoc', '>= 2.0.0'
+gem 'rdoc', '>= 2.3'
require 'pp'
require 'pathname'
@@ -42,25 +13,71 @@
require 'rdoc/generator/xml'
require 'rdoc/generator/html'
-### A erb-based RDoc HTML generator
+#
+# Darkfish RDoc HTML Generator
+#
+# $Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $
+#
+# == Author/s
+# * Michael Granger (ged@FaerieMUD.org)
+#
+# == Contributors
+# * Mahlon E. Smith (mahlon@martini.nu)
+# * Eric Hodel (drbrain@segment7.net)
+#
+# == License
+#
+# Copyright (c) 2007, 2008, Michael Granger. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# * Neither the name of the author/s, nor the names of the project's
+# contributors may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
class RDoc::Generator::Darkfish < RDoc::Generator::XML
- RDoc::RDoc.add_generator self
+ RDoc::RDoc.add_generator( self )
include ERB::Util
# Subversion rev
- SVNRev = %$Rev: 35 $
+ SVNRev = %$Rev: 52 $
# Subversion ID
- SVNId = %$Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $
+ SVNId = %$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $
# Path to this file's parent directory. Used to find templates and other
# resources.
GENERATOR_DIR = Pathname.new( __FILE__ ).expand_path.dirname
# Release Version
- VERSION = '1.1.5'
+ VERSION = '1.1.6'
+
+ # Directory where generated classes live relative to the root
+ CLASS_DIR = nil
+
+ # Directory where generated files live relative to the root
+ FILE_DIR = nil
#################################################################
@@ -78,7 +95,7 @@ def self::for( options )
#################################################################
### Initialize a few instance variables before we start
- def initialize(options)
+ def initialize( options )
@template = nil
@template_dir = GENERATOR_DIR + 'template/darkfish'
@@ -170,8 +187,7 @@ def generate_xhtml( options, files, classes )
# Make a hash of file info keyed by path
files_by_path = files.inject({}) {|hash, fileinfo|
hash[ fileinfo[:full_path] ] = fileinfo
- hash[ fileinfo[:full_path] ][:outfile] =
- fileinfo[:full_path] + '.html'
+ hash[ fileinfo[:full_path] ][:outfile] = fileinfo[:full_path] + '.html'
hash
}
@@ -261,6 +277,7 @@ def generate_class_files( options, files, classes )
rel_prefix = outputdir.relative_path_from( outfile.dirname )
svninfo = self.get_svninfo( classinfo )
+ debug_msg " rendering #{outfile}"
self.render_template( templatefile, binding(), outfile )
end
end
@@ -272,13 +289,15 @@ def generate_file_files( options, files, classes )
debug_msg "Generating file documentation in #@outputdir"
templatefile = @template_dir + 'filepage.rhtml'
+ modsort = self.get_sorted_module_list( classes )
+
files.sort_by {|k,v| k }.each do |path, fileinfo|
outfile = @outputdir + fileinfo[:outfile]
debug_msg " working on %s (%s)" % [ path, outfile ]
rel_prefix = @outputdir.relative_path_from( outfile.dirname )
context = binding()
- debug_msg " rending #{outfile}"
+ debug_msg " rendering #{outfile}"
self.render_template( templatefile, binding(), outfile )
end
end
@@ -301,7 +320,7 @@ def time_delta_string( seconds )
end
- # %q$Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $"
+ # %q$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $"
SVNID_PATTERN = /
\$Id:\s
(\S+)\s # filename
@@ -18,16 +18,6 @@
<script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
charset="utf-8"></script>
- <script type="text/javascript" charset="utf-8">
- $(document).ready( function() {
- hookSourceViews();
- hookQuickSearch();
- highlightLocationTarget();
-
- $('ul.link-list a').bind( "click", highlightClickTarget );
- });
- </script>
-
</head>
<body class="<%= classinfo[:classmod].downcase %>">
@@ -38,7 +28,7 @@
<div class="section-body">
<ul>
<% classinfo[:infiles].each do |file| %>
- <li><a href="<%= rel_prefix %>/<%= file[:full_path] %>.html?TB_iframe=true&height=400&width=600"
+ <li><a href="<%= rel_prefix %>/<%= file[:full_path] %>.html?TB_iframe=true&amp;height=550&amp;width=785"
class="thickbox" title="<%= file[:full_path] %>"><%= file[:full_path] %></a></li>
<% end %>
</ul>
@@ -80,20 +70,19 @@
<% end %>
<!-- Namespace Contents -->
- <% if classinfo[:sections].first.key?( 'classlist' ) %>
+ <% if classinfo[:sections].first.key?( :classlist ) %>
<div id="namespace-list-section" class="section">
<h3 class="section-header">Namespace</h3>
<ul class="link-list">
<% classinfo[:sections].first[:classlist].each do |desc| %>
- <!-- Desc is: <%= desc.inspect %> -->
<li><%= desc.sub(/^(\w+)/, %Q{<span class="type">\\1</span>}) %></li>
<% end %>
</ul>
</div>
<% end %>
<!-- Method Quickref -->
- <% if classinfo.key?( 'methods' ) %>
+ <% if classinfo.key?( :methods ) %>
<div id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
@@ -123,24 +112,44 @@
</div>
<div id="project-metadata">
- <div id="classindex-section" class="section project-section">
- <h3 class="section-header">Class Index</h3>
- <ul class="link-list">
- <% modsort.each do |cname| %>
- <% cinfo = classes[cname] %>
- <li><a href="<%= rel_prefix %>/<%= cinfo[:outfile] %>"><%= cname %></a></li>
+ <% simple_files = files.select {|_, file| file[:parser] == RDoc::Parser::Simple } %>
+ <% unless simple_files.empty? then %>
+ <div id="fileindex-section" class="section project-section">
+ <h3 class="section-header">Files</h3>
+ <ul>
+ <% simple_files.sort_by {|name,_| name }.each do |name, file| %>
+ <li class="file"><a href="<%= rel_prefix %>/<%= file[:short_name] %>.html"><%= h file[:short_name] %></a></li>
<% end %>
</ul>
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
-
- <form action="#" method="get" accept-charset="utf-8">
+ </div>
+ <% end %>
+
+ <div id="classindex-section" class="section project-section">
+ <h3 class="section-header">Class Index
+ <span class="search-toggle"><img src="<%= rel_prefix %>/images/find.png"
+ height="16" width="16" alt="[+]"
+ title="show/hide quicksearch" /></span></h3>
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
<fieldset>
<legend>Quicksearch</legend>
<input type="text" name="quicksearch" value=""
class="quicksearch-field" />
</fieldset>
</form>
+
+ <ul class="link-list">
+ <% modsort.each do |cname| %>
+ <% cinfo = classes[cname] %>
+ <li><a href="<%= rel_prefix %>/<%= cinfo[:outfile] %>"><%= cname %></a></li>
+ <% end %>
+ </ul>
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
</div>
+
+ <% if $DEBUG %>
+ <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
+ alt="toggle debugging" height="16" width="16" /></div>
+ <% end %>
</div>
</div>
@@ -236,18 +245,18 @@
<div class="method-description">
<% if methodinfo[:m_desc] %>
- <p><%= methodinfo[:m_desc].strip %></p>
+ <%= methodinfo[:m_desc].strip %>
<% else %>
- <p class="missing-docs">(Not documented)</p>
+ <p class="missing-docs">(Not documented)</p>
<% end %>
<% if methodinfo[:sourcecode] %>
- <div class="method-source-code"
+ <div class="method-source-code"
id="<%= methodinfo[:name].gsub( /[^a-z]+/, '-' ) %>-source">
<pre>
<%= methodinfo[:sourcecode] %>
</pre>
- </div>
+ </div>
<% end %>
</div>
@@ -265,24 +274,27 @@
<% end %>
<% end %>
- </div>
</div>
- <div id="rdoc-debugging-section-dump">
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
+ <% if $DEBUG %>
<% classinfo[:sections].first.keys.each do |section| %>
<div class="section">
<h2 class="section-header"><%= section %></h2>
<pre><%= h classinfo[:sections].first[section].to_yaml %></pre>
</div>
<% end %>
+ <% else %>
+ <p>Disabled; run with $DEBUG to generate this.</p>
+ <% end %>
</div>
<div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
- Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
+ Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
</div>
</body>
Oops, something went wrong.

0 comments on commit 0d2da5c

Please sign in to comment.