Our group publishes R packages (for internal use) to a CRAN-like repository. Users have complained (rightly) that the documentation isn't very accessible to them without firing up R and doing ?function_name
interactively.
So I would like to build a website with the documentation for all the versions of the R packages my group has created.
If I do pkgdown::build_site()
in my package's top-level directory, that creates a nice self-contained tree docs/
containing HTML files with all the docs for that package. It even has a prominent version number at the top of every page, which is nice.
Now I'd like to situate that document tree in a larger site, so that a user can browse to the package they're looking for, look at previous versions, etc. Is that something someone's set up a solution for?
I'm thinking that the docs/
directory could simply be rsync
'd to a web server, building the path from info in DESCRIPTION
, e.g.:
Rscript -e 'pkgdown::build_site()'
mkdir -p r-docs/MyPackage # Replace with real package name
mv docs r-docs/MyPackage/1.3.1 # Replace with real version
rsync -avz r-docs/ example.com:r-docs/
But this gets a bit awkward to do repeatedly - is there some support for this use case in pkgdown
or another similar package (not necessarily tied to pkgdown
, would use whatever's most appropriate)?