Skip to content

Commit

Permalink
Tweak bullets
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Mar 15, 2024
1 parent 66febb0 commit 14ab561
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
7 changes: 5 additions & 2 deletions R/build-favicons.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ build_favicons <- function(pkg = ".", overwrite = FALSE) {

if (is.null(logo_path)) {
cli::cli_abort(
"Can't find package logo PNG or SVG to build favicons."
"Can't find package logo PNG or SVG to build favicons.",
"i" = "See {.fun usethis::use_logo} for more information."
)
}

Expand All @@ -37,7 +38,9 @@ build_favicons <- function(pkg = ".", overwrite = FALSE) {
return(invisible())
}

cli::cli_inform("Building favicons with {.url https://realfavicongenerator.net} ...")
cli::cli_inform(c(
i = "Building favicons with {.url https://realfavicongenerator.net} ..."
))

logo <- readBin(logo_path, what = "raw", n = fs::file_info(logo_path)$size)

Expand Down
12 changes: 7 additions & 5 deletions R/sitrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pkgdown_sitrep <- function(pkg = ".") {

if (is.null(pkg$meta[["url"]])) {
msg_fld <- pkgdown_field(pkg, "url", cfg = TRUE, fmt = TRUE)
warns <- c(warns, x = paste0(msg_fld, "is misconfigured. See {.vignette pkgdown::metatdata}."))
warns <- c(warns, x = paste0(msg_fld, " is misconfigured. See {.vignette pkgdown::metatdata}."))
}

desc_urls <- pkg$desc$get_urls()
Expand All @@ -28,10 +28,12 @@ pkgdown_sitrep <- function(pkg = ".") {
}

if (length(warns) == 0) {
cli::cli_alert_success("pkgdown situation report: {.emph {cli::col_green('all clear')}}")
cli::cli_inform("{.emph Double-check the following URLs:}")
cli::cli_inform("{.file {pkgdown_config_relpath(pkg)}} contains URL {.url {pkg$meta['url']}}")
cli::cli_inform("{.file DESCRIPTION} contains URL{?s} {.url {desc_urls}}")
cli::cli_inform(c(
"v" = "pkgdown situation report: {.emph {cli::col_green('all clear')}}",
"!" = "{.emph Double-check the following URLs:}",
" " = "{pkgdown_config_href({pkg$src_path})} contains URL {.url {pkg$meta['url']}}",
" " = "{.file DESCRIPTION} contains URL{?s} {.url {desc_urls}}"
))
} else {
cli::cli_warn(c(
"pkgdown situation report: {.emph {cli::col_red('configuration error')}}",
Expand Down
7 changes: 4 additions & 3 deletions tests/testthat/_snaps/sitrep.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
Code
pkgdown_sitrep(pkg)
Message
Double-check the following URLs:
'_pkgdown.yml' contains URL <http://example.com/pkg>
'DESCRIPTION' contains URL <http://example.com/pkg>
v pkgdown situation report: all clear
! Double-check the following URLs:
_pkgdown.yml contains URL <http://example.com/pkg>
'DESCRIPTION' contains URL <http://example.com/pkg>

0 comments on commit 14ab561

Please sign in to comment.