pub struct WikiConfig {
pub index: Option<String>,
pub directories: Vec<DirectoryConfig>,
pub linking: LinkingConfig,
pub checks: ChecksConfig,
pub rules: Vec<RuleConfig>,
}Expand description
Complete wiki configuration, parsed from wiki.toml or auto-detected.
Fields§
§index: Option<String>Path to the index file relative to wiki root. None means no index file.
directories: Vec<DirectoryConfig>Content directories, sorted most-specific-first for resolution.
linking: LinkingConfigLinking behavior settings.
checks: ChecksConfigWiki-wide structural check severities.
rules: Vec<RuleConfig>Parameterized rules scoped to directories.
Implementations§
Source§impl WikiConfig
impl WikiConfig
Sourcepub fn load(root: &Path) -> Result<Option<Self>, ConfigError>
pub fn load(root: &Path) -> Result<Option<Self>, ConfigError>
Load config from wiki.toml in the given root directory.
Returns None if wiki.toml doesn’t exist.
Sourcepub fn auto_detect(root: &Path) -> Self
pub fn auto_detect(root: &Path) -> Self
Auto-detect config when no wiki.toml exists.
Sourcepub fn load_or_detect(root: &Path) -> Result<Self, ConfigError>
pub fn load_or_detect(root: &Path) -> Result<Self, ConfigError>
Load config from wiki.toml if present, otherwise auto-detect.
Sourcepub fn directory_for(&self, rel_path: &Path) -> Option<&DirectoryConfig>
pub fn directory_for(&self, rel_path: &Path) -> Option<&DirectoryConfig>
Get the directory config that applies to a given relative path. Returns the most-specific matching directory (longest prefix match).
Sourcepub fn is_autolink_dir(&self, rel_path: &Path) -> bool
pub fn is_autolink_dir(&self, rel_path: &Path) -> bool
Check if a page at the given relative path should be auto-linked.
Sourcepub fn matches_dirs(rel_path: &Path, dirs: &[String]) -> bool
pub fn matches_dirs(rel_path: &Path, dirs: &[String]) -> bool
Check if a relative path matches a directory prefix from a rule’s dirs list.
Sourcepub fn mirror_paths(&self) -> Vec<(&str, &str)>
pub fn mirror_paths(&self) -> Vec<(&str, &str)>
All mirror-parity rules’ right paths (non-wiki directories used for parity checks).
Trait Implementations§
Source§impl Clone for WikiConfig
impl Clone for WikiConfig
Source§fn clone(&self) -> WikiConfig
fn clone(&self) -> WikiConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more