Rocco is literate documentation for R packages in the spirit of Coffeescript's docco featuring syntax highlighting using highlight.js.
This package allows you to build both Rocco docs and pkgdown for your package.
To document your package, simply run
rocco::rocco("/path/to/package") # Will open browser interactively.
# This will build *just* Rocco docs, not pkgdown.
rocco::rocco("/path/to/package", pkgdown = FALSE)
# This will build the docs and push them to the repos gh-pages branch
rocco::rocco("/path/to/package", gh_pages = TRUE)
# This will install the rocco docs to /path/to/pkg/inst/docs/rocco
rocco::rocco("/path/to/pkg", "/path/to/pkg/inst/docs/rocco", browse = FALSE)
This package is not yet available from CRAN (as of April 4, 2015). To install the latest development builds directly from GitHub, run this instead:
if (!require("devtools")) install.packages("devtools")
devtools::install_github("robertzk/rocco")
Many thanks go to
-
The highlight.js project for the Javascript-based R syntax highlighting.
-
Sindre Sorhus for the Github Markdown style.
-
Hadley Wickham for pkgdown.
-
Jeremy Ashkenas for the original inspiration.