aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/generator
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 03:22:49 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 03:22:49 +0000
commit2ef9c50c6e405717d06362787c4549ca4f1c6485 (patch)
treeee99486567461dd5796f3d6edcc9e204187f2666 /lib/rdoc/generator
parentd7effd506f5b91a636f2e6452ef1946b923007c7 (diff)
downloadruby-2ef9c50c6e405717d06362787c4549ca4f1c6485.tar.gz
Import RDoc 3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/generator')
-rw-r--r--lib/rdoc/generator/darkfish.rb658
-rw-r--r--lib/rdoc/generator/markup.rb108
-rw-r--r--lib/rdoc/generator/ri.rb6
-rw-r--r--lib/rdoc/generator/template/darkfish/classpage.rhtml539
-rw-r--r--lib/rdoc/generator/template/darkfish/filepage.rhtml182
-rw-r--r--lib/rdoc/generator/template/darkfish/index.rhtml90
-rw-r--r--lib/rdoc/generator/template/darkfish/rdoc.css596
7 files changed, 1058 insertions, 1121 deletions
diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb
index f64641873e..e5a6e57424 100644
--- a/lib/rdoc/generator/darkfish.rb
+++ b/lib/rdoc/generator/darkfish.rb
@@ -1,15 +1,12 @@
# -*- mode: ruby; ruby-indent-level: 2; tab-width: 2 -*-
-# vim: noet ts=2 sts=8 sw=2
require 'pathname'
require 'fileutils'
-require 'erb'
+require 'rdoc/erbio'
require 'rdoc/generator/markup'
-$DARKFISH_DRYRUN = false # TODO make me non-global
-
-#
+##
# Darkfish RDoc HTML Generator
#
# $Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $
@@ -52,401 +49,314 @@ $DARKFISH_DRYRUN = false # TODO make me non-global
#
class RDoc::Generator::Darkfish
- RDoc::RDoc.add_generator( self )
+ RDoc::RDoc.add_generator self
+
+ include ERB::Util
+
+ # Path to this file's parent directory. Used to find templates and other
+ # resources.
+
+ GENERATOR_DIR = File.join 'rdoc', 'generator'
+
+ ##
+ # Release Version
+
+ VERSION = '2'
+
+ ##
+ # Initialize a few instance variables before we start
- include ERB::Util
+ def initialize options
+ @options = options
- # Subversion rev
- SVNRev = %$Rev: 52 $
+ @template_dir = Pathname.new options.template_dir
+ @template_cache = {}
- # Subversion ID
- SVNId = %$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $
+ @files = nil
+ @classes = nil
- # Path to this file's parent directory. Used to find templates and other
- # resources.
- GENERATOR_DIR = File.join 'rdoc', 'generator'
+ @basedir = Pathname.pwd.expand_path
+ end
- # Release Version
- VERSION = '1.1.6'
+ ##
+ # The output directory
- # Directory where generated classes live relative to the root
- CLASS_DIR = nil
+ attr_reader :outputdir
- # Directory where generated files live relative to the root
- FILE_DIR = nil
+ ##
+ # Output progress information if debugging is enabled
+ def debug_msg *msg
+ return unless $DEBUG_RDOC
+ $stderr.puts(*msg)
+ end
- #################################################################
- ### C L A S S M E T H O D S
- #################################################################
+ ##
+ # Directory where generated class HTML files live relative to the output
+ # dir.
- ### Standard generator factory method
- def self::for( options )
- new( options )
- end
+ def class_dir
+ nil
+ end
+ ##
+ # Directory where generated class HTML files live relative to the output
+ # dir.
- #################################################################
- ### I N S T A N C E M E T H O D S
- #################################################################
+ def file_dir
+ nil
+ end
- ### Initialize a few instance variables before we start
- def initialize( options )
- @options = options
+ ##
+ # Create the directories the generated docs will live in if they don't
+ # already exist.
- template = @options.template || 'darkfish'
+ def gen_sub_directories
+ @outputdir.mkpath
+ end
- template_dir = $LOAD_PATH.map do |path|
- File.join File.expand_path(path), GENERATOR_DIR, 'template', template
- end.find do |dir|
- File.directory? dir
- end
+ ##
+ # Copy over the stylesheet into the appropriate place in the output
+ # directory.
- raise RDoc::Error, "could not find template #{template.inspect}" unless
- template_dir
+ def write_style_sheet
+ debug_msg "Copying static files"
+ options = { :verbose => $DEBUG_RDOC, :noop => @options.dry_run }
- @template_dir = Pathname.new File.expand_path(template_dir)
+ FileUtils.cp @template_dir + 'rdoc.css', '.', options
- @files = nil
- @classes = nil
+ Dir[(@template_dir + "{js,images}/**/*").to_s].each do |path|
+ next if File.directory? path
+ next if File.basename(path) =~ /^\./
- @basedir = Pathname.pwd.expand_path
- end
+ dst = Pathname.new(path).relative_path_from @template_dir
- ######
- public
- ######
+ # I suck at glob
+ dst_dir = dst.dirname
+ FileUtils.mkdir_p dst_dir, options unless File.exist? dst_dir
- # The output directory
- attr_reader :outputdir
+ FileUtils.cp @template_dir + path, dst, options
+ end
+ end
+ ##
+ # Build the initial indices and output objects based on an array of TopLevel
+ # objects containing the extracted information.
- ### Output progress information if debugging is enabled
- def debug_msg( *msg )
- return unless $DEBUG_RDOC
- $stderr.puts( *msg )
- end
+ def generate top_levels
+ @outputdir = Pathname.new(@options.op_dir).expand_path(@basedir)
- def class_dir
- CLASS_DIR
- end
+ @files = top_levels.sort
+ @classes = RDoc::TopLevel.all_classes_and_modules.sort
+ @methods = @classes.map { |m| m.method_list }.flatten.sort
+ @modsort = get_sorted_module_list(@classes)
- def file_dir
- FILE_DIR
- end
+ # Now actually write the output
+ write_style_sheet
+ generate_index
+ generate_class_files
+ generate_file_files
- ### Create the directories the generated docs will live in if
- ### they don't already exist.
- def gen_sub_directories
- @outputdir.mkpath
- end
+ rescue StandardError => err
+ debug_msg "%s: %s\n %s" % [
+ err.class.name, err.message, err.backtrace.join("\n ")
+ ]
+
+ raise
+ end
+
+ protected
+
+ ##
+ # Return a list of the documented modules sorted by salience first, then
+ # by name.
+
+ def get_sorted_module_list(classes)
+ nscounts = classes.inject({}) do |counthash, klass|
+ top_level = klass.full_name.gsub(/::.*/, '')
+ counthash[top_level] ||= 0
+ counthash[top_level] += 1
+
+ counthash
+ end
+
+ # Sort based on how often the top level namespace occurs, and then on the
+ # name of the module -- this works for projects that put their stuff into
+ # a namespace, of course, but doesn't hurt if they don't.
+ classes.sort_by do |klass|
+ top_level = klass.full_name.gsub( /::.*/, '' )
+ [nscounts[top_level] * -1, klass.full_name]
+ end.select do |klass|
+ klass.document_self
+ end
+ end
+
+ ##
+ # Generate an index page which lists all the classes which are documented.
+
+ def generate_index
+ template_file = @template_dir + 'index.rhtml'
+ return unless template_file.exist?
+
+ debug_msg "Rendering the index page..."
+
+ out_file = @basedir + @options.op_dir + 'index.html'
+
+ render_template template_file, out_file do |io| binding end
+ end
+
+ ##
+ # Generate a documentation file for each class
+
+ def generate_class_files
+ template_file = @template_dir + 'classpage.rhtml'
+ return unless template_file.exist?
+ debug_msg "Generating class documentation in #@outputdir"
+
+ @classes.each do |klass|
+ debug_msg " working on %s (%s)" % [klass.full_name, klass.path]
+ out_file = @outputdir + klass.path
+ # suppress 1.9.3 warning
+ rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
+ svninfo = svninfo = self.get_svninfo(klass)
+
+ debug_msg " rendering #{out_file}"
+ render_template template_file, out_file do |io| binding end
+ end
+ end
+
+ ##
+ # Generate a documentation file for each file
+
+ def generate_file_files
+ template_file = @template_dir + 'filepage.rhtml'
+ return unless template_file.exist?
+ debug_msg "Generating file documentation in #@outputdir"
+
+ @files.each do |file|
+ out_file = @outputdir + file.path
+ debug_msg " working on %s (%s)" % [ file.full_name, out_file ]
+ # suppress 1.9.3 warning
+ rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
+
+ debug_msg " rendering #{out_file}"
+ render_template template_file, out_file do |io| binding end
+ end
+ end
+
+ ##
+ # Return a string describing the amount of time in the given number of
+ # seconds in terms a human can understand easily.
+
+ def time_delta_string seconds
+ return 'less than a minute' if seconds < 60
+ return "#{seconds / 60} minute#{seconds / 60 == 1 ? '' : 's'}" if
+ seconds < 3000 # 50 minutes
+ return 'about one hour' if seconds < 5400 # 90 minutes
+ return "#{seconds / 3600} hours" if seconds < 64800 # 18 hours
+ return 'one day' if seconds < 86400 # 1 day
+ return 'about one day' if seconds < 172800 # 2 days
+ return "#{seconds / 86400} days" if seconds < 604800 # 1 week
+ return 'about one week' if seconds < 1209600 # 2 week
+ return "#{seconds / 604800} weeks" if seconds < 7257600 # 3 months
+ return "#{seconds / 2419200} months" if seconds < 31536000 # 1 year
+ return "#{seconds / 31536000} years"
+ end
+
+ # %q$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $"
+ SVNID_PATTERN = /
+ \$Id:\s
+ (\S+)\s # filename
+ (\d+)\s # rev
+ (\d{4}-\d{2}-\d{2})\s # Date (YYYY-MM-DD)
+ (\d{2}:\d{2}:\d{2}Z)\s # Time (HH:MM:SSZ)
+ (\w+)\s # committer
+ \$$
+ /x
+
+ ##
+ # Try to extract Subversion information out of the first constant whose
+ # value looks like a subversion Id tag. If no matching constant is found,
+ # and empty hash is returned.
+
+ def get_svninfo klass
+ constants = klass.constants or return {}
+
+ constants.find { |c| c.value =~ SVNID_PATTERN } or return {}
+
+ filename, rev, date, time, committer = $~.captures
+ commitdate = Time.parse "#{date} #{time}"
+
+ return {
+ :filename => filename,
+ :rev => Integer(rev),
+ :commitdate => commitdate,
+ :commitdelta => time_delta_string(Time.now - commitdate),
+ :committer => committer,
+ }
+ end
+
+ ##
+ # Load and render the erb template in the given +template_file+ and write
+ # it out to +out_file+.
+ #
+ # Both +template_file+ and +out_file+ should be Pathname-like objects.
+ #
+ # An io will be yielded which must be captured by binding in the caller.
+
+ def render_template template_file, out_file # :yield: io
+ template = template_for template_file
+
+ unless @options.dry_run then
+ debug_msg "Outputting to %s" % [out_file.expand_path]
+
+ out_file.dirname.mkpath
+ out_file.open 'w', 0644 do |io|
+ io.set_encoding @options.encoding if Object.const_defined? :Encoding
+
+ context = yield io
+
+ template_result template, context, template_file
+ end
+ else
+ context = yield nil
+
+ output = template_result template, context, template_file
+
+ debug_msg " would have written %d characters to %s" % [
+ output.length, out_file.expand_path
+ ]
+ end
+ end
+
+ ##
+ # Creates the result for +template+ with +context+. If an error is raised a
+ # Pathname +template_file+ will indicate the file where the error occurred.
+
+ def template_result template, context, template_file
+ template.filename = template_file.to_s
+ template.result context
+ rescue NoMethodError => e
+ raise RDoc::Error, "Error while evaluating %s: %s" % [
+ template_file.expand_path,
+ e.message,
+ ], e.backtrace
+ end
+
+ ##
+ # Retrieves a cache template for +file+, if present, or fills the cache.
+
+ def template_for file
+ template = @template_cache[file]
+
+ return template if template
+
+ klass = @options.dry_run ? ERB : RDoc::ERBIO
+
+ template = klass.new file.read, nil, '<>'
+ @template_cache[file] = template
+ template
+ end
- ### Copy over the stylesheet into the appropriate place in the output
- ### directory.
- def write_style_sheet
- debug_msg "Copying static files"
- options = { :verbose => $DEBUG_RDOC, :noop => $DARKFISH_DRYRUN }
-
- FileUtils.cp @template_dir + 'rdoc.css', '.', options
-
- Dir[(@template_dir + "{js,images}/**/*").to_s].each do |path|
- next if File.directory? path
- next if path =~ /#{File::SEPARATOR}\./
-
- dst = Pathname.new(path).relative_path_from @template_dir
-
- # I suck at glob
- dst_dir = dst.dirname
- FileUtils.mkdir_p dst_dir, options unless File.exist? dst_dir
-
- FileUtils.cp @template_dir + path, dst, options
- end
- end
-
- ### Build the initial indices and output objects
- ### based on an array of TopLevel objects containing
- ### the extracted information.
- def generate( top_levels )
- @outputdir = Pathname.new( @options.op_dir ).expand_path( @basedir )
-
- @files = top_levels.sort
- @classes = RDoc::TopLevel.all_classes_and_modules.sort
- @methods = @classes.map { |m| m.method_list }.flatten.sort
- @modsort = get_sorted_module_list( @classes )
-
- # Now actually write the output
- write_style_sheet
- generate_index
- generate_class_files
- generate_file_files
-
- rescue StandardError => err
- debug_msg "%s: %s\n %s" % [ err.class.name, err.message, err.backtrace.join("\n ") ]
- raise
- end
-
- #########
- protected
- #########
-
- ### Return a list of the documented modules sorted by salience first, then
- ### by name.
- def get_sorted_module_list( classes )
- nscounts = classes.inject({}) do |counthash, klass|
- top_level = klass.full_name.gsub( /::.*/, '' )
- counthash[top_level] ||= 0
- counthash[top_level] += 1
-
- counthash
- end
-
- # Sort based on how often the top level namespace occurs, and then on the
- # name of the module -- this works for projects that put their stuff into
- # a namespace, of course, but doesn't hurt if they don't.
- classes.sort_by do |klass|
- top_level = klass.full_name.gsub( /::.*/, '' )
- [
- nscounts[ top_level ] * -1,
- klass.full_name
- ]
- end.select do |klass|
- klass.document_self
- end
- end
-
- ### Generate an index page which lists all the classes which
- ### are documented.
- def generate_index
- template_file = @template_dir + 'index.rhtml'
- return unless template_file.exist?
-
- debug_msg "Rendering the index page..."
-
- template_src = template_file.read
- template = ERB.new( template_src, nil, '<>' )
- template.filename = template_file.to_s
- context = binding()
-
- output = nil
-
- begin
- output = template.result( context )
- rescue NoMethodError => err
- raise RDoc::Error, "Error while evaluating %s: %s (at %p)" % [
- template_file,
- err.message,
- eval( "_erbout[-50,50]", context )
- ], err.backtrace
- end
-
- outfile = @basedir + @options.op_dir + 'index.html'
- unless $DARKFISH_DRYRUN
- debug_msg "Outputting to %s" % [outfile.expand_path]
- outfile.open( 'w', 0644 ) do |fh|
- fh.print( output )
- end
- else
- debug_msg "Would have output to %s" % [outfile.expand_path]
- end
- end
-
- ### Generate a documentation file for each class
- def generate_class_files
- template_file = @template_dir + 'classpage.rhtml'
- return unless template_file.exist?
- debug_msg "Generating class documentation in #@outputdir"
-
- @classes.each do |klass|
- debug_msg " working on %s (%s)" % [ klass.full_name, klass.path ]
- outfile = @outputdir + klass.path
- rel_prefix = @outputdir.relative_path_from( outfile.dirname )
- svninfo = self.get_svninfo( klass )
-
- debug_msg " rendering #{outfile}"
- self.render_template( template_file, binding(), outfile )
- end
- end
-
- ### Generate a documentation file for each file
- def generate_file_files
- template_file = @template_dir + 'filepage.rhtml'
- return unless template_file.exist?
- debug_msg "Generating file documentation in #@outputdir"
-
- @files.each do |file|
- outfile = @outputdir + file.path
- debug_msg " working on %s (%s)" % [ file.full_name, outfile ]
- rel_prefix = @outputdir.relative_path_from( outfile.dirname )
-
- debug_msg " rendering #{outfile}"
- self.render_template( template_file, binding(), outfile )
- end
- end
-
-
- ### Return a string describing the amount of time in the given number of
- ### seconds in terms a human can understand easily.
- def time_delta_string( seconds )
- return 'less than a minute' if seconds < 1.minute
- return (seconds / 1.minute).to_s + ' minute' + (seconds/60 == 1 ? '' : 's') if seconds < 50.minutes
- return 'about one hour' if seconds < 90.minutes
- return (seconds / 1.hour).to_s + ' hours' if seconds < 18.hours
- return 'one day' if seconds < 1.day
- return 'about one day' if seconds < 2.days
- return (seconds / 1.day).to_s + ' days' if seconds < 1.week
- return 'about one week' if seconds < 2.week
- return (seconds / 1.week).to_s + ' weeks' if seconds < 3.months
- return (seconds / 1.month).to_s + ' months' if seconds < 1.year
- return (seconds / 1.year).to_s + ' years'
- end
-
-
- # %q$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $"
- SVNID_PATTERN = /
- \$Id:\s
- (\S+)\s # filename
- (\d+)\s # rev
- (\d{4}-\d{2}-\d{2})\s # Date (YYYY-MM-DD)
- (\d{2}:\d{2}:\d{2}Z)\s # Time (HH:MM:SSZ)
- (\w+)\s # committer
- \$$
- /x
-
- ### Try to extract Subversion information out of the first constant whose value looks like
- ### a subversion Id tag. If no matching constant is found, and empty hash is returned.
- def get_svninfo( klass )
- constants = klass.constants or return {}
-
- constants.find {|c| c.value =~ SVNID_PATTERN } or return {}
-
- filename, rev, date, time, committer = $~.captures
- commitdate = Time.parse( date + ' ' + time )
-
- return {
- :filename => filename,
- :rev => Integer( rev ),
- :commitdate => commitdate,
- :commitdelta => time_delta_string( Time.now.to_i - commitdate.to_i ),
- :committer => committer,
- }
- end
-
-
- ### Load and render the erb template in the given +template_file+ within the
- ### specified +context+ (a Binding object) and write it out to +outfile+.
- ### Both +template_file+ and +outfile+ should be Pathname-like objects.
-
- def render_template( template_file, context, outfile )
- template_src = template_file.read
- template = ERB.new( template_src, nil, '<>' )
- template.filename = template_file.to_s
-
- output = begin
- template.result( context )
- rescue NoMethodError => err
- raise RDoc::Error, "Error while evaluating %s: %s (at %p)" % [
- template_file.to_s,
- err.message,
- eval( "_erbout[-50,50]", context )
- ], err.backtrace
- end
-
- unless $DARKFISH_DRYRUN
- outfile.dirname.mkpath
- outfile.open( 'w', 0644 ) do |ofh|
- ofh.print( output )
- end
- else
- debug_msg " would have written %d bytes to %s" %
- [ output.length, outfile ]
- end
- end
-
-end # Roc::Generator::Darkfish
-
-# :stopdoc:
-
-### Time constants
-module TimeConstantMethods # :nodoc:
-
- ### Number of seconds (returns receiver unmodified)
- def seconds
- return self
- end
- alias_method :second, :seconds
-
- ### Returns number of seconds in <receiver> minutes
- def minutes
- return self * 60
- end
- alias_method :minute, :minutes
-
- ### Returns the number of seconds in <receiver> hours
- def hours
- return self * 60.minutes
- end
- alias_method :hour, :hours
-
- ### Returns the number of seconds in <receiver> days
- def days
- return self * 24.hours
- end
- alias_method :day, :days
-
- ### Return the number of seconds in <receiver> weeks
- def weeks
- return self * 7.days
- end
- alias_method :week, :weeks
-
- ### Returns the number of seconds in <receiver> fortnights
- def fortnights
- return self * 2.weeks
- end
- alias_method :fortnight, :fortnights
-
- ### Returns the number of seconds in <receiver> months (approximate)
- def months
- return self * 30.days
- end
- alias_method :month, :months
-
- ### Returns the number of seconds in <receiver> years (approximate)
- def years
- return (self * 365.25.days).to_i
- end
- alias_method :year, :years
-
-
- ### Returns the Time <receiver> number of seconds before the
- ### specified +time+. E.g., 2.hours.before( header.expiration )
- def before( time )
- return time - self
- end
-
-
- ### Returns the Time <receiver> number of seconds ago. (e.g.,
- ### expiration > 2.hours.ago )
- def ago
- return self.before( ::Time.now )
- end
-
-
- ### Returns the Time <receiver> number of seconds after the given +time+.
- ### E.g., 10.minutes.after( header.expiration )
- def after( time )
- return time + self
- end
-
- # Reads best without arguments: 10.minutes.from_now
- def from_now
- return self.after( ::Time.now )
- end
-end # module TimeConstantMethods
-
-
-# Extend Numeric with time constants
-class Numeric # :nodoc:
- include TimeConstantMethods
end
diff --git a/lib/rdoc/generator/markup.rb b/lib/rdoc/generator/markup.rb
index a90b15a1e7..482fd2b2a3 100644
--- a/lib/rdoc/generator/markup.rb
+++ b/lib/rdoc/generator/markup.rb
@@ -36,8 +36,9 @@ module RDoc::Generator::Markup
return @formatter if defined? @formatter
show_hash = RDoc::RDoc.current.options.show_hash
+ hyperlink_all = RDoc::RDoc.current.options.hyperlink_all
this = RDoc::Context === self ? self : @parent
- @formatter = RDoc::Markup::ToHtmlCrossref.new this.path, this, show_hash
+ @formatter = RDoc::Markup::ToHtmlCrossref.new this.path, this, show_hash, hyperlink_all
end
##
@@ -57,36 +58,65 @@ end
class RDoc::AnyMethod
+ ##
+ # Maps RDoc::RubyToken classes to CSS class names
+
+ STYLE_MAP = {
+ RDoc::RubyToken::TkCONSTANT => 'ruby-constant',
+ RDoc::RubyToken::TkKW => 'ruby-keyword',
+ RDoc::RubyToken::TkIVAR => 'ruby-ivar',
+ RDoc::RubyToken::TkOp => 'ruby-operator',
+ RDoc::RubyToken::TkId => 'ruby-identifier',
+ RDoc::RubyToken::TkNode => 'ruby-node',
+ RDoc::RubyToken::TkCOMMENT => 'ruby-comment',
+ RDoc::RubyToken::TkREGEXP => 'ruby-regexp',
+ RDoc::RubyToken::TkSTRING => 'ruby-string',
+ RDoc::RubyToken::TkVal => 'ruby-value',
+ }
+
include RDoc::Generator::Markup
+ @add_line_numbers = false
+
+ class << self
+ ##
+ # Allows controlling whether <tt>#markup_code</tt> adds line numbers to
+ # the source code.
+
+ attr_accessor :add_line_numbers
+ end
+
##
# Prepend +src+ with line numbers. Relies on the first line of a source
# code listing having:
#
- # # File xxxxx, line dddd
+ # # File xxxxx, line dddd
+ #
+ # If it has, line numbers are added an ', line dddd' is removed.
def add_line_numbers(src)
- if src =~ /\A.*, line (\d+)/ then
- first = $1.to_i - 1
- last = first + src.count("\n")
- size = last.to_s.length
-
- line = first
- src.gsub!(/^/) do
- res = if line == first then
- " " * (size + 2)
- else
- "%2$*1$d: " % [size, line]
- end
-
- line += 1
- res
- end
+ return unless src.sub!(/\A(.*)(, line (\d+))/, '\1')
+ first = $3.to_i - 1
+ last = first + src.count("\n")
+ size = last.to_s.length
+
+ line = first
+ src.gsub!(/^/) do
+ res = if line == first then
+ " " * (size + 1)
+ else
+ "<span class=\"line-num\">%2$*1$d</span> " % [size, line]
+ end
+
+ line += 1
+ res
end
end
##
- # Turns the method's token stream into HTML
+ # Turns the method's token stream into HTML.
+ #
+ # Prepends line numbers if +add_line_numbers+ is true.
def markup_code
return '' unless @token_stream
@@ -95,32 +125,32 @@ class RDoc::AnyMethod
@token_stream.each do |t|
next unless t
- # style = STYLE_MAP[t.class]
- style = case t
- when RDoc::RubyToken::TkCONSTANT then "ruby-constant"
- when RDoc::RubyToken::TkKW then "ruby-keyword kw"
- when RDoc::RubyToken::TkIVAR then "ruby-ivar"
- when RDoc::RubyToken::TkOp then "ruby-operator"
- when RDoc::RubyToken::TkId then "ruby-identifier"
- when RDoc::RubyToken::TkNode then "ruby-node"
- when RDoc::RubyToken::TkCOMMENT then "ruby-comment cmt"
- when RDoc::RubyToken::TkREGEXP then "ruby-regexp re"
- when RDoc::RubyToken::TkSTRING then "ruby-value str"
- when RDoc::RubyToken::TkVal then "ruby-value"
- else
- nil
- end
+
+ style = STYLE_MAP[t.class]
text = CGI.escapeHTML t.text
- if style
+ if style then
src << "<span class=\"#{style}\">#{text}</span>"
else
src << text
end
end
- add_line_numbers src
+ # dedent the source
+ indent = src.length
+ lines = src.lines.to_a
+ lines.shift if src =~ /\A.*#\ *File/i # remove '# File' comment
+ lines.each do |line|
+ if line =~ /^ *(?=\S)/
+ n = $&.length
+ indent = n if n < indent
+ break if n == 0
+ end
+ end
+ src.gsub!(/^#{' ' * indent}/, '') if indent > 0
+
+ add_line_numbers(src) if self.class.add_line_numbers
src
end
@@ -133,6 +163,12 @@ class RDoc::Attr
end
+class RDoc::Alias
+
+ include RDoc::Generator::Markup
+
+end
+
class RDoc::Constant
include RDoc::Generator::Markup
diff --git a/lib/rdoc/generator/ri.rb b/lib/rdoc/generator/ri.rb
index 819eb52d40..fb52997e89 100644
--- a/lib/rdoc/generator/ri.rb
+++ b/lib/rdoc/generator/ri.rb
@@ -8,10 +8,6 @@ class RDoc::Generator::RI
RDoc::RDoc.add_generator self
- def self.for options
- new options
- end
-
##
# Set up a new ri generator
@@ -20,6 +16,8 @@ class RDoc::Generator::RI
@store = RDoc::RI::Store.new '.'
@old_siginfo = nil
@current = nil
+
+ @store.dry_run = @options.dry_run
end
##
diff --git a/lib/rdoc/generator/template/darkfish/classpage.rhtml b/lib/rdoc/generator/template/darkfish/classpage.rhtml
index 7151087988..72b86ec6a7 100644
--- a/lib/rdoc/generator/template/darkfish/classpage.rhtml
+++ b/lib/rdoc/generator/template/darkfish/classpage.rhtml
@@ -1,296 +1,289 @@
<?xml version="1.0" encoding="<%= @options.charset %>"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
+ <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
- <title><%= klass.type.capitalize %>: <%= klass.full_name %></title>
+ <title><%= klass.type.capitalize %>: <%= klass.full_name %></title>
- <link rel="stylesheet" href="<%= rel_prefix %>/rdoc.css" type="text/css" media="screen" />
+ <link rel="stylesheet" href="<%= rel_prefix %>/rdoc.css" type="text/css" media="screen" />
- <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
- charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
+ charset="utf-8"></script>
</head>
<body class="<%= klass.type %>">
- <div id="metadata">
- <div id="home-metadata">
- <div id="home-section" class="section">
+ <div id="metadata">
+ <div id="home-metadata">
+ <div id="home-section" class="section">
<h3 class="section-header">
<a href="<%= rel_prefix %>/index.html">Home</a>
<a href="<%= rel_prefix %>/index.html#classes">Classes</a>
<a href="<%= rel_prefix %>/index.html#methods">Methods</a>
</h3>
- </div>
- </div>
-
- <div id="file-metadata">
- <div id="file-list-section" class="section">
- <h3 class="section-header">In Files</h3>
- <div class="section-body">
- <ul>
- <% klass.in_files.each do |tl| %>
- <li><a href="<%= rel_prefix %>/<%= h tl.path %>?TB_iframe=true&amp;height=550&amp;width=785"
- class="thickbox" title="<%= h tl.absolute_name %>"><%= h tl.absolute_name %></a></li>
- <% end %>
- </ul>
- </div>
- </div>
-
- <% if !svninfo.empty? %>
- <div id="file-svninfo-section" class="section">
- <h3 class="section-header">Subversion Info</h3>
- <div class="section-body">
- <dl class="svninfo">
- <dt>Rev</dt>
- <dd><%= svninfo[:rev] %></dd>
-
- <dt>Last Checked In</dt>
- <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
- (<%= svninfo[:commitdelta] %> ago)</dd>
-
- <dt>Checked in by</dt>
- <dd><%= svninfo[:committer] %></dd>
- </dl>
- </div>
- </div>
- <% end %>
- </div>
-
- <div id="class-metadata">
-
- <!-- Parent Class -->
- <% if klass.type == 'class' %>
- <div id="parent-class-section" class="section">
- <h3 class="section-header">Parent</h3>
- <% unless String === klass.superclass %>
- <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a></p>
- <% else %>
- <p class="link"><%= klass.superclass %></p>
- <% end %>
- </div>
- <% end %>
-
- <!-- Namespace Contents -->
- <% unless klass.classes_and_modules.empty? %>
- <div id="namespace-list-section" class="section">
- <h3 class="section-header">Namespace</h3>
- <ul class="link-list">
- <% (klass.modules.sort + klass.classes.sort).each do |mod| %>
- <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= klass.aref_to mod.path %>"><%= mod.full_name %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <!-- Method Quickref -->
- <% unless klass.method_list.empty? %>
- <div id="method-list-section" class="section">
- <h3 class="section-header">Methods</h3>
- <ul class="link-list">
- <% klass.each_method do |meth| %>
- <li><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= meth.name %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <!-- Included Modules -->
- <% unless klass.includes.empty? %>
- <div id="includes-section" class="section">
- <h3 class="section-header">Included Modules</h3>
- <ul class="link-list">
- <% klass.each_include do |inc| %>
- <% unless String === inc.module %>
- <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
- <% else %>
- <li><span class="include"><%= inc.name %></span></li>
- <% end %>
- <% end %>
- </ul>
- </div>
- <% end %>
- </div>
-
- <div id="project-metadata">
- <% simple_files = @files.select {|tl| tl.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.each do |file| %>
- <li class="file"><a href="<%= rel_prefix %>/<%= file.path %>"><%= h file.base_name %></a></li>
- <% end %>
- </ul>
- </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 |index_klass| %>
- <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
- <% end %>
- </ul>
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
- </div>
-
- <% if $DEBUG_RDOC %>
- <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
- alt="toggle debugging" height="16" width="16" /></div>
- <% end %>
- </div>
- </div>
-
- <div id="documentation">
- <h1 class="<%= klass.type %>"><%= klass.full_name %></h1>
-
- <div id="description">
- <%= klass.description %>
- </div>
-
- <!-- Constants -->
- <% unless klass.constants.empty? %>
- <div id="constants-list" class="section">
- <h3 class="section-header">Constants</h3>
- <dl>
- <% klass.each_constant do |const| %>
- <dt><a name="<%= const.name %>"><%= const.name %></a></dt>
- <% if const.comment %>
- <dd class="description"><%= const.description.strip %></dd>
- <% else %>
- <dd class="description missing-docs">(Not documented)</dd>
- <% end %>
- <% end %>
- </dl>
- </div>
- <% end %>
-
- <!-- Attributes -->
- <% unless klass.attributes.empty? %>
- <div id="attribute-method-details" class="method-section section">
- <h3 class="section-header">Attributes</h3>
-
- <% klass.each_attribute do |attrib| %>
- <div id="<%= attrib.html_name %>-attribute-method" class="method-detail">
- <a name="<%= h attrib.name %>"></a>
- <% if attrib.rw =~ /w/i %>
- <a name="<%= h attrib.name %>="></a>
- <% end %>
- <div class="method-heading attribute-method-heading">
- <span class="method-name"><%= h attrib.name %></span><span
- class="attribute-access-type">[<%= attrib.rw %>]</span>
- </div>
-
- <div class="method-description">
- <% if attrib.comment %>
- <%= attrib.description.strip %>
- <% else %>
- <p class="missing-docs">(Not documented)</p>
- <% end %>
- </div>
- </div>
- <% end %>
- </div>
- <% end %>
-
- <!-- Methods -->
- <% klass.methods_by_type.each do |type, visibilities|
- next if visibilities.empty?
- visibilities.each do |visibility, methods|
- next if methods.empty? %>
- <div id="<%= visibility %>-<%= type %>-method-details" class="method-section section">
- <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
-
- <% methods.each do |method| %>
- <div id="<%= method.html_name %>-method" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
- <a name="<%= h method.aref %>"></a>
-
- <div class="method-heading">
- <% if method.call_seq %>
- <span class="method-callseq"><%= method.call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m, '') %></span>
- <span class="method-click-advice">click to toggle source</span>
- <% else %>
- <span class="method-name"><%= h method.name %></span><span
- class="method-args"><%= method.params %></span>
- <span class="method-click-advice">click to toggle source</span>
- <% end %>
- </div>
-
- <div class="method-description">
- <% if method.comment %>
- <%= method.description.strip %>
- <% else %>
- <p class="missing-docs">(Not documented)</p>
- <% end %>
-
- <% if method.token_stream %>
- <div class="method-source-code"
- id="<%= method.html_name %>-source">
+ </div>
+ </div>
+
+ <div id="file-metadata">
+ <div id="file-list-section" class="section">
+ <h3 class="section-header">In Files</h3>
+ <div class="section-body">
+ <ul>
+ <% klass.in_files.each do |tl| %>
+ <li><a href="<%= rel_prefix %>/<%= h tl.path %>?TB_iframe=true&amp;height=550&amp;width=785"
+ class="thickbox" title="<%= h tl.absolute_name %>"><%= h tl.absolute_name %></a></li>
+ <% end %>
+ </ul>
+ </div>
+ </div>
+
+ <% if !svninfo.empty? %>
+ <div id="file-svninfo-section" class="section">
+ <h3 class="section-header">Subversion Info</h3>
+ <div class="section-body">
+ <dl class="svninfo">
+ <dt>Rev</dt>
+ <dd><%= svninfo[:rev] %></dd>
+
+ <dt>Last Checked In</dt>
+ <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
+ (<%= svninfo[:commitdelta] %> ago)</dd>
+
+ <dt>Checked in by</dt>
+ <dd><%= svninfo[:committer] %></dd>
+ </dl>
+ </div>
+ </div>
+ <% end %>
+ </div>
+
+ <div id="class-metadata">
+
+ <!-- Parent Class -->
+ <% if klass.type == 'class' %>
+ <div id="parent-class-section" class="section">
+ <h3 class="section-header">Parent</h3>
+ <% if klass.superclass and not String === klass.superclass then %>
+ <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a></p>
+ <% else %>
+ <p class="link"><%= klass.superclass %></p>
+ <% end %>
+ </div>
+ <% end %>
+
+ <!-- Namespace Contents -->
+ <% unless klass.classes_and_modules.empty? %>
+ <div id="namespace-list-section" class="section">
+ <h3 class="section-header">Namespace</h3>
+ <ul class="link-list">
+ <% (klass.modules.sort + klass.classes.sort).each do |mod| %>
+ <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= klass.aref_to mod.path %>"><%= mod.full_name %></a></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <!-- Method Quickref -->
+ <% unless klass.method_list.empty? %>
+ <div id="method-list-section" class="section">
+ <h3 class="section-header">Methods</h3>
+ <ul class="link-list">
+ <% klass.each_method do |meth| %>
+ <li><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= meth.name %></a></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <!-- Included Modules -->
+ <% unless klass.includes.empty? %>
+ <div id="includes-section" class="section">
+ <h3 class="section-header">Included Modules</h3>
+ <ul class="link-list">
+ <% klass.each_include do |inc| %>
+ <% unless String === inc.module %>
+ <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
+ <% else %>
+ <li><span class="include"><%= inc.name %></span></li>
+ <% end %>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+ </div>
+
+ <div id="project-metadata">
+ <% simple_files = @files.select {|tl| tl.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.each do |file| %>
+ <li class="file"><a href="<%= rel_prefix %>/<%= file.path %>"><%= h file.base_name %></a></li>
+ <% end %>
+ </ul>
+ </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 |index_klass| %>
+ <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
+ <% end %>
+ </ul>
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
+ </div>
+
+ <% if $DEBUG_RDOC %>
+ <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
+ alt="toggle debugging" height="16" width="16" /></div>
+ <% end %>
+ </div>
+ </div>
+
+ <div id="documentation">
+ <h1 class="<%= klass.type %>"><%= klass.full_name %></h1>
+
+ <div id="description">
+ <%= klass.description %>
+ </div>
+
+ <!-- Constants -->
+ <% unless klass.constants.empty? %>
+ <div id="constants-list" class="section">
+ <h3 class="section-header">Constants</h3>
+ <dl>
+ <% klass.each_constant do |const| %>
+ <dt><a name="<%= const.name %>"><%= const.name %></a></dt>
+ <% if const.comment %>
+ <dd class="description"><%= const.description.strip %></dd>
+ <% else %>
+ <dd class="description missing-docs">(Not documented)</dd>
+ <% end %>
+ <% end %>
+ </dl>
+ </div>
+ <% end %>
+
+ <!-- Attributes -->
+ <% unless klass.attributes.empty? %>
+ <div id="attribute-method-details" class="method-section section">
+ <h3 class="section-header">Attributes</h3>
+
+ <% klass.each_attribute do |attrib| %>
+ <div id="<%= attrib.html_name %>-attribute-method" class="method-detail">
+ <a name="<%= h attrib.name %>"></a>
+ <% if attrib.rw =~ /w/i %>
+ <a name="<%= h attrib.name %>="></a>
+ <% end %>
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name"><%= h attrib.name %></span><span
+ class="attribute-access-type">[<%= attrib.rw %>]</span>
+ </div>
+
+ <div class="method-description">
+ <% if attrib.comment %>
+ <%= attrib.description.strip %>
+ <% else %>
+ <p class="missing-docs">(Not documented)</p>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+ </div>
+ <% end %>
+
+ <!-- Methods -->
+ <% klass.methods_by_type.each do |type, visibilities|
+ next if visibilities.empty?
+ visibilities.each do |visibility, methods|
+ next if methods.empty? %>
+ <div id="<%= visibility %>-<%= type %>-method-details" class="method-section section">
+ <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
+
+ <% methods.each do |method| %>
+ <div id="<%= method.html_name %>-method" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
+ <a name="<%= h method.aref %>"></a>
+
+ <div class="method-heading">
+ <% if method.call_seq %>
+ <span class="method-callseq"><%= method.call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m, '') %></span>
+ <span class="method-click-advice">click to toggle source</span>
+ <% else %>
+ <span class="method-name"><%= h method.name %></span><span
+ class="method-args"><%= method.params %></span>
+ <span class="method-click-advice">click to toggle source</span>
+ <% end %>
+ </div>
+
+ <div class="method-description">
+ <% if method.comment %>
+ <%= method.description.strip %>
+ <% else %>
+ <p class="missing-docs">(Not documented)</p>
+ <% end %>
+
+ <% if method.token_stream %>
+ <div class="method-source-code"
+ id="<%= method.html_name %>-source">
<pre>
<%= method.markup_code %>
</pre>
- </div>
- <% end %>
- </div>
-
- <% unless method.aliases.empty? %>
- <div class="aliases">
- Also aliased as: <%= method.aliases.map do |aka|
- %{<a href="#{ klass.aref_to aka.path}">#{h aka.name}</a>}
- end.join(", ") %>
- </div>
- <% end %>
-
- <% if method.is_alias_for then %>
- <div class="aliases">
+ </div>
+ <% end %>
+ </div>
+
+ <% unless method.aliases.empty? %>
+ <div class="aliases">
+ Also aliased as: <%= method.aliases.map do |aka|
+ if aka.parent then # HACK lib/rexml/encodings
+ %{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
+ else
+ h aka.name
+ end
+ end.join ", " %>
+ </div>
+ <% end %>
+
+ <% if method.is_alias_for then %>
+ <div class="aliases">
Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
- </div>
- <% end %>
- </div>
-
- <% end %>
- </div>
- <% end
- end %>
-
- </div>
-
-
- <div id="rdoc-debugging-section-dump" class="debugging-section">
- <% if $DEBUG_RDOC
- require 'pp' %>
-<pre><%= h PP.pp(klass, _erbout) %></pre>
- </div>
- <% 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>
- </div>
+ </div>
+ <% end %>
+ </div>
+
+ <% end %>
+ </div>
+ <% end
+ 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>
+ </div>
</body>
</html>
diff --git a/lib/rdoc/generator/template/darkfish/filepage.rhtml b/lib/rdoc/generator/template/darkfish/filepage.rhtml
index 33216dc8f1..b230a456a3 100644
--- a/lib/rdoc/generator/template/darkfish/filepage.rhtml
+++ b/lib/rdoc/generator/template/darkfish/filepage.rhtml
@@ -1,123 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
+ <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
- <title>File: <%= file.base_name %> [<%= @options.title %>]</title>
+ <title>File: <%= file.base_name %> [<%= @options.title %>]</title>
- <link type="text/css" media="screen" href="<%= rel_prefix %>/rdoc.css" rel="stylesheet" />
+ <link type="text/css" media="screen" href="<%= rel_prefix %>/rdoc.css" rel="stylesheet" />
- <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
- charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
+ charset="utf-8"></script>
</head>
<% if file.parser == RDoc::Parser::Simple %>
<body class="file">
- <div id="metadata">
- <div id="home-metadata">
- <div id="home-section" class="section">
+ <div id="metadata">
+ <div id="home-metadata">
+ <div id="home-section" class="section">
<h3 class="section-header">
<a href="<%= rel_prefix %>/index.html">Home</a>
<a href="<%= rel_prefix %>/index.html#classes">Classes</a>
<a href="<%= rel_prefix %>/index.html#methods">Methods</a>
</h3>
- </div>
- </div>
+ </div>
+ </div>
- <div id="project-metadata">
- <% simple_files = @files.select { |f| f.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.each do |f| %>
- <li class="file"><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.base_name %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
+ <div id="project-metadata">
+ <% simple_files = @files.select { |f| f.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.each do |f| %>
+ <li class="file"><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.base_name %></a></li>
+ <% end %>
+ </ul>
+ </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>
+ <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 |index_klass| %>
- <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
- <% end %>
- </ul>
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
- </div>
+ <ul class="link-list">
+ <% @modsort.each do |index_klass| %>
+ <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
+ <% end %>
+ </ul>
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
+ </div>
- <% if $DEBUG_RDOC %>
- <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
- alt="toggle debugging" height="16" width="16" /></div>
- <% end %>
- </div>
- </div>
+ <% if $DEBUG_RDOC %>
+ <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
+ alt="toggle debugging" height="16" width="16" /></div>
+ <% end %>
+ </div>
+ </div>
- <div id="documentation">
- <%= file.description %>
- </div>
+ <div id="documentation">
+ <%= file.description %>
+ </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>
- </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>
+ </div>
</body>
<% else %>
<body class="file file-popup">
- <div id="metadata">
- <dl>
- <dt class="modified-date">Last Modified</dt>
- <dd class="modified-date"><%= file.last_modified %></dd>
+ <div id="metadata">
+ <dl>
+ <dt class="modified-date">Last Modified</dt>
+ <dd class="modified-date"><%= file.last_modified %></dd>
- <% if file.requires %>
- <dt class="requires">Requires</dt>
- <dd class="requires">
- <ul>
- <% file.requires.each do |require| %>
- <li><%= require.name %></li>
- <% end %>
- </ul>
- </dd>
- <% end %>
+ <% if file.requires %>
+ <dt class="requires">Requires</dt>
+ <dd class="requires">
+ <ul>
+ <% file.requires.each do |require| %>
+ <li><%= require.name %></li>
+ <% end %>
+ </ul>
+ </dd>
+ <% end %>
- <% if @options.webcvs %>
- <dt class="scs-url">Trac URL</dt>
- <dd class="scs-url"><a target="_top"
- href="<%= file.cvs_url %>"><%= file.cvs_url %></a></dd>
- <% end %>
- </dl>
- </div>
+ <% if @options.webcvs %>
+ <dt class="scs-url">Trac URL</dt>
+ <dd class="scs-url"><a target="_top"
+ href="<%= file.cvs_url %>"><%= file.cvs_url %></a></dd>
+ <% end %>
+ </dl>
+ </div>
- <div id="documentation">
- <% if file.comment %>
- <div class="description">
- <h2>Description</h2>
- <%= file.description %>
- </div>
- <% end %>
- </div>
+ <div id="documentation">
+ <% if file.comment %>
+ <div class="description">
+ <h2>Description</h2>
+ <%= file.description %>
+ </div>
+ <% end %>
+ </div>
</body>
<% end %>
</html>
diff --git a/lib/rdoc/generator/template/darkfish/index.rhtml b/lib/rdoc/generator/template/darkfish/index.rhtml
index e853235ddb..3198246f8a 100644
--- a/lib/rdoc/generator/template/darkfish/index.rhtml
+++ b/lib/rdoc/generator/template/darkfish/index.rhtml
@@ -1,64 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
- <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
+ <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
- <title><%= h @options.title %></title>
+ <title><%= h @options.title %></title>
- <link type="text/css" media="screen" href="rdoc.css" rel="stylesheet" />
+ <link type="text/css" media="screen" href="rdoc.css" rel="stylesheet" />
- <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/darkfish.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/darkfish.js" type="text/javascript" charset="utf-8"></script>
</head>
<body class="indexpage">
- <% $stderr.sync = true %>
- <h1><%= h @options.title %></h1>
+ <% $stderr.sync = true %>
+ <h1><%= h @options.title %></h1>
- <% if @options.main_page && main_page = @files.find { |f| f.full_name == @options.main_page } %>
- <div id="main">
- <%= main_page.description.sub(%r{^\s*<h1.*?/h1>}i, '') %>
- </div>
- <% else %>
- <p>This is the API documentation for '<%= @options.title %>'.</p>
- <% end %>
+ <% if @options.main_page && main_page = @files.find { |f| f.full_name == @options.main_page } then %>
+ <div id="main">
+ <%= main_page.description.sub(%r{^\s*<h1.*?/h1>}i, '') %>
+ </div>
+ <% else %>
+ <p>This is the API documentation for '<%= @options.title %>'.</p>
+ <% end %>
- <% simple_files = @files.select {|tl| tl.parser == RDoc::Parser::Simple } %>
- <% unless simple_files.empty? then %>
- <h2>Files</h2>
- <ul>
- <% simple_files.sort.each do |file| %>
- <li class="file"><a href="<%= file.path %>"><%= h file.base_name %></a></li>
- <% end %>
- </ul>
- <% end %>
+ <% simple_files = @files.select {|tl| tl.parser == RDoc::Parser::Simple } %>
+ <% unless simple_files.empty? then %>
+ <h2>Files</h2>
+ <ul>
+ <% simple_files.sort.each do |file| %>
+ <li class="file"><a href="<%= file.path %>"><%= h file.base_name %></a></li>
+ <% end %>
+ </ul>
+ <% end %>
- <h2 id="classes">Classes/Modules</h2>
- <ul>
- <% @modsort.each do |klass| %>
- <li class="<%= klass.type %>"><a href="<%= klass.path %>"><%= klass.full_name %></a></li>
- <% end %>
- </ul>
+ <h2 id="classes">Classes/Modules</h2>
+ <ul>
+ <% @modsort.each do |klass| %>
+ <li class="<%= klass.type %>"><a href="<%= klass.path %>"><%= klass.full_name %></a></li>
+ <% end %>
+ </ul>
- <h2 id="methods">Methods</h2>
- <ul>
- <% RDoc::TopLevel.all_classes_and_modules.map do |mod|
- mod.method_list
- end.flatten.sort.each do |method| %>
- <li><a href="<%= method.path %>"><%= method.pretty_name %> &mdash; <%= method.parent.full_name %></a></li>
- <% end %>
- </ul>
+ <h2 id="methods">Methods</h2>
+ <ul>
+ <% RDoc::TopLevel.all_classes_and_modules.map do |mod|
+ mod.method_list
+ end.flatten.sort.each do |method| %>
+ <li><a href="<%= method.path %>"><%= method.pretty_name %> &mdash; <%= method.parent.full_name %></a></li>
+ <% end %>
+ </ul>
- <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>
- </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>
+ </div>
</body>
</html>
diff --git a/lib/rdoc/generator/template/darkfish/rdoc.css b/lib/rdoc/generator/template/darkfish/rdoc.css
index ffe996001a..231f9b7f04 100644
--- a/lib/rdoc/generator/template/darkfish/rdoc.css
+++ b/lib/rdoc/generator/template/darkfish/rdoc.css
@@ -12,76 +12,76 @@
body {
background: #efefef;
- font: 14px "Helvetica Neue", Helvetica, Tahoma, sans-serif;
+ font: 14px "Helvetica Neue", Helvetica, Tahoma, sans-serif;
}
body.class, body.module, body.file {
- margin-left: 40px;
+ margin-left: 40px;
}
body.file-popup {
- font-size: 90%;
- margin-left: 0;
+ font-size: 90%;
+ margin-left: 0;
}
h1 {
- font-size: 300%;
- text-shadow: rgba(135,145,135,0.65) 2px 2px 3px;
- color: #6C8C22;
+ font-size: 300%;
+ text-shadow: rgba(135,145,135,0.65) 2px 2px 3px;
+ color: #6C8C22;
}
h2,h3,h4 { margin-top: 1.5em; }
:link,
:visited {
- color: #6C8C22;
- text-decoration: none;
+ color: #6C8C22;
+ text-decoration: none;
}
:link:hover,
:visited:hover {
- border-bottom: 1px dotted #6C8C22;
+ border-bottom: 1px dotted #6C8C22;
}
pre {
- background: #ddd;
- padding: 0.5em 0;
+ background: #ddd;
+ padding: 0.5em 0;
}
/* @group Generic Classes */
.initially-hidden {
- display: none;
+ display: none;
}
.quicksearch-field {
- width: 98%;
- background: #ddd;
- border: 1px solid #aaa;
- height: 1.5em;
- -webkit-border-radius: 4px;
+ width: 98%;
+ background: #ddd;
+ border: 1px solid #aaa;
+ height: 1.5em;
+ -webkit-border-radius: 4px;
}
.quicksearch-field:focus {
- background: #f1edba;
+ background: #f1edba;
}
.missing-docs {
- font-size: 120%;
- background: white url(images/wrench_orange.png) no-repeat 4px center;
- color: #ccc;
- line-height: 2em;
- border: 1px solid #d00;
- opacity: 1;
- padding-left: 20px;
- text-indent: 24px;
- letter-spacing: 3px;
- font-weight: bold;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
+ font-size: 120%;
+ background: white url(images/wrench_orange.png) no-repeat 4px center;
+ color: #ccc;
+ line-height: 2em;
+ border: 1px solid #d00;
+ opacity: 1;
+ padding-left: 20px;
+ text-indent: 24px;
+ letter-spacing: 3px;
+ font-weight: bold;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
}
.target-section {
- border: 2px solid #dcce90;
- border-left-width: 8px;
- padding: 0 1em;
- background: #fff3c2;
+ border: 2px solid #dcce90;
+ border-left-width: 8px;
+ padding: 0 1em;
+ background: #fff3c2;
}
/* @end */
@@ -89,37 +89,37 @@ pre {
/* @group Index Page, Standalone file pages */
body.indexpage {
- margin: 1em 3em;
+ margin: 1em 3em;
}
body.indexpage p,
body.indexpage div,
body.file p {
- margin: 1em 0;
+ margin: 1em 0;
}
.indexpage ul,
.file #documentation ul {
- line-height: 160%;
- list-style: none;
+ line-height: 160%;
+ list-style: none;
}
.indexpage ul :link,
.indexpage ul :visited {
- font-size: 16px;
+ font-size: 16px;
}
.indexpage li,
.file #documentation li {
- padding-left: 20px;
- background: url(images/bullet_black.png) no-repeat left 4px;
+ padding-left: 20px;
+ background: url(images/bullet_black.png) no-repeat left 4px;
}
.indexpage li.module {
- background: url(images/package.png) no-repeat left 4px;
+ background: url(images/package.png) no-repeat left 4px;
}
.indexpage li.class {
- background: url(images/ruby.png) no-repeat left 4px;
+ background: url(images/ruby.png) no-repeat left 4px;
}
.indexpage li.file {
- background: url(images/page_white_text.png) no-repeat left 4px;
+ background: url(images/page_white_text.png) no-repeat left 4px;
}
.file li p,
.indexpage li p {
@@ -133,48 +133,48 @@ body.file p {
.class #metadata,
.file #metadata,
.module #metadata {
- float: left;
- width: 260px;
+ float: left;
+ width: 260px;
}
.class #documentation,
.file #documentation,
.module #documentation {
- margin: 2em 1em 5em 300px;
- min-width: 340px;
+ margin: 2em 1em 5em 300px;
+ min-width: 340px;
}
.file #metadata {
- margin: 0.8em;
+ margin: 0.8em;
}
#validator-badges {
- clear: both;
- margin: 1em 1em 2em;
+ clear: both;
+ margin: 1em 1em 2em;
}
/* @end */
/* @group Metadata Section */
#metadata .section {
- background-color: #dedede;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border: 1px solid #aaa;
- margin: 0 8px 16px;
- font-size: 90%;
- overflow: hidden;
+ background-color: #dedede;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border: 1px solid #aaa;
+ margin: 0 8px 16px;
+ font-size: 90%;
+ overflow: hidden;
}
#metadata h3.section-header {
- margin: 0;
- padding: 2px 8px;
- background: #ccc;
- color: #666;
- -moz-border-radius-topleft: 4px;
- -moz-border-radius-topright: 4px;
- -webkit-border-top-left-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- border-bottom: 1px solid #aaa;
+ margin: 0;
+ padding: 2px 8px;
+ background: #ccc;
+ color: #666;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ border-bottom: 1px solid #aaa;
}
#metadata #home-section h3.section-header {
border-bottom: 0;
@@ -183,33 +183,33 @@ body.file p {
#metadata ul,
#metadata dl,
#metadata p {
- padding: 8px;
- list-style: none;
+ padding: 8px;
+ list-style: none;
}
#file-metadata ul {
- padding-left: 28px;
- list-style-image: url(images/page_green.png);
+ padding-left: 28px;
+ list-style-image: url(images/page_green.png);
}
dl.svninfo {
- color: #666;
- margin: 0;
+ color: #666;
+ margin: 0;
}
dl.svninfo dt {
- font-weight: bold;
+ font-weight: bold;
}
ul.link-list li {
- white-space: nowrap;
+ white-space: nowrap;
}
ul.link-list .type {
- font-size: 8px;
- text-transform: uppercase;
- color: white;
- background: #969696;
- padding: 2px 4px;
- -webkit-border-radius: 5px;
+ font-size: 8px;
+ text-transform: uppercase;
+ color: white;
+ background: #969696;
+ padding: 2px 4px;
+ -webkit-border-radius: 5px;
}
/* @end */
@@ -217,7 +217,7 @@ ul.link-list .type {
/* @group Project Metadata Section */
#project-metadata {
- margin-top: 3em;
+ margin-top: 3em;
}
.file #project-metadata {
@@ -225,34 +225,34 @@ ul.link-list .type {
}
#project-metadata .section {
- border: 1px solid #aaa;
+ border: 1px solid #aaa;
}
#project-metadata h3.section-header {
- border-bottom: 1px solid #aaa;
- position: relative;
+ border-bottom: 1px solid #aaa;
+ position: relative;
}
#project-metadata h3.section-header .search-toggle {
- position: absolute;
- right: 5px;
+ position: absolute;
+ right: 5px;
}
#project-metadata form {
- color: #777;
- background: #ccc;
- padding: 8px 8px 16px;
- border-bottom: 1px solid #bbb;
+ color: #777;
+ background: #ccc;
+ padding: 8px 8px 16px;
+ border-bottom: 1px solid #bbb;
}
#project-metadata fieldset {
- border: 0;
+ border: 0;
}
#no-class-search-results {
- margin: 0 auto 1em;
- text-align: center;
- font-size: 14px;
- font-weight: bold;
- color: #aaa;
+ margin: 0 auto 1em;
+ text-align: center;
+ font-size: 14px;
+ font-weight: bold;
+ color: #aaa;
}
/* @end */
@@ -260,12 +260,12 @@ ul.link-list .type {
/* @group Documentation Section */
#description {
- font-size: 100%;
- color: #333;
+ font-size: 100%;
+ color: #333;
}
#description p {
- margin: 1em 0.4em;
+ margin: 1em 0.4em;
}
#description li p {
@@ -273,152 +273,152 @@ ul.link-list .type {
}
#description ul {
- margin-left: 1.5em;
+ margin-left: 1.5em;
}
#description ul li {
- line-height: 1.4em;
+ line-height: 1.4em;
}
#description dl,
#documentation dl {
- margin: 8px 1.5em;
- border: 1px solid #ccc;
+ margin: 8px 1.5em;
+ border: 1px solid #ccc;
}
#description dl {
- font-size: 14px;
+ font-size: 14px;
}
#description dt,
#documentation dt {
- padding: 2px 4px;
- font-weight: bold;
- background: #ddd;
+ padding: 2px 4px;
+ font-weight: bold;
+ background: #ddd;
}
#description dd,
#documentation dd {
- padding: 2px 12px;
+ padding: 2px 12px;
}
#description dd + dt,
#documentation dd + dt {
- margin-top: 0.7em;
+ margin-top: 0.7em;
}
#documentation .section {
- font-size: 90%;
+ font-size: 90%;
}
#documentation h3.section-header {
- margin-top: 2em;
- padding: 0.75em 0.5em;
- background-color: #dedede;
- color: #333;
- font-size: 150%;
- border: 1px solid #bbb;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
+ margin-top: 2em;
+ padding: 0.75em 0.5em;
+ background-color: #dedede;
+ color: #333;
+ font-size: 150%;
+ border: 1px solid #bbb;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
}
#constants-list > dl,
#attributes-list > dl {
- margin: 1em 0 2em;
- border: 0;
+ margin: 1em 0 2em;
+ border: 0;
}
#constants-list > dl dt,
#attributes-list > dl dt {
- padding-left: 0;
- font-weight: bold;
- font-family: Monaco, "Andale Mono";
- background: inherit;
+ padding-left: 0;
+ font-weight: bold;
+ font-family: Monaco, "Andale Mono";
+ background: inherit;
}
#constants-list > dl dt a,
#attributes-list > dl dt a {
- color: inherit;
+ color: inherit;
}
#constants-list > dl dd,
#attributes-list > dl dd {
- margin: 0 0 1em 0;
- padding: 0;
- color: #666;
+ margin: 0 0 1em 0;
+ padding: 0;
+ color: #666;
}
/* @group Method Details */
#documentation .method-source-code {
- display: none;
+ display: none;
}
#documentation .method-detail {
- margin: 0.5em 0;
- padding: 0.5em 0;
- cursor: pointer;
+ margin: 0.5em 0;
+ padding: 0.5em 0;
+ cursor: pointer;
}
#documentation .method-detail:hover {
- background-color: #f1edba;
+ background-color: #f1edba;
}
#documentation .method-heading {
- position: relative;
- padding: 2px 4px 0 20px;
- font-size: 125%;
- font-weight: bold;
- color: #333;
- background: url(images/brick.png) no-repeat left bottom;
+ position: relative;
+ padding: 2px 4px 0 20px;
+ font-size: 125%;
+ font-weight: bold;
+ color: #333;
+ background: url(images/brick.png) no-repeat left bottom;
}
#documentation .method-heading :link,
#documentation .method-heading :visited {
- color: inherit;
+ color: inherit;
}
#documentation .method-click-advice {
- position: absolute;
- top: 2px;
- right: 5px;
- font-size: 10px;
- color: #9b9877;
- visibility: hidden;
- padding-right: 20px;
- line-height: 20px;
- background: url(images/zoom.png) no-repeat right top;
+ position: absolute;
+ top: 2px;
+ right: 5px;
+ font-size: 10px;
+ color: #9b9877;
+ visibility: hidden;
+ padding-right: 20px;
+ line-height: 20px;
+ background: url(images/zoom.png) no-repeat right top;
}
#documentation .method-detail:hover .method-click-advice {
- visibility: visible;
+ visibility: visible;
}
#documentation .method-alias .method-heading {
- color: #666;
- background: url(images/brick_link.png) no-repeat left bottom;
+ color: #666;
+ background: url(images/brick_link.png) no-repeat left bottom;
}
#documentation .method-description,
#documentation .aliases {
- margin: 0 20px;
- line-height: 1.2em;
- color: #666;
+ margin: 0 20px;
+ line-height: 1.2em;
+ color: #666;
}
#documentation .aliases {
- padding-top: 4px;
- font-style: italic;
- cursor: default;
+ padding-top: 4px;
+ font-style: italic;
+ cursor: default;
}
#documentation .method-description p {
- padding: 0;
+ padding: 0;
}
#documentation .method-description p + p {
- margin-bottom: 0.5em;
+ margin-bottom: 0.5em;
}
#documentation .method-description ul {
margin-left: 1.5em;
}
#documentation .attribute-method-heading {
- background: url(images/tag_green.png) no-repeat left bottom;
+ background: url(images/tag_green.png) no-repeat left bottom;
}
#documentation #attribute-method-details .method-detail:hover {
- background-color: transparent;
- cursor: default;
+ background-color: transparent;
+ cursor: default;
}
#documentation .attribute-access-type {
- font-size: 60%;
- text-transform: uppercase;
- vertical-align: super;
- padding: 0 2px;
+ font-size: 60%;
+ text-transform: uppercase;
+ vertical-align: super;
+ padding: 0 2px;
}
/* @end */
@@ -429,19 +429,19 @@ ul.link-list .type {
/* @group Source Code */
div.method-source-code {
- background: #262626;
- color: #efefef;
- margin: 1em;
- padding: 0.5em;
- border: 1px dashed #999;
- overflow: hidden;
+ background: #262626;
+ color: #efefef;
+ margin: 1em;
+ padding: 0.5em;
+ border: 1px dashed #999;
+ overflow: hidden;
}
div.method-source-code pre {
- background: inherit;
- padding: 0;
- color: white;
- overflow: auto;
+ background: inherit;
+ padding: 0;
+ color: white;
+ overflow: auto;
}
/* @group Ruby keyword styles */
@@ -467,51 +467,51 @@ div.method-source-code pre {
}
.file-popup dl {
- font-size: 80%;
- padding: 0.75em;
- background-color: #dedede;
- color: #333;
- border: 1px solid #bbb;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
+ font-size: 80%;
+ padding: 0.75em;
+ background-color: #dedede;
+ color: #333;
+ border: 1px solid #bbb;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
}
.file dt {
- font-weight: bold;
- padding-left: 22px;
- line-height: 20px;
- background: url(images/page_white_width.png) no-repeat left top;
+ font-weight: bold;
+ padding-left: 22px;
+ line-height: 20px;
+ background: url(images/page_white_width.png) no-repeat left top;
}
.file dt.modified-date {
- background: url(images/date.png) no-repeat left top;
+ background: url(images/date.png) no-repeat left top;
}
.file dt.requires {
- background: url(images/plugin.png) no-repeat left top;
+ background: url(images/plugin.png) no-repeat left top;
}
.file dt.scs-url {
- background: url(images/wrench.png) no-repeat left top;
+ background: url(images/wrench.png) no-repeat left top;
}
.file dl dd {
- margin: 0 0 1em 0;
+ margin: 0 0 1em 0;
}
.file #metadata dl dd ul {
- list-style: circle;
- margin-left: 20px;
- padding-top: 0;
+ list-style: circle;
+ margin-left: 20px;
+ padding-top: 0;
}
.file #metadata dl dd ul li {
}
.file h2 {
- margin-top: 2em;
- padding: 0.75em 0.5em;
- background-color: #dedede;
- color: #333;
- font-size: 120%;
- border: 1px solid #bbb;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
+ margin-top: 2em;
+ padding: 0.75em 0.5em;
+ background-color: #dedede;
+ color: #333;
+ font-size: 120%;
+ border: 1px solid #bbb;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
}
/* @end */
@@ -521,13 +521,13 @@ div.method-source-code pre {
/* @group ThickBox Styles */
#TB_window {
- font: 12px Arial, Helvetica, sans-serif;
- color: #333333;
+ font: 12px Arial, Helvetica, sans-serif;
+ color: #333333;
}
#TB_secondLine {
- font: 10px Arial, Helvetica, sans-serif;
- color:#666666;
+ font: 10px Arial, Helvetica, sans-serif;
+ color:#666666;
}
#TB_window :link,
@@ -540,147 +540,147 @@ div.method-source-code pre {
#TB_window :visited:focus { color: #666666; }
#TB_overlay {
- position: fixed;
- z-index:100;
- top: 0px;
- left: 0px;
- height:100%;
- width:100%;
+ position: fixed;
+ z-index:100;
+ top: 0px;
+ left: 0px;
+ height:100%;
+ width:100%;
}
.TB_overlayMacFFBGHack {background: url(images/macFFBgHack.png) repeat;}
.TB_overlayBG {
- background-color:#000;
- filter:alpha(opacity=75);
- -moz-opacity: 0.75;
- opacity: 0.75;
+ background-color:#000;
+ filter:alpha(opacity=75);
+ -moz-opacity: 0.75;
+ opacity: 0.75;
}
* html #TB_overlay { /* ie6 hack */
- position: absolute;
- height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+ position: absolute;
+ height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
#TB_window {
- position: fixed;
- background: #ffffff;
- z-index: 102;
- color:#000000;
- display:none;
- border: 4px solid #525252;
- text-align:left;
- top:50%;
- left:50%;
+ position: fixed;
+ background: #ffffff;
+ z-index: 102;
+ color:#000000;
+ display:none;
+ border: 4px solid #525252;
+ text-align:left;
+ top:50%;
+ left:50%;
}
* html #TB_window { /* ie6 hack */
-position: absolute;
-margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+ position: absolute;
+ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
}
#TB_window img#TB_Image {
- display:block;
- margin: 15px 0 0 15px;
- border-right: 1px solid #ccc;
- border-bottom: 1px solid #ccc;
- border-top: 1px solid #666;
- border-left: 1px solid #666;
+ display:block;
+ margin: 15px 0 0 15px;
+ border-right: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ border-top: 1px solid #666;
+ border-left: 1px solid #666;
}
#TB_caption{
- height:25px;
- padding:7px 30px 10px 25px;
- float:left;
+ height:25px;
+ padding:7px 30px 10px 25px;
+ float:left;
}
#TB_closeWindow{
- height:25px;
- padding:11px 25px 10px 0;
- float:right;
+ height:25px;
+ padding:11px 25px 10px 0;
+ float:right;
}
#TB_closeAjaxWindow{
- padding:7px 10px 5px 0;
- margin-bottom:1px;
- text-align:right;
- float:right;
+ padding:7px 10px 5px 0;
+ margin-bottom:1px;
+ text-align:right;
+ float:right;
}
#TB_ajaxWindowTitle{
- float:left;
- padding:7px 0 5px 10px;
- margin-bottom:1px;
- font-size: 22px;
+ float:left;
+ padding:7px 0 5px 10px;
+ margin-bottom:1px;
+ font-size: 22px;
}
#TB_title{
- background-color: #6C8C22;
- color: #dedede;
- height:40px;
+ background-color: #6C8C22;
+ color: #dedede;
+ height:40px;
}
#TB_title :link,
#TB_title :visited {
- color: white !important;
- border-bottom: 1px dotted #dedede;
+ color: white !important;
+ border-bottom: 1px dotted #dedede;
}
#TB_ajaxContent{
- clear:both;
- padding:2px 15px 15px 15px;
- overflow:auto;
- text-align:left;
- line-height:1.4em;
+ clear:both;
+ padding:2px 15px 15px 15px;
+ overflow:auto;
+ text-align:left;
+ line-height:1.4em;
}
#TB_ajaxContent.TB_modal{
- padding:15px;
+ padding:15px;
}
#TB_ajaxContent p{
- padding:5px 0px 5px 0px;
+ padding:5px 0px 5px 0px;
}
#TB_load{
- position: fixed;
- display:none;
- height:13px;
- width:208px;
- z-index:103;
- top: 50%;
- left: 50%;
- margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
+ position: fixed;
+ display:none;
+ height:13px;
+ width:208px;
+ z-index:103;
+ top: 50%;
+ left: 50%;
+ margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
}
* html #TB_load { /* ie6 hack */
-position: absolute;
-margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+ position: absolute;
+ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
}
#TB_HideSelect{
- z-index:99;
- position:fixed;
- top: 0;
- left: 0;
- background-color:#fff;
- border:none;
- filter:alpha(opacity=0);
- -moz-opacity: 0;
- opacity: 0;
- height:100%;
- width:100%;
+ z-index:99;
+ position:fixed;
+ top: 0;
+ left: 0;
+ background-color:#fff;
+ border:none;
+ filter:alpha(opacity=0);
+ -moz-opacity: 0;
+ opacity: 0;
+ height:100%;
+ width:100%;
}
* html #TB_HideSelect { /* ie6 hack */
- position: absolute;
- height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+ position: absolute;
+ height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
#TB_iframeContent{
- clear:both;
- border:none;
- margin-bottom:-1px;
- margin-top:1px;
- _margin-bottom:1px;
+ clear:both;
+ border:none;
+ margin-bottom:-1px;
+ margin-top:1px;
+ _margin-bottom:1px;
}
/* @end */
@@ -688,17 +688,17 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d
/* @group Debugging Section */
#debugging-toggle {
- text-align: center;
+ text-align: center;
}
#debugging-toggle img {
- cursor: pointer;
+ cursor: pointer;
}
#rdoc-debugging-section-dump {
- display: none;
- margin: 0 2em 2em;
- background: #ccc;
- border: 1px solid #999;
+ display: none;
+ margin: 0 2em 2em;
+ background: #ccc;
+ border: 1px solid #999;
}