Documentation site¶
DataPress can serve this site directly from the running binary. It
requires the docs build feature (not part of default builds). Once
compiled in, the runtime [docs].enabled switch defaults to true, so the
site is served unless you explicitly set enabled = false.
Build with the docs feature¶
task docs:build # build the MkDocs site
cargo build --release -p datapress-duckdb --features docs
# or:
cargo build --release -p datapress-datafusion --features docs
The feature pulls in include_dir
and mime_guess, and embeds the
built docs/site/ directory into the binary.
Why a feature flag?
Embedded HTML/CSS/JS adds a few hundred KB to the binary. Users who don't want it pay nothing.
Enable at runtime¶
Add a [docs] section to datasets.toml:
[docs]
enabled = true # default: true (once built with --features docs)
path = "/mkdocs" # default: /mkdocs
| Field | Default | Notes |
|---|---|---|
enabled |
true |
Master switch. Defaults to true when the docs feature is compiled in; omitting the section keeps it enabled. Set false to suppress the UI. |
path |
/mkdocs |
Mount point. Must start with /, not end with /. Reserved paths are rejected (/api, /api/v1, /health*, /readyz, /version, /docs is reserved for the Swagger UI). |
When the feature is off but enabled = true, the server logs a
warning at startup and continues — it does not refuse to start:
When both the feature and the switch are on, the startup log records the mount:
Local development¶
While editing Markdown sources under docs/src/, use MkDocs' built-in
hot-reload server:
Once you're happy, rebuild and re-cargo build --features docs to pick
up the changes in the binary.