Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package down to fldgen #38

Closed
kdorheim opened this issue Apr 27, 2020 · 1 comment
Closed

Add package down to fldgen #38

kdorheim opened this issue Apr 27, 2020 · 1 comment
Assignees

Comments

@kdorheim
Copy link
Contributor

Consolidate the documentation and make it reproducible using https://pkgdown.r-lib.org/articles/pkgdown.html

@kdorheim kdorheim self-assigned this Apr 27, 2020
@kdorheim
Copy link
Contributor Author

kdorheim commented May 5, 2020

The documentation has been consolidated on the gh-pages branch!

So it turns out that adding the docs file to the master branch while easy to do can increase the size of the repo. There is a work around however it is some what convoluted. Instead of the regular pkgdown::build_site() you will need to use the deploy_to_branch() see https://pkgdown.r-lib.org/reference/deploy_to_branch.html. I ran into a lot of issues with git hub permissions and ended up using something like as recommend by Alexey.

The ability to run the following from command line depends on having pandoc installed.

# Create gh-pages branch
git checkout --orphan gh-pages
# Make sure this works before running next command!
git rm -rf .
git commit --allow-empty -m "Initialize gh-pages"
git push -u origin gh-pages
# Create a new worktree
git worktree add ../fldgen-pkgdown gh-pages
# Launch R
R
# From R, run pkgdown
library(pkgdown)
pkg <- as_pkgdown(".", override = list(destination = "../fldgen-pkgdown"))
build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE)
quit()
# Back to command line
cd ../fldgen-pkgdown
git push

@kdorheim kdorheim closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant