13076: Get rid of pkgdown, just call knitr
[arvados.git] / doc / Rakefile
index ab5a2ea5e2b12fba9bfb7bcf319248ecdf0d56fe..4870eb19e246621c76589213c22ed2f9f31bef85 100644 (file)
@@ -1,9 +1,12 @@
 #!/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' ] do
+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]
@@ -22,6 +25,19 @@ file "sdk/python/arvados/index.html" do |t|
   end
 end
 
+file "sdk/R/arvados/index.html" do |t|
+  `which R`
+  if $? == 0
+    Dir.chdir("../sdk/R/") do
+      STDERR.puts `Rscript createDoc.R README.Rmd index.html 2>&1`
+    end
+    raise if $? != 0
+    cp_r("../sdk/R/README.html", "sdk/R/")
+  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`
@@ -35,6 +51,8 @@ end
 
 task :clean do
   rm_rf "sdk/python/arvados"
+  rm_rf "sdk/R/arvados"
+  rm_rf "../sdk/R/docs"
 end
 
 require "zenweb/tasks"