From 56ce35c25aeec06eabd6e93c8c44486b8c9c45e6 Mon Sep 17 00:00:00 2001 From: Salim B Date: Mon, 11 Mar 2024 16:30:59 +0100 Subject: [PATCH] cosmetic style fixes (#2353) --- R/build-reference.R | 13 ++++++++----- R/build.R | 18 +++++++++--------- R/rd-example.R | 3 +-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/R/build-reference.R b/R/build-reference.R index 66a62e23ec..3ebb37c222 100644 --- a/R/build-reference.R +++ b/R/build-reference.R @@ -189,7 +189,8 @@ build_reference <- function(pkg = ".", topics <- purrr::transpose(pkg$topics) } - purrr::map(topics, + purrr::map( + topics, build_reference_topic, pkg = pkg, lazy = lazy, @@ -269,8 +270,7 @@ build_reference_topic <- function(topic, pkg, lazy = TRUE, examples_env = globalenv(), - run_dont_run = FALSE - ) { + run_dont_run = FALSE ) { in_path <- path(pkg$src_path, "man", topic$file_in) out_path <- path(pkg$dst_path, "reference", topic$file_out) @@ -297,12 +297,14 @@ build_reference_topic <- function(topic, if (data$has_deps) { deps <- bs_theme_deps_suppress(deps) deps <- htmltools::resolveDependencies(deps) - deps <- purrr::map(deps, + deps <- purrr::map( + deps, htmltools::copyDependencyToDir, outputDir = file.path(pkg$dst_path, "reference", "libs"), mustWork = FALSE ) - deps <- purrr::map(deps, + deps <- purrr::map( + deps, htmltools::makeDependencyRelative, basepath = file.path(pkg$dst_path, "reference"), mustWork = FALSE @@ -326,6 +328,7 @@ data_reference_topic <- function(topic, pkg, examples_env = globalenv(), run_dont_run = FALSE) { + local_context_eval(pkg$figures, pkg$src_path) withr::local_options(list(downlit.rdname = get_rdname(topic))) diff --git a/R/build.R b/R/build.R index f455f9b316..421010fd9a 100644 --- a/R/build.R +++ b/R/build.R @@ -415,14 +415,13 @@ build_site_external <- function(pkg = ".", } build_site_local <- function(pkg = ".", - examples = TRUE, - run_dont_run = FALSE, - seed = 1014, - lazy = FALSE, - override = list(), - preview = NA, - devel = TRUE - ) { + examples = TRUE, + run_dont_run = FALSE, + seed = 1014, + lazy = FALSE, + override = list(), + preview = NA, + devel = TRUE) { pkg <- section_init(pkg, depth = 0, override = override) @@ -433,7 +432,8 @@ build_site_local <- function(pkg = ".", init_site(pkg) build_home(pkg, override = override, preview = FALSE) - build_reference(pkg, + build_reference( + pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, diff --git a/R/rd-example.R b/R/rd-example.R index ee54d2cf94..8738150d55 100644 --- a/R/rd-example.R +++ b/R/rd-example.R @@ -13,8 +13,7 @@ rd2ex <- function(x, ...) { run_examples <- function(x, topic = "unknown", env = globalenv(), - run_dont_run = FALSE - ) { + run_dont_run = FALSE) { if (!inherits(x, "tag")) { x <- rd_text(x)