Skip to content

Commit

Permalink
Merge branch 'main' into quarto-articles
Browse files Browse the repository at this point in the history
  • Loading branch information
jayhesselberth authored Dec 9, 2024
2 parents f880086 + dfa28be commit 3bfa7aa
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 6 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pkgdown (development version)

* Articles (i.e., vignettes in `vignettes/articles`, created by `usethis::use_article()` and available on pkgdown sites but not included in a built package) have improved test cases.
* New `clean_site(force = TRUE)` for cleaning of `docs/` regardless of whether it was built by pkgdown (#2827).
* Links to favicons in page headers were updated to reflect changes to https://realfavicongenerator.net/ (#2804). Favicons should be re-generated by manually removing the `pkgdown/favicon` directory and then running `pkgdown::build_favicons()`.
* The language of the site is set from the first `Language:` in the `DESCRIPTION` if it is available and no other language is specified (@jonthegeek, #2808).

Expand Down
7 changes: 4 additions & 3 deletions R/clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
#' Delete all files in `docs/` (except for `CNAME`).
#'
#' @param quiet If `TRUE`, suppresses a message.
#' @param force If `TRUE`, delete contents of `docs` even if it is not a pkgdown site.
#' @inheritParams build_site
#' @rdname clean
#' @export
clean_site <- function(pkg = ".", quiet = FALSE) {
clean_site <- function(pkg = ".", quiet = FALSE, force = FALSE) {

pkg <- as_pkgdown(pkg)

Expand All @@ -17,7 +18,7 @@ clean_site <- function(pkg = ".", quiet = FALSE) {
if (!dir_exists(pkg$dst_path)) return(invisible())

top_level <- dest_files(pkg)
if (length(top_level) > 0) {
if (length(top_level) > 0 && !force) {
check_dest_is_pkgdown(pkg)
}

Expand Down Expand Up @@ -60,7 +61,7 @@ check_dest_is_pkgdown <- function(pkg) {
cli::cli_abort(c(
"{.file {pkg$dst_path}} is non-empty and not built by pkgdown",
"!" = "Make sure it contains no important information \\
and use {.run pkgdown::clean_site()} to delete its contents."
and use {.run pkgdown::clean_site(force = TRUE)} to delete its contents."
)
)
}
Expand Down
18 changes: 16 additions & 2 deletions R/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ NULL
#' x <- 4
#' }
#' x # should be 1
#'
#'
#' # \dontshow{} -------------------------------------------------------
#' # never shown, always run
#'
Expand All @@ -145,7 +145,7 @@ NULL
#' # If FALSE, wrapped in if; if TRUE, not seen
#'
#' x <- 1
#'
#'
#' @examplesIf FALSE
#' x <- 2
#' @examplesIf TRUE
Expand Down Expand Up @@ -275,3 +275,17 @@ NULL
#' @keywords internal
#' @family tests
NULL

#' Test case: math rendering in examples
#'
#' @param x \eqn{f(x) > 0}: inline equation
#'
#' @details
#' Display equation:
#'
#' \deqn{y = \alpha + \beta X + \varepsilon}
#'
#' @name test-math-examples
#' @keywords internal
#' @family tests
NULL
4 changes: 3 additions & 1 deletion man/clean.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/index.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-crayon.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-dont.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-figures.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-links.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-lists.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-long-lines.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions man/test-math-examples.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-output-styles.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-params.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-sexpr-title.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-tables.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/test-verbatim.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ authors:

template:
bootstrap: 5
math-rendering: mathjax
light-switch: true
bslib:
primary: "#0054AD"
Expand Down

0 comments on commit 3bfa7aa

Please sign in to comment.