From feb7312115667f69cdac053f8b4d118ef9c22fbf Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 16 May 2020 16:39:16 -0500 Subject: [PATCH 1/4] [R-package] [docs] replace build_r_site.R with pkgdown::build_site() --- 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..1f4a79c82c5a 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'); + pkgdown::build_site( + lazy = FALSE + , install = FALSE + , devel = FALSE + , examples = TRUE + , run_dont_run = FALSE + , seed = 42L + , preview = FALSE + ) + " + 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. From 058a22f244cb3aa4c8d9c431791919af6d618081 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 16 May 2020 16:48:50 -0500 Subject: [PATCH 2/4] fix paths --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 1f4a79c82c5a..d3a9fe36b66e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -254,7 +254,7 @@ def generate_r_docs(app): ) " cd {0} - """.format(os.path.join(CURR_PATH, os.path.pardir), os.path.join(CURR_PATH, os.path.pardir), "lightgbm_r") + """.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. From bdb6c540fb8847b2242180bbc4b0e2d23379d909 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 16 May 2020 18:39:14 -0500 Subject: [PATCH 3/4] fix continuation --- docs/conf.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d3a9fe36b66e..2b3da38a6a35 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -241,17 +241,16 @@ def generate_r_docs(app): export R_LIBS="$CONDA_PREFIX/lib/R/library" Rscript build_r.R cd {1} - Rscript -e " - roxygen2::roxygenize(load = 'installed'); - pkgdown::build_site( - lazy = FALSE - , install = FALSE - , devel = FALSE - , examples = TRUE - , run_dont_run = FALSE - , seed = 42L - , preview = FALSE - ) + 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 \ + ) \ " cd {0} """.format(os.path.join(CURR_PATH, os.path.pardir), os.path.join(CURR_PATH, os.path.pardir, "lightgbm_r")) From c428cb09328a640246419b6077221a088fc85958 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 17 May 2020 11:30:55 -0500 Subject: [PATCH 4/4] new_process arg --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 2b3da38a6a35..731465fef76a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -250,6 +250,7 @@ def generate_r_docs(app): , run_dont_run = FALSE \ , seed = 42L \ , preview = FALSE \ + , new_process = TRUE \ ) \ " cd {0}