https://github.com/mps9506/bookdowntargets
https://github.com/mps9506/bookdowntargets
bookdown r rmarkdown targets
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mps9506/bookdowntargets
- Owner: mps9506
- License: other
- Created: 2024-06-13T14:11:14.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-18T14:01:21.000Z (11 months ago)
- Last Synced: 2025-02-24T06:41:38.970Z (3 months ago)
- Topics: bookdown, r, rmarkdown, targets
- Language: R
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# bookdowntargets
[](https://www.repostatus.org/#concept)
[](https://github.com/mps9506/bookdowntargets/actions/workflows/R-CMD-check.yaml)
[](https://mps9506.r-universe.dev/bookdowntargets)
[](https://codecov.io/gh/mps9506/bookdowntargets)Experimental package implementing the targets pipeline for
bookdown projects as shown in this
[demo](https://github.com/jdtrat/tar-render-book-demo) by
[@jdtrat](https://github.com/jdtrat).
There are no promises this will be submitted to CRAN.## Installation
```{r eval=FALSE}
install.packages("bookdowntargets", repos = c("https://mps9506.r-universe.dev", "https://cloud.r-project.org"))
```## Example
This package has one function: `tar_render_book()`. This is a drop in
replacement for [`tarchetypes::tar_render()`](https://github.com/ropensci/tarchetypes)
but points to a directory with bookdown files.Note that `tar_render_book()` tracks dependency files (`_output.yml`, `_bookdown.yml`)
and these files are expected to be in the same directory as the `index.Rmd` file.
Targets should also track changes in `.bib`, `.lua`, or other files in the same
directory that if changed, will result in `tar_make()` running the target again.```{r eval=FALSE}
library(targets)
library(bookdowntargets)
list(
tar_target(dataset, data.frame(x = letters)),
tar_render_book(report, path = "report_directory")
)
```