Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lightbridge-ks/quarto-book-template
My Quarto book template and setup for R user.
https://github.com/lightbridge-ks/quarto-book-template
book quarto template
Last synced: 30 days ago
JSON representation
My Quarto book template and setup for R user.
- Host: GitHub
- URL: https://github.com/lightbridge-ks/quarto-book-template
- Owner: Lightbridge-KS
- Created: 2022-04-16T13:16:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-16T13:21:35.000Z (almost 3 years ago)
- Last Synced: 2024-11-15T18:51:41.764Z (3 months ago)
- Topics: book, quarto, template
- Language: TeX
- Homepage:
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Quarto Book Template
My [Quarto book](https://quarto.org/docs/reference/projects/books.html) template and setup for R user.
## If use `R` code
I recommend using [renv package](https://rstudio.github.io/renv/articles/renv.html).
Init
``` r
# install.packages("renv")
renv::init()
```Snapshot
``` r
renv::snapshot()
```2 files will be added: `renv.lock` and `renv/`
## If use `Python` code
``` r
renv::use_python(type = "virtualenv")
```Python virtual environment within project is [recommended](https://rstudio.github.io/renv/reference/use_python.html).
## Continuous Deployment
If you want to render and build site in the cloud using Github Actions.
- Go to [Quarto Github Actions](https://github.com/quarto-dev/quarto-actions/tree/main/examples)
- Choose workflow (`.yaml`) file you want, then copy the URL.
- [`usethis::use_github_action()`](https://usethis.r-lib.org/reference/github_actions.html?q=use_git#use-github-action-) will setup everything in local.
``` r
usethis::use_github_action(url = "url-of-the-yaml")
```- If your book using `{renv}`, add this to the workflow file (`.yaml`) before render book.
``` yaml
# 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 to `render` 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](https://github.com/nwtgck/actions-netlify))