# Build documentation

From the project root or one of its subdirectories, run `docinsight build` to generate the configured output targets:

shell

    docinsight build

To validate the project without writing output first, see Check documentation.

## Simulate a build

Use `--dry-run` to validate the build plan without writing output files:

shell

    docinsight build --dry-run

## Open after building

Use `--open` to open the built output when the build finishes:

shell

    docinsight build --target site --open

`build --open` requires exactly one selected output target. Pass `--target` when the default selection contains more than one target. To open existing output without rebuilding it, see Open generated documentation.

## Incremental builds

DocInsight records generated paths and content hashes in private output state. On later builds, it reuses unchanged files, writes changed files, and removes stale files owned by the previous build. Files that DocInsight does not own are not treated as generated output.

By default, DocInsight trusts its output state when reusing a destination file. Use `--verify-output` to hash reusable destination files and rewrite any file whose contents differ from the planned output:

shell

    docinsight build --verify-output

CHM compilation still runs when a CHM target is built because `hhc.exe` produces the final file.

Use Clean generated output when you want to remove generated files instead of updating them incrementally.

## Related topics

- Select a project manifest

- Select output targets

- `build` command reference