highlight() no longer errors if a package imputed tohave been attached isn’t installed.
Correctly linkrequireNamespace(MASS)(#151).
Supports new base pipe|> syntax (#126).
Every line get its own<span> to match pandoc(#122).
Multi-line tokens (e.g. strings) now get a<span> per line (#139).
Very long strings or other tokens are no longer truncated (
Function calls (in inline and code blocks) will no longer tonon-function topics (#135).
Re-exports detection no longer relies on name of.Rdfile (#134).
Link to correct topic with::() andutils::help() (
Generate correct link for Bioconductor vignettes (
Messages, warnings, and errors now get a much more minimal style.Messages are styled the same way as output; and warnings and errors onlystyle the “Warning” or “Error” text. This makes these types of outputeasier to read, and easier for package developers to stylethemselves.
Messages, warnings, and errors now retrieve their text usingconditionMessage(), which supports more advanced types ofconditions (
The overall structure of the syntax highlighting has beenoverhauled. Now each line is wrapped in a<span> withclassr-in (input code),r-out (output printedto console),r-plot (plots),r-msg (messages),r-wrn (warnings), andr-err (errors).Additionally, the prompt (#>) is wrapped in a<span>. Altogether, these changes shouldgive much more flexibility for styling with CSS (#90).
ANSI escapes no longer generate invalid HTML (#79).
Changes to better support for HTML widgets and rgl in pkgdown(@dmurdoch, #78). Inparticular,evaluate_and_highlight() now returns anadditional attribute containing all extra dependencies needed to renderthe returned HTML.
Packages attached when you calllibrary(package)(including by the tidyverse), are now taken into account whenautolinking (#87).
In code blocks, custom infix operators are now autolinked (#89).In inline code, infix operators are no longer autolinked; this lead totoo many false positives. You can still link with (e.g.)?"-" (#86).
Inline calls with arguments (e.g. foo(1, 2)) are nolonger auto-linked, as intended and documented (#82).
Autolinkingvignette(foo, package = "pkg") no longererrors ifpkg is not installed (#85).
Unusual help calls (e.g. help(a$b)), no longergenerate errors (#77).
Rare warning about incomplete final line inautolink_url("pkgname::foo") is now suppressed (
href_package() is now exported (#103).
Auto-linking is more likely to succeed when the remote package isnot installed as downlit now looks for the URL usingtools::CRAN_package_db() for CRAN packages, and andavailable.packages() for packages installed from non-CRANrepos (@ARawles,#108).
Functions in HTML<summary> elements are nolonger autolinked (
When auto-linkingvignette(foo), downlit now looksfor a vignette named foo in the packages it knows to be attached(#61).
Can now force highlighting of any<pre> bywrapping it inside a<div> withclass = "downlit". This is useful in cases where it mayotherwise be hard to set the class of the<pre>.
In comments,\u2029 is converted to\033 to make it possible to preserve ANSI escapes whenpassed through xml2.
No longer errors on library calls with named but emptyarguments.
Autolinking can use metadata stored in package itself withpkgdown settingdeploy.install_metadata; this is useful forpackages that only have private websites (
Autolinking guesses reference and article urls for pkgdown sitesthat haven’t set url (
R6 classes are autolinked when a new object is created i.e. inr6_object$new(),r6_object will link to itsdocs (#59,
R6 methods are no longer autolinked as if they were functions ofthe same name (#54,
classes_pandoc() andclasses_chroma()have been thoroughly revieweed to produce syntax highlighting as similaras possible to RStudio.
downlit_html_path() has a more flexible XPathidentifying R code blocks, and aclasses argument (#53,@maelle,
Trailing/ are no longer stripped from URLs (#45,@krlmlr).
Removed extra newline in<pre> output (#42,@krlmlr).
NEWS.md file to track changes to thepackage.