From a51b64600c2bb1d3209edc7299ebdf1784db5c1c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 17 May 2020 18:55:09 +0100 Subject: [PATCH] [R-package] [docs] replace build_r_site.R with pkgdown::build_site() (#3098) * [R-package] [docs] replace build_r_site.R with pkgdown::build_site() * fix paths * fix continuation * new_process arg --- build_r_site.R | 20 -------------------- docs/conf.py | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 22 deletions(-) delete mode 100644 build_r_site.R diff --git a/build_r_site.R b/build_r_site.R deleted file mode 100644 index 91267cca9262..000000000000 --- a/build_r_site.R +++ /dev/null @@ -1,20 +0,0 @@ -library(pkgdown) -library(roxygen2) - -setwd("lightgbm_r") -if (!dir.exists("docs")) { - dir.create("docs") -} - -roxygen2::roxygenize(load = "installed") -pkgdown::clean_site() -pkgdown::init_site() -pkgdown::build_home(preview = FALSE, quiet = FALSE) -pkgdown::build_reference( - lazy = FALSE - , devel = FALSE - , examples = TRUE - , run_dont_run = FALSE - , seed = 42L - , preview = FALSE -) diff --git a/docs/conf.py b/docs/conf.py index d424aabd522b..731465fef76a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -240,8 +240,21 @@ def generate_r_docs(app): cd {0} export R_LIBS="$CONDA_PREFIX/lib/R/library" Rscript build_r.R - Rscript build_r_site.R - """.format(os.path.join(CURR_PATH, os.path.pardir)) + cd {1} + Rscript -e "roxygen2::roxygenize(load = 'installed')" + Rscript -e "pkgdown::build_site( \ + lazy = FALSE \ + , install = FALSE \ + , devel = FALSE \ + , examples = TRUE \ + , run_dont_run = FALSE \ + , seed = 42L \ + , preview = FALSE \ + , new_process = TRUE \ + ) \ + " + cd {0} + """.format(os.path.join(CURR_PATH, os.path.pardir), os.path.join(CURR_PATH, os.path.pardir, "lightgbm_r")) try: # Warning! The following code can cause buffer overflows on RTD. # Consider suppressing output completely if RTD project silently fails.