My Quarto book template and setup for R user.
I recommend using renv package.
Init
# install.packages("renv")
renv::init()
Snapshot
renv::snapshot()
2 files will be added: renv.lock
and renv/
renv::use_python(type = "virtualenv")
Python virtual environment within project is recommended.
If you want to render and build site in the cloud using Github Actions.
-
Go to Quarto Github Actions
-
Choose workflow (
.yaml
) file you want, then copy the URL. -
usethis::use_github_action()
will setup everything in local.
usethis::use_github_action(url = "url-of-the-yaml")
- If your book using
{renv}
, add this to the workflow file (.yaml
) before render book.
# Set up R Environment
- name: Install R Environment
uses: r-lib/actions/setup-renv@v2
-
You can add
_book
(output dir) to .gitignore and don't need torender
book before push to Github. -
Git Push!
(Note: If you want to deploy to Netlify, you will need to config 2 Github secrets, see this)