From: Peter Amstutz Date: Fri, 9 Feb 2018 14:14:51 +0000 (-0500) Subject: 11876: Build R SDK reference pages for doc site X-Git-Tag: 1.1.4~89^2~4 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/4fca56d2393f754a0f8ff21225fd975ca4b1f782 11876: Build R SDK reference pages for doc site Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/.gitignore b/.gitignore index d41eaeea5f..cc4f17e9ab 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ docker/*/generated docker/config.yml doc/.site doc/sdk/python/arvados +doc/sdk/R/arvados sdk/perl/MYMETA.* sdk/perl/Makefile sdk/perl/blib diff --git a/build/run-tests.sh b/build/run-tests.sh index 4ebaf07c13..ec3c463770 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -249,6 +249,8 @@ sanity_checks() { R -q -e "library('testthat')" || fatal "No testthat. Try: apt-get install r-cran-testthat" # needed for roxygen2, needed for devtools, needed for R sdk pkg-config --exists libxml-2.0 || fatal "No libxml2. Try: apt-get install libxml2-dev" + # needed for pkgdown, builds R SDK doc pages + which pandoc || fatal "No pandoc. Try: apt-get install pandoc" } rotate_logfile() { @@ -786,6 +788,9 @@ if (!requireNamespace("devtools")) { if (!requireNamespace("roxygen2")) { install.packages("roxygen2") } +if (!requireNamespace("pkgdown")) { + devtools::install_github("hadley/pkgdown") +} devtools::install_dev_deps() EOF } diff --git a/doc/Rakefile b/doc/Rakefile index f68a96471d..10bb8b9616 100644 --- a/doc/Rakefile +++ b/doc/Rakefile @@ -6,7 +6,7 @@ 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] @@ -25,6 +25,17 @@ file "sdk/python/arvados/index.html" do |t| end end +file "sdk/R/arvados/index.html" do |t| + `which R` + if $? == 0 + STDERR.puts `R --quiet --vanilla -e 'pkgdown::build_site(pkg="../sdk/R/")' 2>&1` + 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` @@ -38,6 +49,7 @@ end task :clean do rm_rf "sdk/python/arvados" + rm_rf "sdk/R/arvados" end require "zenweb/tasks" diff --git a/doc/_config.yml b/doc/_config.yml index 08b581c0d7..680f940f26 100644 --- a/doc/_config.yml +++ b/doc/_config.yml @@ -103,6 +103,8 @@ navbar: - Go: - sdk/go/index.html.textile.liquid - sdk/go/example.html.textile.liquid + - R: + - sdk/R/R.html.textile.liquid - Perl: - sdk/perl/index.html.textile.liquid - sdk/perl/example.html.textile.liquid diff --git a/doc/sdk/R/R.html.textile.liquid b/doc/sdk/R/R.html.textile.liquid new file mode 100644 index 0000000000..7b788a16a5 --- /dev/null +++ b/doc/sdk/R/R.html.textile.liquid @@ -0,0 +1,15 @@ +--- +layout: default +navsection: sdk +navmenu: R +title: "R Reference" + +no_nav_left: true +... +{% comment %} +Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: CC-BY-SA-3.0 +{% endcomment %} + +notextile.