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|
32 Dir.mkdir("sdk/R/arvados")
34 Dir.chdir("../sdk/R/") do
35 STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1`
36 Dir.entries("man").each do |rd|
37 if rd[-3..-1] == ".Rd"
38 htmlfile = "#{rd[0..-4]}.html"
39 `R CMD Rdconv -t html man/#{rd} > #{tgt}/sdk/R/arvados/#{htmlfile}`
46 File.open("sdk/R/README.md", "r") do |rd|
47 File.open("sdk/R/index.html.md", "w") do |fn|
53 title: "R SDK Overview"
56 #{rd.read.gsub("```", "\n~~~\n").gsub(/^[ ]+/, "")}
62 File.open("sdk/R/arvados/index.html.textile.liquid", "w") do |fn|
71 Copyright (C) The Arvados Authors. All rights reserved.
73 SPDX-License-Identifier: CC-BY-SA-3.0
79 docfiles.sort.each do |d|
80 fn.write("* \"#{d[0..-6]}\":#{d}\n")
85 puts "Warning: R not found, R documentation will not be generated".colorize(:light_red)
89 task :linkchecker => [ :generate ] do
93 system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus
95 puts "Warning: linkchecker not found, skipping run".colorize(:light_red)
101 rm_rf "sdk/python/arvados"
102 rm_rf "sdk/R/arvados"
103 rm_rf "../sdk/R/docs"
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")