2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: CC-BY-SA-3.0
6 # As a convenience to the documentation writer, you can touch a file
7 # called 'no-sdk' in the 'doc' directory and it will suppress
8 # generating the documentation for the SDKs, which (the R docs
9 # especially) take a fair bit of time and slow down the edit-preview
15 task :generate => [ :realclean, 'sdk/python/arvados/index.html', 'sdk/R/arvados/index.html', 'sdk/java-v2/javadoc/index.html' ] do
16 vars = ['baseurl', 'arvados_cluster_uuid', 'arvados_api_host', 'arvados_workbench_host']
19 website.config.h[v] = ENV[v]
24 file "sdk/python/arvados/index.html" do |t|
25 if File.exists? "no-sdk"
30 STDERR.puts `epydoc --html --parse-only -o sdk/python/arvados ../sdk/python/arvados/ 2>&1`
33 puts "Warning: epydoc not found, Python documentation will not be generated".colorize(:light_red)
37 file "sdk/R/arvados/index.html" do |t|
38 if File.exists? "no-sdk"
45 Dir.mkdir("sdk/R/arvados")
47 Dir.chdir("../sdk/R/") do
48 STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1`
49 Dir.entries("man").each do |rd|
50 if rd[-3..-1] == ".Rd"
51 htmlfile = "#{rd[0..-4]}.html"
52 `R CMD Rdconv -t html man/#{rd} > #{tgt}/sdk/R/arvados/#{htmlfile}`
59 File.open("sdk/R/README.md", "r") do |rd|
60 File.open("sdk/R/index.html.md", "w") do |fn|
66 title: "R SDK Overview"
69 #{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")}
75 File.open("sdk/R/arvados/index.html.textile.liquid", "w") do |fn|
84 Copyright (C) The Arvados Authors. All rights reserved.
86 SPDX-License-Identifier: CC-BY-SA-3.0
92 docfiles.sort.each do |d|
93 fn.write("* \"#{d[0..-6]}\":#{d}\n")
98 puts "Warning: R not found, R documentation will not be generated".colorize(:light_red)
102 file "sdk/java-v2/javadoc/index.html" do |t|
103 if File.exists? "no-sdk"
110 puts "Warning: gradle not found, java sdk documentation will not be generated".colorize(:light_red)
114 Dir.chdir("../sdk/java-v2") do
115 STDERR.puts `gradle javadoc 2>&1`
118 cp_r("../sdk/java-v2/build/docs/javadoc", "sdk/java-v2")
122 puts "Warning: java not found, java sdk documentation will not be generated".colorize(:light_red)
126 task :linkchecker => [ :generate ] do
127 Dir.chdir(".site") do
130 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
132 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
138 rm_rf "sdk/python/arvados"
140 rm_rf "sdk/java-v2/javadoc"
143 require "zenweb/tasks"
144 load "zenweb-textile.rb"
145 load "zenweb-liquid.rb"
147 task :extra_wirings do
148 $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html")