Releases: r-lib/pkgdown
pkgdown 2.1.1
- Added keyboard shortcut,
/
, to focus search bar (#2423) - The
BugReports
field can now be an email (@catalamarti, #2275). - New
clean_cache()
function removes the contents of the cache directory (#2718). - pkgdown now depends on R >= 4.0.0 (#2714)
- Updated GitHub Actions advice and workflows around Quarto install (@tanho63, #2743)
pkgdown 2.1.0
Major changes
- Added @olivroy and @salim-b as pkgdown authors in recognition of their contributions.
build_articles()
andbuild_article()
now support articles/vignettes written with quarto (version 1.5 and above). 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 invignette("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 usesmathml
which is low-dependency, but has the lowest fidelity. You can also usemathjax
, the previous default, andkatex
, a faster alternative. (#1966). - All external assets (JS, CSS, fonts) are now directly included in the site instead of fetched from external CDN (@salim-b, #2249)
- 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.
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)
andbuild_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
<nav>
s and improve navbar html.
- Tweaked navbar display on mobile so that long titles in drop downs (e.g. article titles) are now wrapped, and the search input spans the full width (#2512).
- The title for the "Reference" page is now "Package index" since this page might contain more than just function details (#2181).
- 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 mobile version of pkgdown sites no longer has a scrollburglar (a small amount of horizontal scroll) (#2179, @netique).
- Anchors are displayed when they're the target of a link.
- New translation for "Search site", the label applied to the search box for screenreaders. This was previously incorrectly labelled as "Toggle navigation" (#2320).
- 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).
- If you put a dropdown menu (e.g. articles) on the right hand side of the navbar, it will now be right aligned. This makes longer titles more likely to stay on the page (#2421).
- BS5 templates no longer include empty link to logo when none exists (#2536).
- Updated translations from @jplecavalier, @dieghernan, @krlmlr, @LDalby, @rich-iannone, @jmaspons, and @mine-cetinkaya-rundel (#2659).
_pkgdown.yaml
- Anywhere you can use
_pkgdown.yml
, you can now use_pkgdown.yaml
(#2244). - Custom navbars that specify
icon
but notaria-label
will now generate a message reminding you to provide one for to improve accessibility (#2533). - The
repo.source.url
field no longer requires a trailing slash (#2017). - The
template.bslib
item now also accepts abootswatch
key (@gadenbuie, #2483). - You can now choose where the search box is placed with the "search" navbar component. This has been documented for a very long time, but as far as I can tell, never worked (#2320). If you have made your own template with a custom
navbar
, you will need to remove the<form>
withrole="search"
to avoid getting two search boxes.
Minor improvements and bug fixes
-
pkgdown now uses httr2 instead of httr (#2600).
-
Mathjax now uses version 3.2.2.
-
The addin now runs
build_site()
instead ofbuild_site_external()
, which generally should be more reliable (#2252). -
<source>
tags now have theirsrcref
attributes tweaked in the same way that thesrc
attributes of<img>
tags are (#2402). -
as.pkgdown()
will no longer prompt you to install a missing template package from CRAN, since these are almost always found in GitHub (#2076). -
build_articles()
now recognises a newexternal-articles
top-level field that allows you to define articles that live in other packages (#2028). -
build_article()
no longer has adata
argument. This is technically a breaking change, but I can't figure out why anyone would have ever used it. -
build_*()
(apart frombuild_site()
) functions no longer default to previewing in interactive sessions since they now all emit specific links to newly generated files. -
build_article()
now translates the "Abstract" title if it's used. -
build_article()
now escapes html characters in the title (#2286). -
build_article()
no longer generates the wrong source link when you build your site outside of the root directory (#2172). -
build_articles()
now reports if you are missing alt-text for any images (#2357). -
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). -
build_home()
now correctly escapes special HTML characters in the bibtex citation (#2022). -
build_home()
no longer checks if the README is missing any images. This check is now performed inbuild_site()
, afterbuild_articles()
so you can refer to images created by vignettes with warnings (#2194). -
build_home()
now includes the contents ofinst/AUTHORS
on the authors page (#2506). -
build_home_index()
now reports when rendering the home page (#2544). -
build_home_index()
now renders math if you use it in your home page (#2263). -
build_news()
now works if your package has been archived at some point (#2687). -
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).1 + 1
-
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_reference()
does a better job of parsing\value{}
blocks (#2371). -
build_reference()
now generates the usage that users actually type for infix and replacement methods (#2303). -
build_reference()
now automatically translates--
,---
,``
, and''
to their unicode equivalents (#2530). -
build_reference()
now supports\Sexpr[results=verbatim]
(@bastistician, #2510). -
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_reference()
now automatically renders any tables created by gt (#2326). -
build_reference()
matches usage for S3 and S4 methods to the style used by R 4.0.0 and later (#2187). -
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 usehas_lifecycle()
to select functions by their lifecycle status. -
build_redirects()
is now exported to make it easier to document (#2500). -
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. -
build_site()
automatically runspkgdown_sitrep()
at the start of the process (#2380). -
build_sitemap()
no longer includes redirected pages (#2582). -
check_pkgdown()
andpkgdown_sitrep()
have been unified so that they both report on the same problems. They now only differ in the style of their output:pkgdown_sitrep()
reports whether each category is ok or not ok, whilecheck_pkgdown()
errors on the first issue (#2463). -
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). -
init_site()
once again describes one copy per line, and now uses a better prefix when copying assets from pkgdown itself (#2445). -
pkgdown_sitrep()
/check_pkgdown()
now check that you have up-to-date favicons if you have a package logo. -
template_reference()
andtemplate_article()
now only add backticks to function names if needed (#2561). -
vignette("search")
has been removed since BS3 is deprecated and all the BS5 docs are also included inbuild_search()
(#2564).
pkgdown 2.0.9
-
Fixes for regressions in 2.0.8:
-
Output links generated when building the site work once again (#2435).
-
pkgdown once again uses Bootstrap version specified in a template
package (@gadenbuie, #2443).
-
-
Front-end improvements:
-
The skip link now becomes visible when focussed (#2138). Thanks to @glin
for the styles! -
The left and right footers no longer contain an extra empty paragraph tag
and the footer gains additional padding-top to keep the whitespace constant
(#2381). -
Clipboard buttons report their action again ("Copied!") (#2462)
-
-
It is now easier to preview parts of the website locally interactively.
build_reference_index()
and friends will callinit_site()
automatically
instead of erroring (@olivroy, #2329). -
build_article()
gains a newnew_process
argument which allows to build a
vignette in the current process for debugging purposes. We've also improved
the error messages and tracebacks if an article fails to build, hopefully
also making debugging easier (#2438). -
build_article_index()
andbuild_reference_index()
use an improved BS5
template that correctly wraps each section description in a<div>
, rather
than a<p>
. This eliminates an empty pargraph tag that preceded each section
description (#2352). -
build_home()
no longer errors when you have an empty.md
file (#2309).
It alos no longer renders Github issue and pull request templates
(@hsloot, #2362) -
build_news()
now warns if it doesn't find any version headings, suggesting
that thatNEWS.md
is structured incorrectly (#2213). -
build_readme()
now correctly tweaks links to markdown files that use an
anchor, e.g.foo.md#heading-name
(#2313). -
build_reference_index()
gives more informative errors if yourcontents
field is malformed (#2323). -
check_pkgdown()
no longer errors if your intro vignette is an article is
not listed in_pkgdown.yml
(@olivroy #2150). -
data_template()
gives a more informative error if you've misspecified the navbar (#2312).
pkgdown 2.0.8
-
pkgdown is now compatible with (and requires) bslib >= 0.5.1
(@gadenbuie, #2395), including a fix to BS5 navbar template to get
navbar.type: dark
to work with Bootstrap 5.3+ (@tanho63, #2388) -
Now uses cli to provide interactive feedback.
-
Avoid unwanted linebreaks from parsing
DESCRIPTION
(@salim-b, #2247). -
Translations
-
build_article_index()
now sorts vignettes and non-vignette articles
alphabetically by their filename (literally, theirbasename()
), by default
(@jennybc, #2253). -
Deprecated
build_favicon()
was removed (build_favicons()
remains). -
build_articles()
now sets RNG seed by default. Use
build_articles(seed = NULL)
for the old (unreproducible) behaviour.
(@salim-b, #2354). -
build_articles()
will process.qmd
articles with the quarto vignette
builder (@rcannood, #2404). -
build_articles()
andbuild_reference()
now set RNG seed for htmlwidgets
IDs. This reduces noise in final HTML output, both for articles and examples
that contain htmlwidgets (@salim-b, #2294, #2354). -
build_news()
correctly parses of github profiles and issues into links
when present at the beginning of list items (@pearsonca, #2122) -
build_reference()
setsseed
correctly; it was previously reset too early
(@salim-b, #2355) -
Rd -> html translation
-
build_reference_index()
no longer generates redundant entries when multiple
explicit@usage
tags are provided (@klmr, #2302) -
build_reference_index()
correctly handles topic names that conflict with
selector functions (@dmurdoch, #2397).
pkgdown 2.0.7
- Fix topic match selection when there is an unmatched selection followed by a matched selection (@bundfussr, #2234)
- Fix highlighting of nested not R code blocks (for instance, example of R
Markdown code with chunks) (@idavydov, #2237). - Tweak German translation (@krlmlr, @mgirlich, @lhdjung, #2149, #2236)
- Remove mention of (defunct) Twitter card validator, provide alternatives (@Bisaloo, #2185)
- Fix
keywords
typo incheck_missing_topics()
message (@swsoyee, #2178). - Use jsdeliver CDN for bootstrap-toc (@GregorDeCillia, #2207).
pkgdown 2.0.6
-
If you're using an RStudio daily, output file names are now clickable,
previewing the generated HTML in the browser (#2157). -
Getting started vignette no longer needs to be included in the articles index
(#2150). -
If there aren't any functions in the
\usage{}
block, then pkgdown will
now shows all aliases on the reference index, rather than just the topic
name (#1624).
pkgdown 2.0.5
-
Correctly generate downlit link targets for topics that have a file name
ending in.
(#2128). -
build_articles()
: if build fails because the index doesn't include all
articles, you're now told what articles are missing (@zkamvar, #2121). -
build_home()
now escapes angle brackets in author comments(#2127). -
build_home()
will automatically render and link.github/SUPPORT.md
(@IndrajeetPatil, #2124). -
build_news()
once again fails to link@username
at start of
bullet. I had to reverted #2030 because of #2122. -
build_reference()
: restore accidentally nerfedhas_keyword()
and
has_concept()
reference selectors (#2126) and add tests.
pkgdown 2.0.4
-
New
check_pkgdown()
provides a lightweight way to check that your
_pkgdown.yml
is valid without building the site (#2056). Invalid
_pkgdown.yml
now 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@username
links in more places (#2030). -
build_reference()
:-
You can once again exclude topics from the reference index with
-
(#2040). -
Inline markdown in
title
s andsubtitle
s is now supported(#2039). -
Package logos will be automatically stripped from the
.Rd
you 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-9
for 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
target
argument (#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 thesrc
path for<img>
tags with absolute paths (#1955). -
build_news()
once again works ifNEWS.md
uses<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 asubdir
argument, 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).