publish_notebook
Publish a Quarto notebook to S3
Renders a Quarto document and uploads it to S3. The notebook is rendered to a temporary directory, uploaded, then cleaned up.
Usage
publish_notebook(
file,
dest = NULL,
connection = NULL,
self_contained = TRUE,
format = "html",
...
)
Arguments
| Argument | Description |
|---|---|
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. |
Details
The URL format depends on the S3 connection's static_hosting setting:
static_hosting: true-> uploads todest/index.html, returnsdest/static_hosting: false(default) -> uploads asdest.html, returnsdest.html
Returns
Character. Public URL of the published notebook.
Examples
# 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)
Source: R/publish.R