X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/da51b9328abab2df757ed13eadc7c3557315094b..5d164d74505c232cfa232d69a56273da2d02b72a:/doc/Rakefile diff --git a/doc/Rakefile b/doc/Rakefile index 65d2855077..eaa5410100 100644 --- a/doc/Rakefile +++ b/doc/Rakefile @@ -1,7 +1,64 @@ #!/usr/bin/env rake +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: CC-BY-SA-3.0 require "rubygems" +require "colorize" + +task :generate => [ :realclean, 'sdk/python/arvados/index.html', 'sdk/R/arvados/index.html' ] do + vars = ['baseurl', 'arvados_api_host', 'arvados_workbench_host'] + vars.each do |v| + if ENV[v] + website.config.h[v] = ENV[v] + end + end +end + +file "sdk/python/arvados/index.html" do |t| + `which epydoc` + if $? == 0 + STDERR.puts `epydoc --html --parse-only -o sdk/python/arvados ../sdk/python/arvados/ 2>&1` + raise if $? != 0 + else + puts "Warning: epydoc not found, Python documentation will not be generated".colorize(:light_red) + end +end + +file "sdk/R/arvados/index.html" do |t| + `which R` + if $? == 0 + Dir.chdir("../sdk/R/") do + STDERR.puts `R --quiet --vanilla -e 'pkgdown::build_site()' 2>&1` + end + raise if $? != 0 + cp_r("../sdk/R/docs", "sdk/R/arvados") + else + puts "Warning: R not found, R documentation will not be generated".colorize(:light_red) + end +end + +task :linkchecker => [ :generate ] do + Dir.chdir(".site") do + `which linkchecker` + if $? == 0 + system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus + else + puts "Warning: linkchecker not found, skipping run".colorize(:light_red) + end + end +end + +task :clean do + rm_rf "sdk/python/arvados" + rm_rf "sdk/R/arvados" + rm_rf "../sdk/R/docs" +end + require "zenweb/tasks" load "zenweb-textile.rb" load "zenweb-liquid.rb" +task :extra_wirings do + $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html") +end