From 17284db809512ade9d0f7ddc17ef476c713a16f9 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 6 Jan 2025 17:06:23 -0600 Subject: [PATCH] get rid of xfun::attr(): https://github.com/yihui/xfun/pull/96 --- DESCRIPTION | 4 ++-- NAMESPACE | 1 - R/package.R | 2 +- R/render.R | 4 ++-- R/utils.R | 2 ++ blogdown.Rproj | 1 + 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b17e1291..e05720da 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: blogdown Title: Create Blogs and Websites with R Markdown -Version: 1.19.1 +Version: 1.19.2 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("Christophe", "Dervieux", role = "aut", email = "cderv@posit.co", comment = c(ORCID = "0000-0003-4474-2498")), @@ -66,5 +66,5 @@ Suggests: whoami Config/Needs/website: pkgdown, tidyverse/tidytemplate, rstudio/quillt, rstudio/webshot2 Encoding: UTF-8 -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 SystemRequirements: Hugo () and Pandoc () diff --git a/NAMESPACE b/NAMESPACE index 890ead96..cd284b84 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -52,7 +52,6 @@ export(write_toml) export(yaml2toml) import(stats) import(utils) -importFrom(xfun,attr) importFrom(xfun,del_empty_dir) importFrom(xfun,dir_create) importFrom(xfun,dir_exists) diff --git a/R/package.R b/R/package.R index 37074247..32297491 100644 --- a/R/package.R +++ b/R/package.R @@ -11,7 +11,7 @@ #' @aliases blogdown-package #' @import utils #' @import stats -#' @importFrom xfun attr in_dir read_utf8 write_utf8 is_windows is_macos +#' @importFrom xfun in_dir read_utf8 write_utf8 is_windows is_macos #' file_exists dir_exists file_ext msg_cat dir_create del_empty_dir proc_kill #' set_envvar exit_call existing_files #' @examples if (interactive()) blogdown::new_site() diff --git a/R/render.R b/R/render.R index 00d76dec..d8349fb4 100644 --- a/R/render.R +++ b/R/render.R @@ -218,9 +218,9 @@ build_one = function(input, output, to_md = file_ext(output) != 'html', quiet = } process_markdown = function(res, x = read_utf8(res)) { - unlink(xfun::attr(res, 'intermediates')) + unlink(attr(res, 'intermediates')) # write HTML dependencies to the body of Markdown - if (length(meta <- xfun::attr(res, 'knit_meta'))) { + if (length(meta <- attr(res, 'knit_meta'))) { m = rmarkdown:::html_dependencies_as_string(meta, attr(res, 'files_dir'), '.') if (length(i <- grep('^---\\s*$', x)) >= 2) { x = append(x, m, i[2]) diff --git a/R/utils.R b/R/utils.R index 142a6235..a42cb9c7 100644 --- a/R/utils.R +++ b/R/utils.R @@ -36,6 +36,8 @@ pkg_file = function(..., mustWork = TRUE) { system.file(..., package = 'blogdown', mustWork = mustWork) } +attr = function(...) base::attr(..., exact = TRUE) + # tempfile under the current working directory wd_tempfile = function(..., pattern = '') { basename(tempfile(pattern, '.', ...)) diff --git a/blogdown.Rproj b/blogdown.Rproj index dc02f441..66062e14 100644 --- a/blogdown.Rproj +++ b/blogdown.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 7de02ffc-a200-4611-bc07-18b265ee1be3 RestoreWorkspace: Default SaveWorkspace: Default