| publish_notebook | R Documentation |
Renders a Quarto document and uploads it to S3. The notebook is rendered to a temporary directory, uploaded, then cleaned up.
publish_notebook(
file,
dest = NULL,
connection = NULL,
self_contained = TRUE,
format = "html",
...
)
file |
Character. Path to .qmd file. |
dest |
Character or NULL. Destination path in S3 (without extension). If NULL, derives from filename (e.g., "analysis.qmd" -> "analysis"). |
connection |
Character or NULL. S3 connection name, or NULL for default. |
self_contained |
Logical. Whether to embed all resources. Default TRUE.
Ignored if |
format |
Character. Output format. Default "html". |
... |
Additional arguments passed to quarto render. |
The URL format depends on the S3 connection's static_hosting setting:
static_hosting: true -> uploads to dest/index.html, returns dest/
static_hosting: false (default) -> uploads as dest.html, returns dest.html
Character. Public URL of the published notebook.
if (FALSE) {
# With static_hosting: true -> returns /analysis/
# With static_hosting: false -> returns /analysis.html
publish_notebook("notebooks/analysis.qmd")
# Publish to specific location
publish_notebook("notebooks/analysis.qmd", dest = "reports/2024/q4")
# Publish non-self-contained (only with static_hosting: true)
publish_notebook("notebooks/analysis.qmd", self_contained = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.