From 86e1c029aab37a0c1ef57b133f55ba91ba81ed17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 12 Nov 2024 12:24:04 +0100 Subject: [PATCH] docs: use rlang::is_interactive(), override for pkgdown website --- .github/workflows/pkgdown.yaml | 4 +++- R/client.R | 2 +- R/emodnet_wfs.R | 2 +- R/info.R | 2 +- R/layer_attributes.R | 10 +++++----- R/layers.R | 2 +- man/emodnet_get_layers.Rd | 2 +- man/emodnet_get_wfs_info.Rd | 2 +- man/emodnet_init_wfs_client.Rd | 2 +- man/emodnet_wfs.Rd | 2 +- man/layer_attribute_descriptions.Rd | 2 +- man/layer_attribute_inspect.Rd | 2 +- man/layer_attributes_get_names.Rd | 2 +- man/layer_attributes_summarise.Rd | 2 +- man/layer_attributes_tbl.Rd | 2 +- 15 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index ef7cc67..483f764 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -35,7 +35,9 @@ jobs: needs: website - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, run_dont_run = TRUE) + run: | + options(rlang_interactive = TRUE) + pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, run_dont_run = TRUE) shell: Rscript {0} - name: Deploy to GitHub pages 🚀 diff --git a/R/client.R b/R/client.R index c66006c..77a8e78 100644 --- a/R/client.R +++ b/R/client.R @@ -15,7 +15,7 @@ #' @export #' #' @seealso `WFSClient` in package `ows4R`. -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' wfs <- emodnet_init_wfs_client(service = "bathymetry") emodnet_init_wfs_client <- function(service, service_version = NULL, diff --git a/R/emodnet_wfs.R b/R/emodnet_wfs.R index 7c2f544..e2444d1 100644 --- a/R/emodnet_wfs.R +++ b/R/emodnet_wfs.R @@ -10,7 +10,7 @@ #' #' @return Tibble of available EMODnet Web Feature Services #' -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' emodnet_wfs() #' @export emodnet_wfs <- memoise::memoise(.emodnet_wfs) diff --git a/R/info.R b/R/info.R index e54abfb..0e1aa00 100644 --- a/R/info.R +++ b/R/info.R @@ -91,7 +91,7 @@ emodnet_get_layer_info <- memoise::memoise(.emodnet_get_layer_info) #' @export #' @describeIn emodnet_get_wfs_info Get info on all layers from #' an EMODnet WFS service. -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' emodnet_get_wfs_info(service = "bathymetry") #' # Query a wfs object #' wfs_bio <- emodnet_init_wfs_client("biology") diff --git a/R/layer_attributes.R b/R/layer_attributes.R index aa72b5f..59720a8 100644 --- a/R/layer_attributes.R +++ b/R/layer_attributes.R @@ -10,7 +10,7 @@ #' @family attributes #' @export #' -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' layer_attributes_summarise( #' service = "biology", #' layer = "mediseh_zostera_m_pnt" @@ -44,7 +44,7 @@ layer_attributes_summarise <- function(wfs = NULL, #' @family attributes #' @export #' -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' layer_attribute_descriptions( #' service = "biology", #' layer = "mediseh_zostera_m_pnt" @@ -76,7 +76,7 @@ layer_attribute_descriptions <- function(wfs = NULL, #' @return character vector of layer attribute (variable) names. #' @export #' -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' layer_attributes_get_names( #' service = "biology", #' layer = "mediseh_zostera_m_pnt" @@ -114,7 +114,7 @@ layer_attributes_get_names <- function(wfs = NULL, #' @family attributes #' @export #' -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' wfs <- emodnet_init_wfs_client(service = "biology") #' layer_attributes_get_names(wfs, layer = "mediseh_zostera_m_pnt") #' layer_attribute_inspect( @@ -183,7 +183,7 @@ layer_attribute_inspect <- function(wfs = NULL, #' @family attributes #' @export #' -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' layer_attributes_tbl(service = "biology", layer = "mediseh_zostera_m_pnt") layer_attributes_tbl <- function(wfs = NULL, service = NULL, diff --git a/R/layers.R b/R/layers.R index bc4633f..a0c34cf 100644 --- a/R/layers.R +++ b/R/layers.R @@ -41,7 +41,7 @@ #' an `sf` out of a single layer request instead of a list of length 1. #' @export #' -#' @examplesIf interactive() +#' @examplesIf rlang::is_interactive() #' # Layers as character vector #' emodnet_get_layers( #' service = "biology", diff --git a/man/emodnet_get_layers.Rd b/man/emodnet_get_layers.Rd index 0d6319c..60e9410 100644 --- a/man/emodnet_get_layers.Rd +++ b/man/emodnet_get_layers.Rd @@ -85,7 +85,7 @@ you might consider a combination of these ideas: } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Layers as character vector emodnet_get_layers( service = "biology", diff --git a/man/emodnet_get_wfs_info.Rd b/man/emodnet_get_wfs_info.Rd index 03d08cf..6c16c29 100644 --- a/man/emodnet_get_wfs_info.Rd +++ b/man/emodnet_get_wfs_info.Rd @@ -56,7 +56,7 @@ services from server. }} \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} emodnet_get_wfs_info(service = "bathymetry") # Query a wfs object wfs_bio <- emodnet_init_wfs_client("biology") diff --git a/man/emodnet_init_wfs_client.Rd b/man/emodnet_init_wfs_client.Rd index 6e96241..0d5436f 100644 --- a/man/emodnet_init_wfs_client.Rd +++ b/man/emodnet_init_wfs_client.Rd @@ -25,7 +25,7 @@ OGC Web Feature Service. Initialise an EMODnet WFS client } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} wfs <- emodnet_init_wfs_client(service = "bathymetry") \dontshow{\}) # examplesIf} } diff --git a/man/emodnet_wfs.Rd b/man/emodnet_wfs.Rd index 0f85e1f..c7b870c 100644 --- a/man/emodnet_wfs.Rd +++ b/man/emodnet_wfs.Rd @@ -13,7 +13,7 @@ Tibble of available EMODnet Web Feature Services Available EMODnet Web Feature Services } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} emodnet_wfs() \dontshow{\}) # examplesIf} } diff --git a/man/layer_attribute_descriptions.Rd b/man/layer_attribute_descriptions.Rd index c7e032f..819b0d1 100644 --- a/man/layer_attribute_descriptions.Rd +++ b/man/layer_attribute_descriptions.Rd @@ -31,7 +31,7 @@ data.frame containing layer attribute descriptions (metadata). Get layer attribute description } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attribute_descriptions( service = "biology", layer = "mediseh_zostera_m_pnt" diff --git a/man/layer_attribute_inspect.Rd b/man/layer_attribute_inspect.Rd index 2e559c5..b17d87e 100644 --- a/man/layer_attribute_inspect.Rd +++ b/man/layer_attribute_inspect.Rd @@ -38,7 +38,7 @@ factor or character variable levels or unique values. Inspect layer attributes } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} wfs <- emodnet_init_wfs_client(service = "biology") layer_attributes_get_names(wfs, layer = "mediseh_zostera_m_pnt") layer_attribute_inspect( diff --git a/man/layer_attributes_get_names.Rd b/man/layer_attributes_get_names.Rd index 5ee0f35..90d8ecd 100644 --- a/man/layer_attributes_get_names.Rd +++ b/man/layer_attributes_get_names.Rd @@ -33,7 +33,7 @@ Names of variables (attributes) available from a dataset (layer) in a data source (service). } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attributes_get_names( service = "biology", layer = "mediseh_zostera_m_pnt" diff --git a/man/layer_attributes_summarise.Rd b/man/layer_attributes_summarise.Rd index fc73e41..0e9b828 100644 --- a/man/layer_attributes_summarise.Rd +++ b/man/layer_attributes_summarise.Rd @@ -32,7 +32,7 @@ for a given service. Get summaries of layer attributes (variables) } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attributes_summarise( service = "biology", layer = "mediseh_zostera_m_pnt" diff --git a/man/layer_attributes_tbl.Rd b/man/layer_attributes_tbl.Rd index 3cd6952..3699fa8 100644 --- a/man/layer_attributes_tbl.Rd +++ b/man/layer_attributes_tbl.Rd @@ -35,7 +35,7 @@ for more targeted and faster layer download. } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (rlang::is_interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attributes_tbl(service = "biology", layer = "mediseh_zostera_m_pnt") \dontshow{\}) # examplesIf} }