The native R functionalities only allow PDF exports of reference manuals. This shall be extended by converting the package documentation files into markdown files and combining them into a markdown version of the package reference manual.
To install the
Rd2md package, you can either use the official CRAN repository or install directly from github.
## if not already installed:# install.packages("devtools")library(devtools)install_github("quants-ch/Rd2md")
The Reference Manual of a package exported as PDF is an R command shipped with R.
R CMD Rd2pdf
However, pdf versions are quite static and nothing can really be done with it.
The single .Rd files are well structured and can easily parsed to .md files. Thanks to jbryer to publish the relevant code.
This fact is used to replicate a Reference Manual in markdown format.
There main function to create the reference manual in markdown format is
ReferenceManual(pkg, outdir = getwd(), verbose=FALSE)
pkg_ variable, provide the full file path of the source code of the package.
Be aware that this uses source code only. This means, it will look into the
man directory of your package source and take all
.Rd files into considerations.