| save_notebook | R Documentation |
Renders a Quarto or R Markdown notebook and saves the output to the configured notebooks output directory. The directory is created lazily on first use.
save_notebook(
file,
name = NULL,
format = "html",
public = FALSE,
overwrite = TRUE,
embed_resources = TRUE,
...
)
file |
Path to the .qmd or .Rmd file to render |
name |
Optional new name for the output file (without extension). If NULL, uses the original notebook name. |
format |
Output format: "html" (default), "pdf", or "docx" |
public |
If TRUE, saves to public outputs directory (for project_sensitive type) |
overwrite |
If TRUE, overwrites existing files (default: TRUE) |
embed_resources |
If TRUE, creates a self-contained file with embedded resources (default: TRUE for html format) |
... |
Additional arguments passed to quarto render |
The path to the saved file (invisibly)
if (FALSE) {
# Render and save a notebook
save_notebook("notebooks/analysis.qmd")
# Save with a custom name
save_notebook("notebooks/analysis.qmd", name = "final_analysis")
# Render to PDF
save_notebook("notebooks/analysis.qmd", format = "pdf")
# Save to public directory (for sensitive projects)
save_notebook("notebooks/analysis.qmd", public = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.