diff --git a/.Rbuildignore b/.Rbuildignore index dd8e33561..620b2328e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -20,3 +20,4 @@ ^CRAN-SUBMISSION$ ^tools$ ^\.lintr.R$ +^vignettes/\.quarto$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index d9fced246..cd91a64f1 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -12,6 +12,8 @@ on: name: R-CMD-check +permissions: read-all + jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} @@ -28,19 +30,26 @@ jobs: # use 4.1 to check with rtools40's older compiler - {os: windows-latest, r: '4.1'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: 'oldrel-2'} - - {os: ubuntu-latest, r: 'oldrel-3'} - - {os: ubuntu-latest, r: 'oldrel-4'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-latest, r: 'oldrel-2'} + - {os: ubuntu-latest, r: 'oldrel-3'} + - {os: ubuntu-latest, r: 'oldrel-4'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - uses: quarto-dev/quarto-actions/setup@v2 + with: + version: pre-release + tinytex: true + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: r-lib/actions/setup-pandoc@v2 @@ -58,3 +67,4 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml index d9994b1c3..3bc4f8ebd 100644 --- a/.github/workflows/netlify.yaml +++ b/.github/workflows/netlify.yaml @@ -10,12 +10,17 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-tinytex@v2 - uses: r-lib/actions/setup-pandoc@v2 + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true diff --git a/.github/workflows/no-pandoc.yaml b/.github/workflows/no-pandoc.yaml index 9e0e7b502..7d3c32c89 100644 --- a/.github/workflows/no-pandoc.yaml +++ b/.github/workflows/no-pandoc.yaml @@ -15,7 +15,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index b37ac1ff3..4bae74da9 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -24,9 +24,14 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-pandoc@v2 + - uses: quarto-dev/quarto-actions/setup@v2 + with: + version: pre-release + tinytex: true + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: r-lib/actions/setup-tinytex@v2 + - uses: r-lib/actions/setup-pandoc@v2 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index 71f335b3e..d1f765096 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -6,6 +6,8 @@ on: name: Commands +permissions: read-all + jobs: document: if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} @@ -14,7 +16,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@v2 with: @@ -51,7 +53,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@v2 with: diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 4b5b0eb68..2565dbe3e 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -8,6 +8,8 @@ on: name: test-coverage +permissions: read-all + jobs: test-coverage: runs-on: ubuntu-latest @@ -15,38 +17,54 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 + - uses: quarto-dev/quarto-actions/setup@v2 + with: + version: pre-release + tinytex: true + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::covr + extra-packages: any::covr, any::xml2 needs: coverage - name: Test coverage run: | - covr::codecov( + cov <- covr::package_coverage( quiet = FALSE, clean = FALSE, install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) + covr::to_cobertura(cov) shell: Rscript {0} + - uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + - name: Show testthat output if: always() run: | ## -------------------------------------------------------------------- - find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true shell: bash - name: Upload test results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-test-failures path: ${{ runner.temp }}/package diff --git a/.gitignore b/.gitignore index 7c6b284f0..df027dcf3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ inst/doc .env *.tex docs + +/.quarto/ diff --git a/DESCRIPTION b/DESCRIPTION index eb905638e..ba804ff60 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,6 +9,8 @@ Authors@R: c( person("Maëlle", "Salmon", role = "aut", comment = c(ORCID = "0000-0002-2815-0399")), person("Olivier", "Roy", role = "aut"), + person("Salim", "Brüggemann", role = "aut", + comment = c(ORCID = "0000-0002-5329-5987")), person("Posit Software, PBC", role = c("cph", "fnd")) ) Description: Generate an attractive and useful website from a source @@ -26,7 +28,7 @@ Imports: cli (>= 3.6.1), desc (>= 1.4.0), digest, - downlit (>= 0.4.0), + downlit (>= 0.4.4), fontawesome, fs (>= 1.4.0), httr2 (>= 1.0.0), @@ -44,7 +46,7 @@ Imports: Suggests: covr, diffviewer, - evaluate (>= 0.23.0.9000), + evaluate (>= 0.24.0), gert, gt, htmltools, @@ -54,6 +56,7 @@ Suggests: magick, methods, pkgload (>= 1.0.2), + quarto, rsconnect, rstudioapi, rticles, @@ -61,14 +64,14 @@ Suggests: testthat (>= 3.1.3), tools VignetteBuilder: - knitr + knitr, + quarto Config/Needs/website: usethis, servr Config/potools/style: explicit Config/testthat/edition: 3 Config/testthat/parallel: true -Config/testthat/start-first: build-article, build-reference +Config/testthat/start-first: build-article, build-quarto-article, build-reference Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 SystemRequirements: pandoc -Remotes: r-lib/evaluate diff --git a/NEWS.md b/NEWS.md index 2f5fe8cc5..9393e451e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,76 +1,95 @@ # pkgdown (development version) -* `build_news()` only syntax highlights the page once, not twice, which prevents every block of R code getting a blank line at the start (#2630). - - ```R - 1 + 1 - ``` +## Major changes -* `build_reference()` no longer displays `\dontshow{}` or `\testonly{}` blocks in examples. It will run the code in `\dontshow{}`; it won't run the code in `\testonly{}`(#2188). -* `build_article()` no long has a `data` argument. This is technically a breaking change, but I can't figure out why anyone would have ever used it. -* `build_reference()` does a better job of parsing `\value{}` blocks (#2371). -* When built on GitHub, source urls now use the name of the current upstream branch (rather than `HEAD`), which is more likely to generate correct links (#2597). -* New `vignette("non-english")` that discusses non-English sites including how to submit new translations (#2605). -* `build_reference()` now generates the usage that users actually type for infix and replacement methods (#2303). -* @olivroy is now a pkgdown author in recognition of his contributions. -* `pkgdown_sitrep()`/`check_pkgdown()` now check that you have up-to-date favicons if you have a package logo. -* pkgdown now uses httr2 instead of httr (#2600). +* Added @olivroy and @salim-b as pkgdown authors in recognition of their contributions. +* `build_articles()` and `build_article()` now support articles/vignettes written with quarto. Combining the disparate quarto and pkgdown templating systems is a delicate art, so while I've done my best to make it work, there may be some rough edges. So please file an issue you encounter quarto features that don't work quite right. Learn more in `vignette("quarto")`(#2210). +* New light switch makes it easy for users to switch between light and dark themes for the website (based on work in bslib by @gadenbuie). For now this behaviour is opt-in with `template.light-switch: true` but in the future we may turn it on automatically. See the customization vignette for details (#1696). +* New `vignette("translations")` that discusses non-English sites including how to submit new translations (#2605). +* New `vignette("accessibility")` describes what manual tasks you need to perform to make your site as accessible as possible (#2344). * New `template.math-rendering` allows you to control how math is rendered across your site. The default uses `mathml` which is low-dependency, but has the lowest fidelity. You can also use `mathjax`, the previous default, and `katex`, a faster alternative. (#1966). -* Mathjax now uses version 3.2.2. -* `build_sitemap()` no longer includes redirected pages (#2582). * All external assets (JS, CSS, fonts) are now directly included in the site instead of fetched from external CDN (@salim-b, #2249) -* `build_reference_index()` now displays function lifecycle badges next to the function name (#2123). The badges are extracted only from the function description. You can now also use `has_lifecycle()` to select functions by their lifecycle status. -* `build_articles()` now recognises a new `external-articles` top-level field that allows you to define articles that live in other packages (#2028). -* New light switch makes it easy for users to switch between light and dark themes for the website (based on work in bslib by @gadenbuie). For now this behaviour is opt-in with `template.light-switch: true` but in the future we may turn it on automatically. See the customization vignette for details (#1696). -* The search dropdown has been tweaked to look more like the other navbar menu items (#2338). -* `vignette("search")` has been removed since BS3 is deprecated and all the BS5 docs are also included in `build_search()` (#2564). * YAML validation has been substantially improved so you should get much clearer errors if you have made a mistake (#1927). Please file an issue if you find a case where the error message is not helpful. -* `template_reference()` and `template_article()` now only add backticks to function names if needed (#2561). -* Custom navbars that specify `icon` but not `aria-label` will now generate a message reminding you to provide one for to improve accessibility (#2533). -* `init_site()` will no longer automatically build favicons on CI systems (e.g. GHA). This is an expensive operation that uses an external service so it should only be run locally (#2553). -* `build_home_index()` now reports when rendering the home page (#2544). + +## Lifecycle changes + +* `autolink_html()` was deprecated in pkgdown 1.6.0 and now warns every time you use it. `downlit::downlit_html_path()` should be used instead. +* `build_site(document)` and `build_reference(document)` has been removed after being deprecated in pkgdown 1.4.0. `devel` should be used instead. +* `preview_page()` has been deprecated (#2650). * Bootstrap 3 has been deprecated. It was superseded in December 2021, and now we're starting to more directly encourage folks to move away from it. + +## Front end changes + +* When built on GitHub, source urls now use the name of the current upstream branch (rather than `HEAD`), which is more likely to generate correct links (#2597). +* The search dropdown has been tweaked to look more like the other navbar menu items (#2338). * Improve HTML5 compliance (#2369): * No longer support IE9 or earlier * Strip trailing whitespace * Label `