preview
Render and preview a document or website project.
Automatically reloads the browser when input files or document resources (e.g. CSS) change.
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 previewing pass the –render option with “all” or a comma-separated list of formats to render.
For document preview, input file changes will result in a re-render (pass –no-watch to prevent).
You can also include arbitrary command line arguments to be forwarded to quarto render.
quarto preview [file:string] [...args:string]Options
| Flags | Arguments | Description |
|---|---|---|
-h, --help |
Show this help. | |
--port |
[port:number] |
Suggested port to listen on (defaults to random value between 3000 and 8000). If the port is not available then a random port between 3000 and 8000 will be selected. |
--host |
[host:string] |
Hostname to bind to (defaults to 127.0.0.1) |
--render |
[format:string] |
Render to the specified format(s) before previewing |
--no-serve |
Don't run a local preview web server (just monitor and re-render input files) | |
--no-navigate |
Don't navigate the browser automatically when outputs are updated. | |
--no-browser |
Don't open a browser to preview the site. | |
--no-watch-inputs |
Do not re-render input files when they change. | |
--timeout |
Time (in seconds) after which to exit if there are no active clients. | |
--log |
Path to log file | |
--log-level |
Log level (info, warning, error, critical) | |
--log-format |
Log format (plain, json-stream) | |
--quiet |
Suppress console output. | |
--profile |
Active project profile(s) |
Commands
| Command | Description |
|---|---|
help |
Show this help or the help of a sub-command. |
Examples
Preview document
Terminal
quarto preview doc.qmdPreview document with render command line args
Terminal
quarto preview doc.qmd --tocPreview document (don’t watch for input changes)
Terminal
quarto preview doc.qmd --no-watch-inputsPreview website with most recent execution results
Terminal
quarto previewPreviewing website using a specific port
Terminal
quarto preview --port 4444Preview website (don’t open a browser)
Terminal
quarto preview --no-browserFully render all website/book formats then preview
Terminal
quarto preview --render allFully render the html format then preview
Terminal
quarto preview --render html