---
title: "preview_site"
---

[< Back to Reference](../reference.qmd) | [View source](https://usrbinr.codeberg.page/qrtdown//src/branch/main/R/build.R#L247)

# `preview_site()`

Preview the documentation site

## Usage

```r
preview_site(pkg = ".", browse = TRUE)
```

## Arguments

| Argument | Description |
|----------|-------------|
| `pkg` | Path to the package root directory |
| `browse` | Open the preview in a browser (default TRUE) |

## Value

Invisibly returns the path to the index file

## Description

Opens the built documentation site in a web browser using quarto preview.
If the site hasn't been built, builds it first.

## Details

This function uses the `quarto` R package for proper process management.
The preview server runs in the background and can be stopped with
`quarto::quarto_preview_stop()`.

The preview runs from the package root directory and uses _quarto.yml
for configuration. Changes to source files will trigger automatic rebuilds.

