Skip to main content

Crate docgen_config

Crate docgen_config 

Source
Expand description

Parses an optional docgen.toml. When absent, SiteConfig::default() reproduces docgen’s pre-P6 hard-coded behaviour exactly, so a project with no config builds identically to before.

Structs§

ComponentsConfig
[components] section.
Features
Feature toggles. All default true — the pre-P6 behaviour (every feature on).
SiteConfig
The whole resolved site config. Default == pre-P6 behaviour.

Enums§

ConfigError

Functions§

load
Load docgen.toml from project_root. Missing file → SiteConfig::default() (not an error). Present-but-malformed → Err.
normalize_base
Normalize a configured/derived base into a leading-slash, no-trailing-slash form: ""/"/" -> "", "docs"/"/docs/"/"docs/" -> "/docs", "/group/project/" -> "/group/project". Interior slashes are preserved so multi-segment sub-paths (GitLab’s namespace/project) round-trip correctly.
resolve_base
Resolve the effective deploy base path from config plus environment, applying this precedence (first match wins), then normalize_base: