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']
25 website.config.h[v] = ENV[v]
30 file ["install/new_cluster_checklist_Azure.xlsx", "install/new_cluster_checklist_AWS.xlsx"] do |t|
34 file "sdk/python/arvados/index.html" do |t|
35 if ENV['NO_SDK'] || File.exists?("no-sdk")
40 STDERR.puts `epydoc --html --parse-only -o sdk/python/arvados ../sdk/python/arvados/ 2>&1`
43 puts "Warning: epydoc not found, Python documentation will not be generated".colorize(:light_red)
47 file "sdk/R/arvados/index.html" do |t|
48 if ENV['NO_SDK'] || File.exists?("no-sdk")
55 Dir.mkdir("sdk/R/arvados")
57 cp('css/R.css', 'sdk/R/arvados')
59 Dir.chdir("../sdk/R/") do
60 STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1`
61 Dir.entries("man").each do |rd|
62 if rd[-3..-1] == ".Rd"
63 htmlfile = "#{rd[0..-4]}.html"
64 `R CMD Rdconv -t html man/#{rd} > #{tgt}/sdk/R/arvados/#{htmlfile}`
71 File.open("sdk/R/README.md", "r") do |rd|
72 File.open("sdk/R/index.html.md", "w") do |fn|
78 title: "R SDK Overview"
81 #{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")}
87 File.open("sdk/R/arvados/index.html.textile.liquid", "w") do |fn|
96 Copyright (C) The Arvados Authors. All rights reserved.
98 SPDX-License-Identifier: CC-BY-SA-3.0
104 docfiles.sort.each do |d|
105 fn.write("* \"#{d[0..-6]}\":#{d}\n")
110 puts "Warning: R not found, R documentation will not be generated".colorize(:light_red)
114 file "sdk/java-v2/javadoc/index.html" do |t|
115 if ENV['NO_SDK'] || File.exists?("no-sdk")
122 puts "Warning: gradle not found, java sdk documentation will not be generated".colorize(:light_red)
126 Dir.chdir("../sdk/java-v2") do
127 STDERR.puts `gradle javadoc 2>&1`
129 puts `sed -i "s/@import.*dejavu.css.*//g" build/docs/javadoc/stylesheet.css`
132 cp_r("../sdk/java-v2/build/docs/javadoc", "sdk/java-v2")
136 puts "Warning: java not found, java sdk documentation will not be generated".colorize(:light_red)
140 task :linkchecker => [ :generate ] do
141 Dir.chdir(".site") do
144 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
146 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
152 rm_rf "sdk/python/arvados"
154 rm_rf "sdk/java-v2/javadoc"
157 require "zenweb/tasks"
158 load "zenweb-textile.rb"
159 load "zenweb-liquid.rb"
160 load "zenweb-fix-body.rb"
162 task :extra_wirings do
163 $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html")