Skip to content

Commit

Permalink
downlit: code review 1
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Apr 8, 2024
1 parent bdd2c9b commit 4a75c2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions R/autolink.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.autolink <- function(path = ".") {
# everything wrapped in tryCatch() because especially error prone with weird pandoc memory errors
html_files <- c(tryCatch(fs::dir_ls(fs::path_join(c(path, "docs/vignettes")), regexp = "\\.html$"), error = function(e) NULL),
tryCatch(fs::dir_ls(fs::path_join(c(path, "docs/man")), regexp = "\\.html$"), error = function(e) NULL))
html_files <- c(
fs::dir_ls(fs::path_join(c(path, "docs/vignettes")), regexp = "\\.html$", fail = FALSE),
fs::dir_ls(fs::path_join(c(path, "docs/man")), regexp = "\\.html$", fail = FALSE))
for (h in html_files) {
tmp <- try(downlit::downlit_html_path(h, h), silent = TRUE)
if (inherits(tmp, "try-error")) {
cli::cli_alert_danger(sprintf("Failed to auto-link: %s", h))
}

}

md_files <- c(
tryCatch(fs::dir_ls(fs::path_join(c(path, "docs/vignettes")), regexp = "\\.md$"), error = function(e) NULL),
tryCatch(fs::dir_ls(fs::path_join(c(path, "docs/man")), regexp = "\\.md$"), error = function(e) NULL))
fs::dir_ls(fs::path_join(c(path, "docs/vignettes")), regexp = "\\.md$", fail = FALSE),
fs::dir_ls(fs::path_join(c(path, "docs/man")), regexp = "\\.md$", fail = FALSE))
for (m in md_files) {
tmp <- try(downlit::downlit_md_path(m, m), silent = TRUE)
if (inherits(tmp, "try-error")) {
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
if (!isTRUE(.dir_is_package(path))) {
stop(".add_pkgdown() must be run from the root of a package.", call. = FALSE)
}
url <- desc::desc_get_urls()
url <- setdiff(desc::desc_get_urls(), .gh_url(path))
fn <- fs::path_join(c(path, "altdoc/pkgdown.yml"))
if (!fs::file_exists(fn) && length(url) > 0) {
url <- url[1]
Expand Down
2 changes: 1 addition & 1 deletion inst/gha/altdoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
install.packages(".", repos = NULL, type = "source")
install.packages("pkgload")
pkgload::load_all()
altdoc::render_docs(parallel = TRUE, freeze = FALSE)
altdoc::render_docs(parallel = FALSE, freeze = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
Expand Down

0 comments on commit 4a75c2b

Please sign in to comment.