diff options
| author | Jarek Prokop <jprokop@redhat.com> | 2022-10-26 09:29:59 +0200 |
|---|---|---|
| committer | Jarek Prokop <jprokop@redhat.com> | 2022-10-26 09:36:45 +0200 |
| commit | eb072f5e22a18aa8b93d7952957d6f5bdced8659 (patch) | |
| tree | 55d701a0dfc2e73535c37a5f8716b5cc38a1ef31 /lib/rdoc | |
| download | fedora_darkfish-eb072f5e22a18aa8b93d7952957d6f5bdced8659.tar.gz fedora_darkfish-eb072f5e22a18aa8b93d7952957d6f5bdced8659.tar.xz fedora_darkfish-eb072f5e22a18aa8b93d7952957d6f5bdced8659.zip | |
Initial commit.
Diffstat (limited to 'lib/rdoc')
| -rw-r--r-- | lib/rdoc/generator/fedora_darkfish.rb | 46 |
1 files changed, 46 insertions, 0 deletions
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 |
