knitr::opts_chunk$set(echo = TRUE)

Getting started

  1. Open your package's .Rproj file

Option 1

  1. Run usethis::use_pkgdown() once to configure. This will generate additional files and sub-folders (e.g. docs).
  2. Run pkgdown::build_site() to preview site and before any push to GitHub. There will be a lot of ancillary files, but check them in. They're all necessary for GitHub to build the website.

Option 2

With this option, you don't need to activate Github Pages (in the next section) because it'll already be done.

usethis::use_pkgdown_github_pages()
pkgdown::build_site_github_pages()

Any .Rmd in the vignette sub-folder will be automatically converted to an article.

Activate GitHub Pages:

  1. Navigate in GitHub to Settings > Pages
  2. Set the GitHub Pages Source to main branch & the sub-folder docs

It may take anywhere from 5 mins to 20 mins to see the website.

Additional Information

https://pkgdown.r-lib.org/articles/pkgdown.html



cyyllam/mycensus documentation built on July 7, 2022, 8:40 p.m.