borrow_chapter.Rd
Borrow/link a chapter from another bookdown course
borrow_chapter(
doc_path,
repo_name = NULL,
branch = "main",
git_pat = NULL,
base_url = "https://raw.githubusercontent.com",
dest_dir = file.path("resources", "other_chapters")
)
A file path of markdown or R Markdown document of the chapter in the repository you are retrieving it from that you would like to include in the current document. e.g "docs/intro.md" or "intro.md"
A character vector indicating the repo name of where you are borrowing from. e.g. "jhudsl/OTTR_Template/". For a Wiki of a repo, use "wiki/jhudsl/OTTR_Template/" If nothing is provided, will look for local file.
Default is to pull from main branch, but need to declare if other branch is needed.
A personal access token from GitHub. Only necessary if the repository being checked is a private repository.
it's assumed this is coming from github so it is by default 'https://raw.githubusercontent.com/'
A file path where the file should be stored upon arrival to the current repository.
An Rmarkdown or markdown is knitted into the document from another repository
if (FALSE) {
# In an Rmarkdown document:
# For a file in another repository:
# ```{r, echo=FALSE, results='asis'}
borrow_chapter(
doc_path = "docs/02-chapter_of_course.md",
repo_name = "jhudsl/OTTR_Template"
)
# ```
# For a local file:
# ```{r, echo=FALSE, results='asis'}
borrow_chapter(doc_path = "02-chapter_of_course.Rmd")
# ```
}