diff --git a/DESCRIPTION b/DESCRIPTION index 7222eeaaa..3bbef16bd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,7 @@ Imports: purrr (>= 1.0.0), ragg, rlang (>= 1.1.0), - rmarkdown (>= 1.1.9007), + rmarkdown (>= 2.26.2), tibble, whisker, withr (>= 2.4.3), @@ -45,10 +45,12 @@ Suggests: diffviewer, evaluate, gert, + gt, htmltools, htmlwidgets, knitr, lifecycle, + magick, methods, openssl, pkgload (>= 1.0.2), @@ -70,3 +72,5 @@ Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 SystemRequirements: pandoc +Remotes: + rstudio/rmarkdown diff --git a/NAMESPACE b/NAMESPACE index 7ae939ddb..697768d9e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -89,6 +89,7 @@ S3method(as_html,tag_url) S3method(as_html,tag_var) S3method(as_html,tag_verb) S3method(pkgdown_print,default) +S3method(pkgdown_print,gt_tbl) S3method(pkgdown_print,htmlwidget) S3method(print,pkgdown_xml) S3method(print,print_yaml) @@ -116,6 +117,7 @@ export(build_favicons) export(build_home) export(build_home_index) export(build_news) +export(build_redirects) export(build_reference) export(build_reference_index) export(build_search) diff --git a/NEWS.md b/NEWS.md index 002aa7a7e..6e4f6c868 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,19 @@ # pkgdown (development version) * The title for the "Reference" page is now "Package index" since this page might contain more than just function details (#2181). +* `build_redirects()` now automatically adds redirects for topic +aliases. This matches the behaviour of `?` and will help keep links stable in the long term (#1876). +* `build_redirects()` now reports which redirects it is generating. +* The addin now runs `build_site()` instead of `build_site_external()`, which generally should be more reliable (#2252). +* Anchors are displayed when they're the target of a link. +* `build_reference()` adds anchors to arguments making it possible to link directly to an argument, if desired. A subtle visual treatment makes it easy to see which argument is targeted (#2228). +* `build_redirects()` is now exported to make it easier to document (#2500). +* `build_reference()` now automatically renders any tables created by gt (#2326). +* `build_articles()` now drops a section called "internal". This allows you to have articles that either aren't indexed at all or are included manually elsewhere in the navbar (#2205). +* `as.pkgdown()` will no longer prompt you to install a missing template package from CRAN, since these are almost always found in GitHub (#2076). +* `init_site()` once again describes one copy per line, and now uses a better prefix when copying assets from pkgdown itself (#2445). +* Very wide words are now automatically broken across lines and hyphenated (when possible) when they'd otherwise create a horizontal scrollbar on mobile (#1888). +* The `repo.source.url` field no longer requires a trailing slash (#2017). * Anywhere you can use `_pkgdown.yml`, you can now use `_pkgdown.yaml` (#2244). * pkgdown no longer overrides the default selection colours. This improves accessibility for users who have set their own colours in their browser settings (#2139, @glin). * `build_article()` now escapes html characters in the title (#2286). diff --git a/R/build-articles.R b/R/build-articles.R index ddeb27406..0582f769a 100644 --- a/R/build-articles.R +++ b/R/build-articles.R @@ -19,7 +19,7 @@ #' package, not the current source version. This makes iteration quicker when #' you are primarily working on the text of an article. #' -#' @section Index and navbar: +#' # Index and navbar #' You can control the articles index and navbar with a `articles` field in #' your `_pkgdown.yml`. If you use it, pkgdown will check that all articles #' are included, and will error if you have missed any. @@ -77,7 +77,7 @@ #' the navbar, it will link directly to the articles index instead of #' providing a drop-down. #' -#' @section Get started: +#' # Get started #' Note that a vignette with the same name as the package (e.g., #' `vignettes/pkgdown.Rmd` or `vignettes/articles/pkgdown.Rmd`) automatically #' becomes a top-level "Get started" link, and will not appear in the articles @@ -86,7 +86,14 @@ #' (If your package name includes a `.`, e.g. `pack.down`, use a `-` in the #' vignette name, e.g. `pack-down.Rmd`.) #' -#' @section External files: +#' ## Missing topics +#' +#' pkgdown will warn if there are (non-internal) articles that aren't listed +#' in the articles index. You can suppress such warnings by listing the +#' affected articles in a section with `title: internal` (case sensitive); +#' this section will not be displayed on the index page. +#' +#' # External files #' pkgdown differs from base R in its handling of external files. When building #' vignettes, R assumes that vignettes are self-contained (a reasonable #' assumption when most vignettes were PDFs) and only copies files explicitly @@ -107,7 +114,7 @@ #' Note that you can not use the `fig.path` to change the output directory of #' generated figures as its default value is a strong assumption of rmarkdown. #' -#' @section Embedding Shiny apps: +#' # Embedding Shiny apps #' If you would like to embed a Shiny app into an article, the app will have #' to be hosted independently, (e.g. ). Then, you #' can embed the app into your article using an `