Open lorenzwalthert opened 2 years ago
I would add the following suggestion to @lorenzwalthert's. If you delineate a package using the {packagename} convention, one should NOT put the word "package" after the curly braces. All of the suggestions provided by @lorenzwalthert follow this convention but I see lots of examples on the web that look like {packagename} package. I find it redundant and think it would be a good idea, if @lorenzwalthert's suggestion is included in the style guide, to explicitly state
The word package should not be added after the curly braces.
Using this convention also helps {pkgdown}
to link to the package website, if one exists and is mentioned in the DESCRIPTION
file:
downlit:::autolink_curly("{cli}")
#> [1] "<a href='https://cli.r-lib.org'>cli</a>"
Created on 2024-04-21 with reprex v2.1.0
The current recommendation is to use package on first usage, then just package I believe, or just package (Reference: https://github.com/tidyverse/style/issues/50). A recent trend is that people opt for {package}, .e.g. on Twitter. This notation is deeply rooted in base R, e.g. in help files:
To me, it makes perfect sense because it won't be confused with
code_we <- write
orpkg::fun()
, yet {package} stands out from normal text with a unique visual signature, without conflicting with common usage of italics, bold or "quoted".Here's a visual comparison:
purrr::map()
immediately.purrr::map()
immediately.purrr::map()
immediately.