Learn R Programming

quarto (version 0.3)

quarto_serve: Quarto Development Server

Description

Run a local web server for a Quarto project.

Usage

quarto_serve(
  dir = NULL,
  port = "auto",
  browse = TRUE,
  watch = TRUE,
  navigate = TRUE
)

quarto_serve_stop()

Arguments

dir

The project directory to serve (defaults to current working directory)

port

Port to listen on (defaults to 4848)

browse

Open a browser to preview the site. Defaults to using the RStudio Viewer when running within RStudio.Pass a function (e.g. utils::browseURL to override this behavior).

watch

Watch for changes and automatically reload browser.

navigate

Automatically navivate the preview browser to the most recently rendered document.

Examples

Run this code
# NOT RUN {
# Run a local server for the project in the current directory
quarto_serve()

# Run server for project in "myproj" directory and preview in external
# browser (rather than RStudio Viewer)
quarto_serve("myproj", open = utils::browseURL)

# Stop any running quarto server
quarto_serve_stop()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab