quarto_preview | R Documentation |
Render and preview a Quarto document or website project.
quarto_preview(
file = NULL,
render = "auto",
port = "auto",
host = "127.0.0.1",
browse = TRUE,
watch = TRUE,
navigate = TRUE
)
quarto_preview_stop()
file |
The document or website project directory to preview (defaults to current working directory) |
render |
For website preview, the most recent execution results of
computational documents are used to render the site (this is to optimize
startup time). If you want to perform a full render prior to serving pass
"all" or a vector of specific formats to render. Pass "default" to render
the default format for the site. For document preview, the document is
rendered prior to preview (pass |
port |
Port to listen on (defaults to 4848) |
host |
Hostname to bind to (defaults to 127.0.0.1) |
browse |
Open a browser to preview the content. Defaults to using the
RStudio Viewer when running within RStudio.Pass a function (e.g.
|
watch |
Watch for changes and automatically reload browser. |
navigate |
Automatically navigate the preview browser to the most recently rendered document. |
Automatically reloads the browser when input files are re-rendered or document resources (e.g. CSS) change.
## Not run:
# Preview the project in the current directory
quarto_preview()
# Preview a document
quarto_preview("document.qmd")
# Preview the project in "myproj" directory and use external browser
# (rather than RStudio Viewer)
quarto_preview("myproj", open = utils::browseURL)
# Stop any running quarto preview
quarto_preview_stop()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.