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§
- File
Diagnostics - Diagnostics emitted while indexing one project file, paired with the source so the consumer can render them at correct positions.
- Project
Index - Snapshot of the project’s
@reftargets. 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 containsbrief.toml. ReturnsNoneif no such ancestor exists.