rd2_roclet | R Documentation |
This roclets acts as a drop-in replacement for [roxygen2::rd_roclet], adding some extra features such as bibliography, or inline declaration for S4 generic.
rd2_roclet()
## S3 method for class 'roclet_rd2'
roclet_process(x, blocks, env, base_path = env)
## S3 method for class 'roclet_rd2'
roclet_clean(x, base_path)
x |
A |
blocks |
A list of roxy_block objects. |
env |
Package environment. |
base_path |
Path to root of source package. |
To use it add it needs to be declared in the roxygen options within your package's DESCRIPTION file: “' Roxygen: list(roclets = c('collate', 'namespace', 'roclets::rd2_roclet')) “'
Extra features are sometimes submitted as pull request to be incorporated into the main 'roxygen2' package. This roclet enables using them while they are being reviewed – and potentially not accepted.
Adds support for the following:
* tag '@bibliography' in roxygen chunks: declares external Bibtex files in which the entries parsed from '@cite', '\cite', '\citep' or '[@]' commands are copied from. This is typically a large file that contains all your references. * tag '@cite <bibtex_entries>' in roxygen chunks: to add references to the man page using their bibtex entry. * '\cite' or '\citep' in Latex markup-based documents such as vignettes or roxygen chunks * '[@<author2019>]' in markdown-based documents such as vignettes or roxygen chunks
At the end of a 'roxygenize' run, all the references found in the package man pages or vignettes are gathered and stored in file 'inst/REFERENCES.bib' in the source package directory, hence making the generation of package independent of the – large – external Bibtex file.
library(roxygen2)
text <-"
#' Title
#'
#' @bibliography a/b/c.bib
f <- function(){
}
"
parse_text(text)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.