publish_notebook()
Render a Quarto notebook with the quarto command and upload the result.
A bucket with static_hosting: true gets <dest>/index.html and a
clean URL ending in /. Other buckets get <dest>.html as one
self-contained file.
With no connection and no buckets in the settings, a project with a Framework Cloud
token publishes to the cloud instead.
Usage
publish_notebook(
file: str | Path,
dest: str | None = None,
connection: str | None = None,
self_contained: bool = True,
format: str = 'html',
slug: str | bool | None = None,
include_private: bool = False,
*,
to: str | None = None,
allow_private: bool | None = None,
collection: str | int | None = None,
share_unlisted: bool = False,
) -> str
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| file required | str | Path |
An existing |
|
| dest | str | None | None |
Where to put the result in the bucket, without |
| connection | str | None | None |
A storage bucket name from the settings. Setting it always publishes to a bucket. Default: the project's default bucket, or Framework Cloud when no bucket is configured. |
| self_contained | bool | True |
Embed resources in one HTML file. Buckets without static hosting are always self-contained. With static hosting, False uploads the render folder. |
| format | str | 'html' |
The Quarto output format passed to |
| slug | str | bool | None | None |
For Framework Cloud: a string names the document and turns on its readable URL, True uses the derived name, and False turns the readable URL off. A storage bucket ignores it with a warning. |
| include_private | bool | False |
Upload files with "private" in their path without asking. Only a person who has reviewed the files should set this. |
| to | str | None | None |
"cloud" explicitly publishes to Framework Cloud and "bucket" selects storage. "github" publishes to the project's GitHub Pages site: the page is copied to |
| allow_private | bool | None | None |
Deprecated name for |
| collection | str | int | None | None |
Existing project collection ID or slug on Framework Cloud. |
| share_unlisted | bool | False |
Explicitly allow collection readers to access an unlisted artifact. |
Value
The public URL.
Raises
FrameworkError: When the file is missing or not a notebook, has "private" in its path and is not confirmed, Quarto is not installed, rendering fails, or there is nowhere to publish.