2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: CC-BY-SA-3.0
9 task :generate => [ :realclean, 'sdk/python/arvados/index.html', 'sdk/R/arvados/index.html', 'sdk/java-v2/javadoc/index.html' ] do
10 vars = ['baseurl', 'arvados_cluster_uuid', 'arvados_api_host', 'arvados_workbench_host']
13 website.config.h[v] = ENV[v]
18 file "sdk/python/arvados/index.html" do |t|
21 STDERR.puts `epydoc --html --parse-only -o sdk/python/arvados ../sdk/python/arvados/ 2>&1`
24 puts "Warning: epydoc not found, Python documentation will not be generated".colorize(:light_red)
28 file "sdk/R/arvados/index.html" do |t|
33 Dir.mkdir("sdk/R/arvados")
35 Dir.chdir("../sdk/R/") do
36 STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1`
37 Dir.entries("man").each do |rd|
38 if rd[-3..-1] == ".Rd"
39 htmlfile = "#{rd[0..-4]}.html"
40 `R CMD Rdconv -t html man/#{rd} > #{tgt}/sdk/R/arvados/#{htmlfile}`
47 File.open("sdk/R/README.md", "r") do |rd|
48 File.open("sdk/R/index.html.md", "w") do |fn|
54 title: "R SDK Overview"
57 #{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")}
63 File.open("sdk/R/arvados/index.html.textile.liquid", "w") do |fn|
72 Copyright (C) The Arvados Authors. All rights reserved.
74 SPDX-License-Identifier: CC-BY-SA-3.0
80 docfiles.sort.each do |d|
81 fn.write("* \"#{d[0..-6]}\":#{d}\n")
86 puts "Warning: R not found, R documentation will not be generated".colorize(:light_red)
90 file "sdk/java-v2/javadoc/index.html" do |t|
95 puts "Warning: gradle not found, java sdk documentation will not be generated".colorize(:light_red)
99 Dir.chdir("../sdk/java-v2") do
100 STDERR.puts `gradle javadoc 2>&1`
103 cp_r("../sdk/java-v2/build/docs/javadoc", "sdk/java-v2")
107 puts "Warning: java not found, java sdk documentation will not be generated".colorize(:light_red)
111 task :linkchecker => [ :generate ] do
112 Dir.chdir(".site") do
115 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
117 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
123 rm_rf "sdk/python/arvados"
125 rm_rf "sdk/java-v2/javadoc"
128 require "zenweb/tasks"
129 load "zenweb-textile.rb"
130 load "zenweb-liquid.rb"
132 task :extra_wirings do
133 $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html")