1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rdoc: Update to RDoc 4.1.0.preview.1

RDoc 4.1.0 contains a number of enhancements including a new default
  style and accessibility support.  You can see the changelog here:

  https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc

* test/rdoc:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2013-09-18 23:33:36 +00:00
parent fed428007c
commit df7dac9174
118 changed files with 5394 additions and 3600 deletions

View file

@ -57,6 +57,21 @@ class RDoc::Generator::Darkfish
include ERB::Util
##
# Stylesheets, fonts, etc. that are included in RDoc.
BUILTIN_STYLE_ITEMS = # :nodoc:
%w[
fonts.css
fonts/Lato-Light.ttf
fonts/Lato-LightItalic.ttf
fonts/Lato-Regular.ttf
fonts/Lato-RegularItalic.ttf
fonts/SourceCodePro-Bold.ttf
fonts/SourceCodePro-Regular.ttf
rdoc.css
]
##
# Path to this file's parent directory. Used to find templates and other
# resources.
@ -127,6 +142,11 @@ class RDoc::Generator::Darkfish
attr_reader :store
##
# The directory where the template files live
attr_reader :template_dir # :nodoc:
##
# The output directory
@ -195,7 +215,13 @@ class RDoc::Generator::Darkfish
debug_msg "Copying static files"
options = { :verbose => $DEBUG_RDOC, :noop => @dry_run }
FileUtils.cp @template_dir + 'rdoc.css', '.', options
BUILTIN_STYLE_ITEMS.each do |item|
install_rdoc_static_file @template_dir + item, "./#{item}", options
end
@options.template_stylesheets.each do |stylesheet|
FileUtils.cp stylesheet, '.', options
end
Dir[(@template_dir + "{js,images}/**/*").to_s].each do |path|
next if File.directory? path
@ -203,11 +229,7 @@ class RDoc::Generator::Darkfish
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
install_rdoc_static_file @template_dir + path, dst, options
end
end
@ -447,7 +469,7 @@ class RDoc::Generator::Darkfish
##
# Generates the 404 page for the RDoc servlet
def generate_servlet_not_found path
def generate_servlet_not_found message
setup
template_file = @template_dir + 'servlet_not_found.rhtml'
@ -530,6 +552,23 @@ class RDoc::Generator::Darkfish
raise error
end
def install_rdoc_static_file source, destination, options # :nodoc:
return unless source.exist?
begin
FileUtils.mkdir_p File.dirname(destination), options
begin
FileUtils.ln source, destination, options
rescue Errno::EEXIST
FileUtils.rm destination
retry
end
rescue
FileUtils.cp source, destination, options
end
end
##
# Prepares for generation of output from the current directory