My package is hosted in github, and user can install it through devtools::install_github
.
Now I'm using pkgdown to generate documentation site, which created a 10M docs folder. Then I found devtools::install_github
always download the whole master zip ball which become quite slow.
I tried to exclude the docs folder with these attempts:
.Rbuildignore
, turned out it's only about bundled package, whileinstall_github
is installing source package so it doesn't work.- put package in
pkg
folder, put the generateddocs
folder out ofpkg
folder. However the whole master zip ball is always downloaded, even withsubdir = "pkg"
specified. - put development in a branch, and to create a special package branch without docs folder. Merge two branch but let package branch exclude docs folder. I tried make .gitignore to be branch specific but it doesn't seem to work. This seemed to be impossible.
- My newest attempt is to create a separate repo solely for the website, just let
pkgdown
create the website in that folder likebuild_site(path = "../docsite/docs")
. This should solve the problem and is simple and clean. The only imperfection is the website url will not be the usually pattern.
EDIT: with the latest version of pkgdown
, there is no path
parameter anymore, you need to specify it in the site configuration yaml, which works better (you don't need to specify it in every command).