in _plugins/links.rb [17:73]
def render_javadoc(context, text, url_only)
clz = text.strip
short = true
if not url_only
args = text.strip.split(' ', 2)
if args[0] == '-f'
short = false
clz = args[1]
elsif args[0] == '-c'
clz = args[1]
end
end
base = context.registers[:site].config['javadoc_base']
v = context.environments.first["page"]["javadoc_version"]
if v.nil?
v = context.registers[:site].config['javadoc_version']
end
clz_slash = convert_package(clz)
clz_name = clz.split('.').last
if not clz.start_with?('org.apache.accumulo.')
raise "Unknown package prefix for #{clz}"
end
jmodule = 'accumulo-' + clz.split('.')[3]
if clz.start_with?('org.apache.accumulo.server')
jmodule = 'accumulo-server-base'
elsif clz.start_with?('org.apache.accumulo.hadoop.mapred')
jmodule = 'accumulo-hadoop-mapreduce'
elsif clz == 'org.apache.accumulo.hadoop'
jmodule = 'accumulo-hadoop-mapreduce'
elsif clz.start_with?('org.apache.accumulo.iteratortest')
jmodule = 'accumulo-iterator-test-harness'
end
if clz_slash.include? "#"
clz_only = convert_package(clz.split('#').first)
method = clz.split('#').last
url = "#{base}/#{jmodule}/#{v}/#{clz_only}.html##{method}"
elsif clz_name =~ /^[a-z]/
url = "#{base}/#{jmodule}/#{v}/#{clz_slash}/package-summary.html"
else
url = "#{base}/#{jmodule}/#{v}/#{clz_slash}.html"
end
if url_only
return url
end
if short
link_text = clz.split('.').last
else
link_text = clz
end
r = "[#{link_text}](#{url})"
return r
end