require 'rdoc' require 'rdoc/generator/darkfish' require 'rdoc/generator/json_index' module RDoc::Generator::Fedora class RDoc::Generator::Fedora::Darkfish < RDoc::Generator::Darkfish RDoc::RDoc.add_generator(self) def initialize store, options options.template_dir = File.join __dir__, 'darkfish' super store, options @json_index = RDoc::Generator::Fedora::JsonIndex.new self, options end def install_rdoc_static_file source, destination, options # :nodoc: return unless source.exist? begin FileUtils.mkdir_p File.dirname(destination), **options FileUtils.ln_sf source, destination, **options rescue end end end class RDoc::Generator::Fedora::JsonIndex < RDoc::Generator::JsonIndex def generate super out_dir = @base_dir + @options.op_dir template_dir = File.join __dir__, 'json_index' Dir.chdir template_dir do Dir['**/*.js'].each do |source| dest = File.join out_dir, source source = File.realpath source FileUtils.ln_sf source, dest, :verbose => $DEBUG_RDOC end end end # Don't generate gzipped content. Because we have always shipped also the # original, it just increases the size. def generate_gzipped end end end