generated from jhudsl/OTTR_Template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
03-AnVIL_modules.Rmd
52 lines (37 loc) · 1.77 KB
/
03-AnVIL_modules.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# AnVIL Module Library
There are several pieces of content that are useful across multiple books, such as "How to Create a Workspace". To reduce maintenance burden, the `AnVIL_Template` repository has a collection of `_child` R Markdown documents that can be included in your books.
You can see all the available AnVIL modules in the [AnVIL_Template book](https://jhudatascience.org/AnVIL_Template/)
## Include using `cow::borrow_chapter()`
To add a module to your book, include a code chunk with the `cow::borrow_chapter()` function, specifying the file for the module you want to borrow and the repository you want to borrow it from (the `AnVIL_Template` repository).
See the OTTR_Template [wiki page](https://github.com/jhudsl/OTTR_Template/wiki/Borrowing-chapters-between-courses) for the most recent instructions and additional details.
Here is an example of including the `_child_workspace_create.Rmd` with `cow::borrow_chapter()`
```{r, echo = FALSE, results='asis'}
cow::borrow_chapter(
doc_path = "child/_child_workspace_create.Rmd",
repo_name = "jhudsl/AnVIL_Template"
)
```
## Background Highlighting for Borrowed Chapters
You can use the `borrowed_chunk` [custom div block](https://bookdown.org/yihui/rmarkdown-cookbook/custom-blocks.html) to highlight borrowed content or any other content you choose.
**Basic format:**
```
:::: {.borrowed_chunk}
Code/Content here
::::
```
**Rendered with highlighting:**
:::: {.borrowed_chunk}
```{r, echo = FALSE, results='asis'}
cow::borrow_chapter(
doc_path = "child/_child_google_create_account.Rmd",
repo_name = "jhudsl/AnVIL_Template"
)
```
::::
**Rendered without highlighting:**
```{r, echo = FALSE, results='asis'}
cow::borrow_chapter(
doc_path = "child/_child_google_create_account.Rmd",
repo_name = "jhudsl/AnVIL_Template"
)
```