We're using Rdpack
and BiBTeX to manage citations in the documentation, which requires a little more work than a standard Roxygen documentation setup.
To include a citation
inst/REFERENCES.bib
if not, create an entry it, save the bib file, and open a fresh R
session (this is important, as Rdpack sets environments that prevent updating in one session)
wherever you would like to include the citation in the roxygen documentation use
\insertCite{< citation key >}{TrenchR}
if you want it to be like Name (Year) instead of (Name Year), use
\insertCite{< citation key >;textual}{TrenchR}
Other formatting, etc. is available, see https://github.com/GeoBosh/Rdpack.
#'
#' @references
#' \insertAllCited{}
devtools::document()
"?functionname"
), you'll notice that the BibTex isn't actually rendered. To see it, you need to use viewRd
:Rdpack::viewRd("./man/<functionname>.Rd")
devtools::build()
and then installing the package from the built zip file and running
?TrenchR::functionname
To generate all of the help files in one line of code, run
mapply(Rdpack::viewRd, paste0("./man/", list.files("./man")[grepl(".Rd", list.files("./man"))]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.