Skip to main content

Module project

Module project 

Source
Expand description

Project-wide compile state: root discovery and the cross-document reference index.

@ref validation is the first multi-pass element of the Brief compiler. discover_root walks up the directory tree from a starting point looking for brief.toml; build_index (Task 3) walks the discovered project tree and collects the heading anchors that @ref is allowed to point at.

Structs§

FileDiagnostics
Diagnostics emitted while indexing one project file, paired with the source so the consumer can render them at correct positions.
ProjectIndex
Snapshot of the project’s @ref targets. Built once per compilation (or watch tick). Read-only after construction.

Functions§

build_index
Walk the project tree and collect heading anchors per file.
discover_root
Walk up from start, returning the first ancestor directory that contains brief.toml. Returns None if no such ancestor exists.