Releases: r-lib/pkgdown
pkgdown 2.0.4
-
New
check_pkgdown()provides a lightweight way to check that your
_pkgdown.ymlis valid without building the site (#2056). Invalid
_pkgdown.ymlnow consistently generates errors both locally and on
CI (#2055). -
build_article()now supports inline markdown in thetitle(#2039). -
build_home()no longer shows development status badges on the released
version of the site (#2054). -
build_news()support automated@usernamelinks in more places (#2030). -
build_reference():-
You can once again exclude topics from the reference index with
-(#2040). -
Inline markdown in
titles andsubtitles is now supported(#2039). -
Package logos will be automatically stripped from the
.Rdyou don't end
up with two on one page. (#2083). -
\figure{file}{alternative text}with multline alt text is now parsed
correctly (#2080) -
roxygen 7.2.0 output for generic code blocks (#2092, @jabenninghoff) is
processed correctly.
-
-
Front end changes:
-
Automatically added links in code blocks are now styled less aggressively,
so they occupy less visual weight on the page (#2007). -
All article pages are given class
col-md-9for consistency with other
pages (#2045). -
Fixed width HTML widgets are sized correctly (@dmurdoch, #2062).
-
Footnotes work with more contents, including code (@banfai, #2042).
-
Navbar components now accept
targetargument (#2089, @JSchoenbachler).
-
-
New syntax highlighting themes a11y-light, a11y-dark, monochrome-light,
monochrome-dark, and solarized
pkgdown 2.0.3
- Fixes for R CMD check
pkgdown 2.0.2
-
New Korean (
ko) translation thanks to @mrchypark and @peremen (#1994).
New Danish (dk) translation thanks to @LDalby. -
build_articles()now adjusts the heading levels of vignettes/articles that
use<h1>as section headings to ensure that there's one top-level heading
(#2004). This ensures that there's one<h1>, the title, on each page,
and makes the TOC in the sidebar work correctly. -
build_home_index()no longer spuriously complains about missing images
if you use plots in yourREADME.Rmd(#1980, #1977). It no longer
tweaks thesrcpath for<img>tags with absolute paths (#1955). -
build_news()once again works ifNEWS.mduses<h1>headings (#1947). -
build_reference()now correctly interpretstitle: internal: it removes
the section from the reference index and it doesn't list the topics in that
section as missing (#1958). -
build_reference()now gives a correct hint when the reference index YAML
is not formatted correctly (e.g. empty item, or item such as "n" that needs
to be escaped with quotes to not be interpreted as Boolean) (#1995). -
deploy_to_branch()gains asubdirargument, allowing you to deploy the
site to a subdirectory (@gadenbuie, #2001). -
Front end changes:
-
The navbar gets a little more space after the version number, and aligns
the baseline with rest of the navbar (#1989). -
Long lines in code output once again scroll, rather than being wrapped.
While this is different to what you'll see in the console, it's a better
fit for web pages where the available code width varies based on the
browser width (#1940). -
scrollspy (which highlights the "active" heading in the sidebar) now
computes the offset dynamically which makes it work better on sites with
taller navbars (#1993). -
Fixed js issues that occurred on pages without a table of contents
(@gadenbuie, #1998). -
When htmlwidgets with jQuery or Bootstrap dependencies are used in examples or
articles, pkgdown's versions of jQuery and Boostrap will take precedence over
the versions used by the htmlwidget (@gadenbuie, #1997).
-
-
pkgdown no longer includes bundled author metadata for Hadley Wickham,
RStudio, or the RConsortium, since there are now ways to include this
meta data in template packages, and special casing these three entities
feels increasingly weird (#1952).
pkgdown 2.0.1
pkgdown 2.0.0
New authors
@maelle is now a pkgdown author in recognition of her significant and sustained contributions. She was the powerhouse behind many of the improvements in this release, particularly the switch to bootstrap 5, improvements to customisation, and implementation of local search.
Bootstrap 5
-
pkgdown can style your site with Bootstrap 5 (with help from @jayhesselberth,
@apreshill, @cpsievert). Opt-in by settingboostrapversion in your
_pkgdown.yml:template: bootstrap: 5
-
We reviewed site accessibility and made a number of small improvements:
(#782, #1553):- Default font is larger and links are always underlined.
- Heading anchors use
aria-hiddento reduce noise for screenreader users. - Navbar dropdowns has improved
aria-labelledby. - The default GitHub/GitLab links gain an
aria-label; use for other
icons is now supported, and encouraged in the docs. - Syntax highlighting uses a new more
accessible colour scheme,
designed by Alison Hill (#1536) - A skip link makes it easier to get directly to the page contents (#1827).
-
In-line footnotes mean you can read asides next to the text they refer to.
-
Articles support tabsets,
as in R Markdown.
(@JamesHWade, #1667). -
Other minor styling improvements:
- The active item in TOC is indicated with background colour, rather than
a border. - If present, the package logo is shown on all pages near the header.
- Section anchors now appear on the right (making them usable on mobile
phones) (#1782). - The TOC is scrollable independently of the main content. This makes it
more useful on long pages with many headings (#1610). - The sidebar is shown at the bottom of the page on narrow screens.
- Function arguments and the reference index (#1822) use definition lists
(<dl>) instead of tables. This gives more room for long argument
names/lists of function and detailed descriptions, and displays better
on mobile. - Links on the homepage no longer show the full url in the text.
- The default navbar no longer includes a home icon - this took up
precious horizontal space and wasn't very useful since there was already
a link to the home page immediately to its left (#1383).
- The active item in TOC is indicated with background colour, rather than
Local search
-
pkgdown now supports local searching (i.e. searching without an external
service), and is enabled by default for Bootstrap 5 sites since no set-up is
needed (#1629, with help from @gustavdelius in #1655 and @dieghernan &
@GregorDeCillia in #1770). -
pkgdown builds a more exhaustive
sitemap.xmleven for websites built with
Bootstrap 3. This might change Algolia results if you use Algolia for search
(#1629).
Customisation
-
New
vignette("customise")documents all the ways you can customise your
site, including the new options described below (#1573). -
Sites can be easily themed with either bootswatch themes or by selectively
overriding thebslibvariables used to generate the CSS. pkgdown now uses
scss for its own Bootstrap css tweaks, which means that you can customise
more of the site from within_pkgdown.yml. -
You can pick from a variety of built-in syntax highlighting themes (#1823).
These control the colours (and background) of code in<pre>tags. -
pkgdown can now translate all the text that it generates (#1446): this means
that if you have a package where the docs are written in another language, you
can match all the pkgdown UI to provide a seamless experience to non-English
speakers. Activate the translations by setting thelangin_pkgdown.yaml:lang: fr
pkgdown includes translations for:
es, Spanish, thanks to @edgararuiz-zz, @dieghernan, @rivaquiroga.de, German, thnaks to @hfrick.fr, French, thanks to @romainfrancois, @lionel-, @jplecavalier, and @maelle.pt, Portoguese, thanks to @rich-iannone.tr, Turkish, thanks to @mine-cetinkaya-rundel.zh_CN, simplified Chinese, thanks to @yitao.
If you're interested in adding translations for your language please file
an issue and we'll help you get started. -
Template packages can now provide
inst/pkgdown/_pkgdown.ymlwhich is used
as a set of defaults for_pkgdown.yaml. It can be used to (e.g.) provide
author definitions, select Bootstrap version and define bslib variables,
and customise the sidebar, footer, navbar, etc. (#1499). -
New
includesparametersin-header,before-body, andafter-body
make it easy to add arbitrary HTML to every page. Their content will be
placed at the end of the<head>tag, right below the opening<body>tag,
and before the closing tag</body>respectively (#1487). They match the
bookdown optionsin_header,before_bodyandafter_body.Additionally, you can use
before_title,before_navbar, and
after_navbarto add arbitrary HTML into the navbar/page header; they
will appear to the left of the package name/version, and to the left and
right of the navigation links respectively (#1882). -
Authors configuration is more flexible (#1516). You can now:
- Choose the roles used for filtering authors for the sidebar and footer.
- Choose the text before authors in the footer.
- Add text before and after the authors list in the sidebar.
- Add text before and after the authors list of the authors page.
-
Sidebar specification is more flexible (#1443, #1488, #1502). You can now:
- Change the order of sidebar elements.
- Add custom sidebar sections (with Markdown/HTML
text). - Add a table of contents to the home page.
- Completely suppress the sidebar.
- Provide your own HTML for the navbar.
-
Footer specification is more flexible (#1502). You can now:
- Change the placement of elements on the left and right.
- Add text to the left and right (or even remove/replace default text)
-
You can now exclude all default components from the navbar (#1517).
-
Expert users can now override layout templates provided by pkgdown or template
packages by placing template files inpkgdown/templates(@gadenbuie, #1897).
New features
-
pkgdown now supports redirects (#1259, @lorenzwalthert). The following yaml
demonstrates the syntax, with old paths on the left and new paths/URLs on
the right.redirects: - ["articles/old-vignette-name.html", "articles/new-vignette-name.html"] - ["articles/another-old-vignette-name.html", "articles/new-vignette-name.html"] - ["articles/yet-another-old-vignette-name.html", "https://pkgdown.r-lib.org/dev"]
-
Use HTML classes
pkgdown-develorpkgdown-releaseto declare that certain
content should appear only on the devel or release site. Use the class
pkgdown-hidefor content that should only appear only on GitHub/CRAN
(#1299). -
New
pkgdown_sitrep()function reports whether the site is set up correctly;
in particularly it currently reports if auto-linking will work (#1478).
Code
-
Styling for errors, warnings, and messages has been tweaked. Messages
are now displayed the same way as output, and warnings and errors are
bolded, not coloured. This is part of a suite of changes that aim to
give package authors greater control over the appearance of messages,
warnings, and errors. -
Long lines in code output are now wrapped, rather than requiring scrolling.
This better matchesrmarkdown::html_document()and what you see in the
console. -
build_reference()now allows linking to topics from other packages (either
function names e.g.rlang::is_installedor topic names e.g.
sass::font_face). (#1664) -
build_reference()now runs examples with
options(rlang_interactive = FALSE)(ensuring non-interactive behaviour in
functions that userlang::is_interactive()),options(cli.dynamic = FALSE),
Sys.setenv(RSTUDIO = NA)andSys.setLocale("LC_COLLATE", "C")(#1693).
It also runspkgdown/pre-reference.Rbefore andpkgdown/post-reference.R
after examples. These allow you to do any setup or teardown operations you
might need (#1602). -
A reference index section with
title: internalis now silently dropped,
allowing you to suppress warnings about topics that are not listed in the
index (#1716). -
Code blocks are now highlighted according to their declared language
(e.g.yaml) if the documentation was built with roxygen2 7.1.2 or later
(#1690, #1692). -
New
pkgdown_print()allows you to control how your objects are rendered in
examples. It includes built-in handling for htmlwidgets and "browseable" HTML
so pkgdown output now more closely resembles what you see in RStudio.
Added extension points to make HTML widgets (and RGL in particular) work
in rendered examples (@dmurdoch). -
You can globally set the
widthof code output (in reference and articles)
withcode: width: 50
-
Articles now render output styles created by cli/crayon (#1556).
-
When copy and pasting code blocks, lines containing output (e.g.
#>)
are automatically omitted (#1675). -
Auto-linking improvements:
-
Links to inherited R6 methods now work correctly for both internal
(#1173, @vandenman) and external (#1476) parent classes. -
Linking no longer fails if a package contains duplicated Rd aliases.
-
Correctly link to reference pages when the
\name{}entry doesn't match
the file name (@dmurdoch, #1586; #16...
-
pkgdown 1.6.1
- The article index (used for autolinking vignettes across packages)
once again works (#1401).
pkgdown 1.6.0
Major changes
-
pkgdown now uses the new downlit package for all
syntax highlighting and autolinking (in both reference topics and vignettes).
There should be very little change in behaviour because the code in downlit
was extracted from pkgdown, but this makes it easier to use pkgdown's nice
linking/highlighting in more places (#1234). -
pkgdown now uses the
ragg::agg_png()device to generate example figures.
This should be a little faster and produce higher quality output. Learn
more at https://ragg.r-lib.org (#1320).
Minor improvements and bug fixes
Rd translation
-
\special{}support inside\usage{}added to allow non-standard R usage
syntax (@klmr, #1345). -
#ifdefand#ifndefare now supported; the "current" OS is hard coded to
"unix" to ensure reproducible output regardless of where you build the
website (#1384). -
Nested
\subsection{}s now generate appropriate heading levels
(h3, h4, h5 etc) (#1377), and get anchor links (#1389). -
\preformatted{}no longer double escapes its contents (#1311).
Articles and vignettes
-
build_articles()no longer sets thethemeargument of the document format
toNULLwhenas_is: true. This should allow it to work with a wider
range of output formats includingbookdown::html_vignette2()and
friends (@GegznaV, #955, #1352). -
When
build_article()fails, it gives the complete failure message (#1379). -
Markdown header attributes are now processed in all markdown files (@jonkeane, #1343)
Auto-linking and syntax highlighting
-
The branch used for source linking can be configured by setting
repo: branch: branch_namein_pkgdown.yml(@jonkeane, #1355):repo: branch: main
-
autolink_html()is (soft) deprecated. Please use
downlit::downlit_html_path()instead. -
Highlighting of empty expressions works once more (#1310).
-
New
deploy$install_metadataoption in_pkgdown.yml. Setting it to
truewill store site metadata in the package itself, allowing offline
access for packages that to autolink to the package's website
(@mstr3336, #1336).
Other
-
You can now control the background colour of plots with the
figures.bg
option (it is transparent by default, and given a white background by
css). See?build_referencefor an example. -
HTML is automatically stripped from the page title (#1318).
-
Suppressing CRAN dates in news file now actually works.
-
All HTTP requests are now retried upon failure (@jameslamb, #1305).
-
Setting
clean = TRUEindeploy_site_github()removes old files from the
deployed site before building a new one (#1297).
pkgdown 1.5.1
-
Syntax highlighting works on Windows once more (#1282).
-
pkgdown no longer fails if your
.Rdfiles have duplicated\aliases
as were produced by an older version of roxygen2 (#1290). -
Rendering empty
.mdfile now returns empty string (#1285). -
build_articles_index()is now exported to rapidly rebuild the index (#1281) -
deploy_site_github()now accepts ahostargument to specify alternate
hosts (e.g., Github enterprise) (@dimagor, #1165) and once again works as
intended on Travis-CI (@jimhester, #1276).
pkgdown 1.5.0
New features
-
The articles index page and navbar have been overhauled. There are two
major new features in this release:-
The articles index page now displays article
descriptions,
taken from YAML metadata belonging to each article. This lets you provide
more context about each article and describe why one might want to read
it (#1227). -
The articles navbar is now also controlled by the
articlessection
in_pkgdown.yml. The ordering of the sections, and articles within
them, control the order of the articles in the navbar, and you can
use the newnavbarfield to control whether or not each section
appears in the navbar (#1101, #1146).
-
-
The reference index now has two levels of heading hierarchy:
titleand
subtitle(#327). -
Tables of contents in sidebars now use
bootstrap-toc; this considerably
improves navigation for long articles and reference pages. -
You can now control the links to source files (in reference pages and
articles) and issues and users (in the NEWS) with newrepo$urlconfig
option (#1238). This makes it easier to use pkgdown with GitHub enterprise,
packages in subdirectories, and other source hosts (like bitbucket).repo: url: home: https://github.com/r-lib/pkgdown/ source: https://github.com/r-lib/pkgdown/blob/master/ issue: https://github.com/r-lib/pkgdown/issues/ user: https://github.com/
The individual components (e.g. path, issue number, username) are pasted on
the end of these urls so they should have trailing/s.You don't need to set these links for GitLab, as pkgdown now detects
GitLab urls automatically (since they use the same structure as GitHub)
(#1045). -
There's much richer control over Open Graph and Twitter metadata for the
whote site and for individual articles. See newvignette("metadata")for
details (@gadenbuie, #936). -
New
deploy_to_branch()function to build and deploy a site to a branch,
defaulting togh-pagesfor use with GitHub Pages. This is used in our
recommended GitHub action workflow for automatically building and deploying
pkgdown sites for packages on GitHub (@jimhester, #1221). -
Updated JS libraries: jquery 3.3.1 -> 3.4.1; bootswatch 3.3.7 -> 3.4.0;
bootstrap 3.3.7 -> bootstrap 3.4.1; docsearch 2.6.1 -> 2.6.3;
fontawesome 5.11.1 -> 5.12.1; headroom.js 0.9.44 -> 0.11.0;
clipboard.js 2.0.4 -> 2.0.6 (@jayhesselberth).
Auto-linking improvements
-
Examples and Rmd now use exactly the same syntax highlighting strategy.
-
In examples and Rmd, calls of the form
current_package::foonow get
a local link (#1262). -
\preformatted{}blocks are now highlighted and linked if they parse
as R code (#1180). -
library(pkgdown)is now automatically linked to the reference index for
"pkgdown" not the documentation forlibrary()(#1161). -
help("topic")is now automatically linked to the documentation for "topic",
not to the documentation forhelp()(#1210)
Minor improvements and bug fixes
Articles
-
build_home()no longer uses (unrendered)README.Rmdorindex.Rmdif
corresponding.mdfiles are not found. -
build_article()failures now print more information to help you debug
the problem (#952). -
The name of the vignette mapped to the "Get started" entry in the navbar
is now more flexible. You can use an article (e.garticles/{pkgname})
and if your package has a.in its name you can replace it with-to
generate a valid article name (e.g. the get started vignette for
pack.downwould bepack-down) (#1166).
Deployment
-
deploy_to_branch()now correctly captures the commit SHA on GitHub Actions
(@coatless, #1252). -
deploy_to_branch(github_pages = TRUE)generates a.nojekyllto prevent
jekyll ever executing (#1242). -
CNAMEis no longer generated byinit_site(), but is instead conditionally
bydeploy_to_branch()whengithub_pages = TRUE. This is a better a fit
because theCNAMEfile is only needed by GitHub pages (#969). -
deploy_site_github()argumentrepo_slughas been deprecated and is no
longer needed or used. (@jimhester, #1221)
News
See additional details in ?build_news:
-
You can optionally suppress the CRAN release dates added to the news
page (#1118). -
Multi-page news style gets a better yaml specification (the old style
will continue to work so no need to change existing YAML).
Reference
-
A topic named
indexwill not longer clobber the reference index (#1110). -
Topic names/aliases on reference index are now escaped (#1216).
-
build_reference()gives better warnings if your_pkgdown.ymlis
constructed incorrectly (#1025). -
New
has_keyword()topic selector forreference.has_keyword("datasets")
is particularly useful for selecting all data documentation (#760). -
New
lacks_concepts()can select topics that do not contain any of
a number of specified concepts. (@mikldk, #1232)
Home, authors, and citation
-
pkgdown now escapes html and linkifies links in comments in author info
from DESCRIPTION (@maelle, #1204) -
pkgdown now uses the ORCiD logo included in Font Awesome 5.11 instead of
querying it from members.orcid.org (@Bisaloo, #1153) -
badges are now extracted from everything between
<!--badges: start-->
and<!--badges: end-->. They used to be extracted only if they were
direct children of the first<p>after<!--badges: start-->. -
build_home()now looks forpkgdown/index.mdin addition to the top-level
indexorREADMEfiles (@nteetor, #1031)
Navbar
-
pkgdown now formats the package version displayed in the navbar the same way
as it has been specified in the DESCRIPTION file. In particular, version
separators (e.g..and-) are preserved. (#1170, @kevinushey) -
add support for navbar submenus: you can create submenus following the
convention established in rstudio/rmarkdown#721 (@ijlyttle, @wendtke, #1213)
Other
-
Updated JS libraries: jquery 3.3.1 -> 3.4.1; bootswatch 3.3.7 -> 3.4.0;
bootstrap 3.3.7 -> bootstrap 3.4.1; docsearch 2.6.1 -> 2.6.3
(@jayhesselberth). -
Markdown conversion now explicitly allows markdown inside of HTML blocks;
this was previously accidentally disabled (#1220). -
A timestamp for the last site build is reported in
pkgdown.yml(#1122).
pkgdown 1.4.1
- Don't install test package in user library (fixes CRAN failure).