packagedocs v0.4.0

0

Monthly downloads

0th

Percentile

by Ryan Hafen

Build Website of Package Documentation

Build a package documentation and function reference site and use it as the package vignette.

Readme

packagedocs

Build Status

packagedocs provides a mechanism for simple generation and automated deployment of nice-looking online R package documentation that plugs into the traditional R package vignette system. Example for this package here.

Features

  • All documentation is generated from a single RMarkdown file, "vignettes/docs.Rmd"
  • Documentation is nicely styled and responsive for mobile viewing with a collapsible auto-scrolling table of contents
  • Simple Github / TravisCI hooks for automatically building and deploying documentation to your github pages branch after each commit
  • Github pages branch is stomped on each commit to prevent repository bloat
  • Once configured, any commits pushed to the master branch of repository https://github.com/username/reponame will have docs made automatically available at https://username.github.io/reponame
  • Valid R vignettes are generated that point to the live version of the docs
  • Support for lazy rendering of htmlwidget outputs, useful when embedding several visualizations in a vignette
  • Automatic generation of all R object and function documentation, called the "function reference"
  • Examples in the function reference are evaluated and the output, including graphics, is rendered inline with the documentation
  • The function reference can be organized into groups with custom headings using a yaml configuration file
  • A convenience function is provided for linking references to functions in your vignette directly to the associated function documentation on the generated function reference page
  • Helper functions to initialize, run, and set up your docs for Github deployment

Installation

devtools::install_github("hafen/packagedocs")

Usage

There are three main functions.

To initialize your packagedocs documentation:

# in current package directory
packagedocs::init_vignettes()

This will create some files in your package's "vignettes" directory. Edit "vignettes/docs.Rmd" and to generate your vignettes, run:

packagedocs::build_vignettes()

To set up your repository to automatically build and deploy to your github pages branch on every commit:

packagedocs::use_travis()

More detail about how to use these is found in the package's documentation.

Acknowledgements

This package has gone through several iterations, and was heavily influenced and borrows from Hadley Wickham's staticdocs (now pkgdown) package.

Functions in packagedocs

Name Description
init_vignettes Initialize a new packagedocs project
package_docs Generate package docs
render_redirect Render vignette redirect
check_rd_index Check rd_index.yaml for missing or extra topics
build_vignettes Build CRAN and gh-pages vignettes
check_output Check output for warnings and errors
read_rmd_yaml Read .Rmd yaml header
deploy_travis Deploy to Github Pages from Travis-CI
secure_token Secure personal access token
to_html Convert an rdoc to a list of html components.
use_travis Use Travis CI
rd_link Translate a reference to a package function into a link to that function's documentation in rd.html
rd_template Generate the text to put in a rd.rmd file to build a package function reference
No Results!

Last month downloads

Details

Date 2016-10-28
License MIT + file LICENSE
URL http://hafen.github.io/packagedocs, https://github.com/hafen/packagedocs
BugReports https://github.com/hafen/packagedocs/issues
LazyData true
RoxygenNote 5.0.1
VignetteBuilder packagedocs
NeedsCompilation no
Packaged 2016-11-03 19:55:27 UTC; hafen
Repository CRAN
Date/Publication 2016-11-04 00:41:33

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/packagedocs)](http://www.rdocumentation.org/packages/packagedocs)