From eb072f5e22a18aa8b93d7952957d6f5bdced8659 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Wed, 26 Oct 2022 09:29:59 +0200 Subject: Initial commit. --- lib/rdoc/generator/fedora_darkfish.rb | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lib/rdoc/generator/fedora_darkfish.rb (limited to 'lib') diff --git a/lib/rdoc/generator/fedora_darkfish.rb b/lib/rdoc/generator/fedora_darkfish.rb new file mode 100644 index 0000000..1e121a5 --- /dev/null +++ b/lib/rdoc/generator/fedora_darkfish.rb @@ -0,0 +1,46 @@ +require 'rdoc' +require 'rdoc/generator/darkfish' +require 'rdoc/generator/json_index' + + +class RDoc::Generator::Fedora < RDoc::Generator::Darkfish + RDoc::RDoc.add_generator self + + def initialize store, options + super store, options + @json_index = RDoc::Generator::FedoraJsonIndex.new self,options + end + + def install_rdoc_static_file source, destination, options # :nodoc: + return unless source.exist? + + return if source.fnmatch?('*fonts/*') + + begin + FileUtils.mkdir_p File.dirname(destination), **options + FileUtils.ln_sf source, destination, **options + rescue + end + end +end + +class RDoc::Generator::FedoraJsonIndex < RDoc::Generator::JsonIndex + def generate + super + + out_dir = @base_dir + @options.op_dir + + 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 -- cgit