Releases: r-lib/pkgdown
pkgdown 2.2.0
Lifecycle changes
autolink_html()deprecated in 1.6.0 andpreview_page()have been removed.
New features
- New
build_llm_docs()generates allms.txtat the root directory of your site, and provides a.mdversion of every page. You can disable by addingllm-docs: falseto your_pkgdown.yaml(#2914, @maelle) build_articles()now executes quarto vignettes in the same working directory as RMarkdown vignettes, namely the directory in which they live (#2877).
Minor improvements and bug fixes
build_site()gained aquietargument, which is propagated to other functions (e.g.,build_articles()) and is useful for debugging build errors on GH actions.- New translations were add for Dutch (
nl) and Japanese (ja), thanks to @pepijn-devires and @shikokuchuo respectively. - Links generated with
\code{\link{foo}()}now have the()moved into the<a>in the generated output (@maelle). - Plots in dark mode are now transformed with a CSS filter to improve their visibility (thanks to @gadenbuie).
- Updated the translations vignette with instructions for building non-English sites through Github Actions.
- Added documentation explaining how to solve incorrect rendering of plotmath expressions under ragg devices on Linux. (@remlapmot, #2908)
- Improved the LaTeX syntax in one of the math rendering test cases (@remlapmot)
pkgdown 2.1.3
- Menu items can now set
classandid.
pkgdown 2.1.2
New features
- ROR IDs in
DESCRIPTIONare transformed into icons, similar to ORCID IDs. (#2850) - New
clean_site(force = TRUE)for cleaning ofdocs/regardless of whether it was built by pkgdown (#2827). - The language of the site is set from the first
Language:in theDESCRIPTIONif it is available and no other language is specified (@jonthegeek, #2808).
Bug fixes and minor improvements
- Option
pkgdown.internetwas removed because CDN file caching now requires an internet connection. - Math rendering using katex and mathjax was improved and now includes necessary components using CDN (#2704).
- Articles have improved test cases (thanks to @venpopov and @ethanbass).
- Sass variables from bslib are now used to set the navbar background color:
$navbar-bgfor the background color in light and dark mode, or$navbar-light-bgand$navbar-dark-bgfor individually controlling light and dark mode background colors.pkgdown-navbar-bgand$pkgdown-navbar-bg-darkboth still provide pkgdown-specific overrides (@gadenbuie, #2847). - Code repositories hosted on Codeberg are now supported in the
BugReportsandURLfields (@nfrerebeau, #2843). - 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/favicondirectory and then runningpkgdown::build_favicons(). - Reinstate Rd macro loading, which was accidentally disabled in v2.1.1 (#2782).
pkgdown 2.1.1
- Added keyboard shortcut,
/, to focus search bar (#2423) - The
BugReportsfield 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: truebut 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-renderingallows you to control how math is rendered across your site. The default usesmathmlwhich 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.develshould 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
iconbut notaria-labelwill now generate a message reminding you to provide one for to improve accessibility (#2533). - The
repo.source.urlfield no longer requires a trailing slash (#2017). - The
template.bslibitem now also accepts abootswatchkey (@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 theirsrcrefattributes tweaked in the same way that thesrcattributes 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-articlestop-level field that allows you to define articles that live in other packages (#2028). -
build_article()no longer has adataargument. 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/AUTHORSon 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_processargument 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.mdfile (#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.mdis 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: darkto 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.qmdarticles 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()setsseedcorrectly; it was previously reset too early
(@salim-b, #2355) -
Rd -> html translation
-
build_reference_index()no longer generates redundant entries when multiple
explicit@usagetags 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
keywordstypo 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@usernameat 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.