render_book | R Documentation |
Render multiple R Markdown files under the current working directory into a
book. It can be used in the RStudio IDE (specifically, the knit
field
in YAML). The preview_chapter()
function is a wrapper of
render_book(preview = TRUE)
.
render_book( input = ".", output_format = NULL, ..., clean = TRUE, envir = parent.frame(), clean_envir = !interactive(), output_dir = NULL, new_session = NA, preview = FALSE, config_file = "_bookdown.yml" ) preview_chapter(..., envir = parent.frame())
input |
A directory, an input filename or multiple filenames. For a
directory, ‘index.Rmd’ will be used if it exists in this (book)
project directory. For filenames, if |
output_format, ..., clean, envir |
Arguments to be passed to
|
clean_envir |
This argument has been deprecated and will be removed in future versions of bookdown. |
output_dir |
The output directory. If |
new_session |
Whether to use new R sessions to compile individual Rmd
files (if not provided, the value of the |
preview |
Whether to render and preview the input files specified by the
|
config_file |
The book configuration file. |
There are two ways to render a book from Rmd files. The default way
(new_session = FALSE
) is to merge Rmd files into a single file and
render this file. You can also choose to render each individual Rmd file in a
new R session (new_session = TRUE
).
# see https://bookdown.org/yihui/bookdown for the full documentation if (file.exists("index.Rmd")) bookdown::render_book("index.Rmd") ## Not run: # will use the default format defined in index.Rmd or _output.yml bookdown::render_book("index.Rmd") # will use the options for format defined in YAML metadata bookdown::render_book("index.Rmd", "bookdown::pdf_book") # If you pass an output format object, it must have all the options set bookdown::render_book("index.Rmd", bookdown::pdf_book(toc = FALSE)) # will render the book in the current directory bookdown::render_book() # this is equivalent to bookdown::render_book("index.Rmd") # will render the book living in the specified directory bookdown::render_book("my_book_project") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.