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' ] do
10 vars = ['baseurl', 'arvados_api_host', 'arvados_workbench_host']
13 website.config.h[v] = ENV[v]
18 file "sdk/python/arvados/index.html" do |t|
21 STDERR.puts `epydoc --html --parse-only -o sdk/python/arvados ../sdk/python/arvados/ 2>&1`
24 puts "Warning: epydoc not found, Python documentation will not be generated".colorize(:light_red)
28 file "sdk/R/arvados/index.html" do |t|
33 Dir.mkdir("sdk/R/arvados")
35 Dir.chdir("../sdk/R/") do
36 STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1`
37 Dir.entries("man").each do |rd|
38 if rd[-3..-1] == ".Rd"
39 htmlfile = "#{rd[0..-4]}.html"
40 `R CMD Rdconv -t html man/#{rd} > #{tgt}/sdk/R/arvados/#{htmlfile}`
47 File.open("sdk/R/README.md", "r") do |rd|
48 File.open("sdk/R/index.html.md", "w") do |fn|
54 title: "R SDK Overview"
57 #{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")}
63 File.open("sdk/R/arvados/index.html.textile.liquid", "w") do |fn|
72 Copyright (C) The Arvados Authors. All rights reserved.
74 SPDX-License-Identifier: CC-BY-SA-3.0
80 docfiles.sort.each do |d|
81 fn.write("* \"#{d[0..-6]}\":#{d}\n")
86 puts "Warning: R not found, R documentation will not be generated".colorize(:light_red)
90 task :linkchecker => [ :generate ] do
94 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
96 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
102 rm_rf "sdk/python/arvados"
106 require "zenweb/tasks"
107 load "zenweb-textile.rb"
108 load "zenweb-liquid.rb"
110 task :extra_wirings do
111 $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html")