1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
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
|