vignettes/old/rdoxygen-design.md

Doxygen Documentation of C++ Libraries in R

Design Considerations

Arguments to Exported Functions

# do all steps below and trigger doxygen rendering
doxy <- function(
  pkg = ".", # same as devtools::{document/load_all/install} argument, i.e., any subfolder of package root
  doxyfile = "inst/doc/doxygen/Doxyfile", # path to doxyfile relative to package root
  options, # passed to doxy_edit
  vignette = FALSE # add vignette: if TRUE then doxy_vignette is triggered
  name = "DoxygenVignette.Rmd", # passed to doxy_vignette
  index # passed to doxy_vignette
)

# add Doxyfile in package if it does not exist
doxy_init <- function(
  pkg = ".",
  doxyfile = "inst/doc/doxygen/Doxyfile"
)

# edit Doxyfile tags if doxyfile exists
doxy_edit <- function(
  pkg = ".", 
  doxyfile = "inst/doc/doxygen/Doxyfile", 
  options # named vector of key-value pairs to edit Doxyfile tags
)

# wrap Doxygen documentation in R vignette
doxy_vignette <- function(
  pkg = ".",
  name = "DoxygenVignette.Rmd", # name of Doxygen vignette
  index # name of vignette Index Entry. defaults to "C++ library documentation for package PackageName"
  overwrite = FALSE # should an existing vignette file be overwritten
)

Default File Locations

Default Doxyfile Tags

First, it should be noted that the INPUT tag cannot handle relative directories outside of where it's run, i.e.:

# in Doxyfile
INPUT = src/ # works fine
INPUT = ../src/ # does not work

Thus, rdoxygen runs Doxygen from the package root folder. That being said, here are the default tags rdoxygen sets in the Doxyfile:

INPUT = src/ inst/include/ # the two locations in which you expect to find C++ code
OUTPUT_DIRECTORY = inst/doc/doxygen
PROJECT_NAME = "C++ Library Documentation for Package PackageName"

Also note that another useful option might be USE_MATHJAX = YES, which makes formulas look much nicer than when this option is set to NO.



nevrome/rdoxygen documentation built on Sept. 5, 2019, 3:12 p.m.