pkg_desc {litedown} | R Documentation |
Print the package description, news, citation, manual pages, and source code
Description
Helper functions to retrieve various types of package information that can be put together as the full package documentation like a pkgdown website. These functions can be called inside any R Markdown document.
Usage
pkg_desc(name = detect_pkg())
pkg_news(
name = detect_pkg(),
path = detect_news(name),
recent = 1,
toc = TRUE,
number_sections = TRUE,
...
)
pkg_code(
path = attr(detect_pkg(), "path"),
pattern = "[.](R|c|h|f|cpp)$",
toc = TRUE,
number_sections = TRUE,
link = TRUE
)
pkg_citation(name = detect_pkg())
pkg_manual(
name = detect_pkg(),
toc = TRUE,
number_sections = TRUE,
overview = TRUE,
examples = list()
)
Arguments
name |
The package name (by default, it is automatically detected from
the |
path |
For |
recent |
The number of recent versions to show. By default, only the
latest version's news entries are retrieved. To show the full news, set
|
toc |
Whether to add section headings to the document TOC (when TOC has been enabled for the document). |
number_sections |
Whether to number section headings (when sections are numbered in the document). |
... |
Other arguments to be passed to |
pattern |
A regular expression to match filenames that should be treated as source code. |
link |
Whether to add links on the file paths of source code. By
default, if a GitHub repo link is detected from the |
overview |
Whether to include the package overview page, i.e., the
|
examples |
A list of arguments to be passed to |
Value
A character vector (HTML or Markdown) that will be printed as is inside a code chunk of an R Markdown document.
pkg_desc()
returns an HTML table containing the package metadata.
pkg_news()
returns the news entries.
pkg_code()
returns the package source code under the R/
and
src/
directories.
pkg_citation()
returns the package citation in both the plain-text
and BibTeX formats.
pkg_manual()
returns all manual pages of the package in HTML.
Examples
## Not run:
litedown::pkg_desc()
litedown::pkg_news()
litedown::pkg_citation()
## End(Not run)