The goal of tldr is to provide short-form documentation in the console, styled with cli:
Included are RStudio addins which, when bound to keyboard shortcuts, facilitate efficient access to tldr documentation:
tldr is inspired by tldr-pages, a project which provides simpler documentation for command-line tools.
If you are interested in installing tldr you can install the development version from GitHub with:
# install.packages("remotes")
remotes::install_github("jamesotto852/tldr")
We have provided documentation for for commonly used functions included in the base distribution of R in tldrDocs, which you can install via:
remotes::install_github("jamesotto852/tldrDocs")
This package includes a Roxygen2 extension which allows for the creation
of tldr documentation files from Roxygen skeletons. This is done via
tldr_roclet()
and custom Roxygen tags such as @paramtldr
and
@exampletldr
. Once the system for documentation is more stable, we
will be writing a guide on its use for other developers. For an example
of what a package with tldr-style documentation looks like, there is
another package:
tldrExample,
which exports several simple objects with Roxygen skeletons that produce
tldr documentation.
tldr_roclet()
creates .Rd files based on relevant tags in the Roxygen
skeleton (including the new @paramtldr
and @exampletldr
). These .Rd
files are written to the /inst/tldr/
directory. Once the package is
installed, tldr_help()
and tldr_package()
are able to find the
relevant files which are turned into console output by tldr()
.
This process is based on the help()
function—for those who are
interested, I have a
blog
post in which I go through how ?
and help()
work in detail.