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
17 @binary_files = %w[png jpg gif eot svg ttf woff2? ico pdf m4a t?gz xlsx]
21 task :generate => [ :realclean, 'sdk/python/arvados/index.html', 'sdk/R/arvados/index.html', 'sdk/java-v2/javadoc/index.html' ] do
22 vars = ['baseurl', 'arvados_cluster_uuid', 'arvados_api_host', 'arvados_workbench_host']
23 if ! ENV.key?('baseurl') || ENV['baseurl'] == ""
24 if !ENV.key?('WORKSPACE') || ENV['WORKSPACE'] == ""
25 puts "The `baseurl` variable was not specified and the `WORKSPACE` environment variable is not set. Defaulting `baseurl` to file://#{pwd}/.site"
26 ENV['baseurl'] = "file://#{pwd}/.site/"
28 puts "The `baseurl` variable was not specified, defaulting to a value derived from the `WORKSPACE` environment variable"
29 ENV['baseurl'] = "file://#{ENV['WORKSPACE']}/doc/.site/"
34 website.config.h[v] = ENV[v]
39 file ["install/new_cluster_checklist_Azure.xlsx", "install/new_cluster_checklist_AWS.xlsx"] do |t|
43 file "sdk/python/arvados/index.html" do |t|
44 if ENV['NO_SDK'] || File.exists?("no-sdk")
49 STDERR.puts `pdoc --html -o sdk/python ../sdk/python/arvados/ 2>&1`
52 puts "Warning: pdoc3 not found, Python documentation will not be generated".colorize(:light_red)
56 file "sdk/R/arvados/index.html" do |t|
57 if ENV['NO_SDK'] || File.exists?("no-sdk")
64 Dir.mkdir("sdk/R/arvados")
66 cp('css/R.css', 'sdk/R/arvados')
68 Dir.chdir("../sdk/R/") do
69 STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1`
70 Dir.entries("man").each do |rd|
71 if rd[-3..-1] == ".Rd"
72 htmlfile = "#{rd[0..-4]}.html"
73 `R CMD Rdconv -t html man/#{rd} > #{tgt}/sdk/R/arvados/#{htmlfile}`
80 File.open("sdk/R/README.md", "r") do |rd|
81 File.open("sdk/R/index.html.md", "w") do |fn|
87 title: "R SDK Overview"
90 #{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")}
96 File.open("sdk/R/arvados/index.html.textile.liquid", "w") do |fn|
105 Copyright (C) The Arvados Authors. All rights reserved.
107 SPDX-License-Identifier: CC-BY-SA-3.0
113 docfiles.sort.each do |d|
114 fn.write("* \"#{d[0..-6]}\":#{d}\n")
119 puts "Warning: R not found, R documentation will not be generated".colorize(:light_red)
123 file "sdk/java-v2/javadoc/index.html" do |t|
124 if ENV['NO_SDK'] || File.exists?("no-sdk")
131 puts "Warning: gradle not found, java sdk documentation will not be generated".colorize(:light_red)
135 Dir.chdir("../sdk/java-v2") do
136 STDERR.puts `gradle javadoc 2>&1`
138 puts `sed -i "s/@import.*dejavu.css.*//g" build/docs/javadoc/stylesheet.css`
141 cp_r("../sdk/java-v2/build/docs/javadoc", "sdk/java-v2")
145 puts "Warning: java not found, java sdk documentation will not be generated".colorize(:light_red)
149 task :linkchecker => [ :generate ] do
150 Dir.chdir(".site") do
153 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
155 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
160 task :import_vscode_training do
162 rm_rf "arvados-vscode-cwl-training"
163 `git clone https://github.com/arvados/arvados-vscode-cwl-training`
164 githash = `git --git-dir arvados-vscode-cwl-training/.git log -n1 --format=%H HEAD`
165 File.open("cwl/arvados-vscode-training.html.md.liquid", "w") do |fn|
166 File.open("arvados-vscode-cwl-training/README.md", "r") do |rd|
170 navsection: userguide
171 title: "Developing CWL Workflows with VSCode"
174 Copyright (C) The Arvados Authors. All rights reserved.
176 SPDX-License-Identifier: CC-BY-SA-3.0
178 Imported from https://github.com/arvados/arvados-vscode-cwl-training
187 rm_rf "arvados-vscode-cwl-training"
192 rm_rf "sdk/python/arvados"
194 rm_rf "sdk/java-v2/javadoc"
197 require "zenweb/tasks"
198 load "zenweb-textile.rb"
199 load "zenweb-liquid.rb"
200 load "zenweb-fix-body.rb"
202 task :extra_wirings do
203 $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html")