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 task :generate => [ :realclean, 'sdk/python/arvados/index.html', 'sdk/java-v2/javadoc/index.html' ] do
11 vars = ['baseurl', 'arvados_cluster_uuid', 'arvados_api_host', 'arvados_workbench_host']
14 website.config.h[v] = ENV[v]
19 file "sdk/python/arvados/index.html" do |t|
22 STDERR.puts `epydoc --html --parse-only -o sdk/python/arvados ../sdk/python/arvados/ 2>&1`
25 puts "Warning: epydoc not found, Python documentation will not be generated".colorize(:light_red)
29 file "sdk/R/arvados/index.html" do |t|
34 Dir.mkdir("sdk/R/arvados")
36 Dir.chdir("../sdk/R/") do
37 STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1`
38 Dir.entries("man").each do |rd|
39 if rd[-3..-1] == ".Rd"
40 htmlfile = "#{rd[0..-4]}.html"
41 `R CMD Rdconv -t html man/#{rd} > #{tgt}/sdk/R/arvados/#{htmlfile}`
48 File.open("sdk/R/README.md", "r") do |rd|
49 File.open("sdk/R/index.html.md", "w") do |fn|
55 title: "R SDK Overview"
58 #{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")}
64 File.open("sdk/R/arvados/index.html.textile.liquid", "w") do |fn|
73 Copyright (C) The Arvados Authors. All rights reserved.
75 SPDX-License-Identifier: CC-BY-SA-3.0
81 docfiles.sort.each do |d|
82 fn.write("* \"#{d[0..-6]}\":#{d}\n")
87 puts "Warning: R not found, R documentation will not be generated".colorize(:light_red)
91 file "sdk/java-v2/javadoc/index.html" do |t|
96 Dir.chdir("../sdk/java-v2") do
97 STDERR.puts `gradle javadoc 2>&1`
99 cp_r("../sdk/java-v2/build/docs/javadoc", "sdk/java-v2")
102 puts "Warning: java not found, java sdk documentation will not be generated".colorize(:light_red)
106 task :linkchecker => [ :generate ] do
107 Dir.chdir(".site") do
110 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
112 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
118 rm_rf "sdk/python/arvados"
120 rm_rf "sdk/java-v2/javadoc"
123 require "zenweb/tasks"
124 load "zenweb-textile.rb"
125 load "zenweb-liquid.rb"
127 task :extra_wirings do
128 $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html")