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 puts "Warning: gradle not found, java sdk documentation will not be generated".colorize(:light_red)
100 Dir.chdir("../sdk/java-v2") do
101 STDERR.puts `gradle javadoc 2>&1`
104 cp_r("../sdk/java-v2/build/docs/javadoc", "sdk/java-v2")
108 puts "Warning: java not found, java sdk documentation will not be generated".colorize(:light_red)
112 task :linkchecker => [ :generate ] do
113 Dir.chdir(".site") do
116 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
118 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
124 rm_rf "sdk/python/arvados"
126 rm_rf "sdk/java-v2/javadoc"
129 require "zenweb/tasks"
130 load "zenweb-textile.rb"
131 load "zenweb-liquid.rb"
133 task :extra_wirings do
134 $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html")