quarto-source-map
Unified source-location tracking with byte-range provenance, for parsers and diagnostics.
quarto-source-map records where a piece of text came from and follows it
through transformation chains (extraction, concatenation, normalization), so a
position in derived text can be mapped back to a line/column in the original
source file. It is the source-location substrate underneath Quarto's diagnostics,
but it has no Quarto-specific dependencies and is usable on its own.
Core types
SourceInfo— a location plus its transformation history.SourceContext— registers files and provides the content needed to map offsets torow/column.MappedLocation— the result of mapping an offset back through the chain.
Example
use *;
// Create a context and register a file.
let mut ctx = new;
let file_id = ctx.add_file;
// A source location stores only offsets…
let info = original;
// …and maps to row/column on demand.
let mapped = info.map_offset.unwrap;
assert_eq!;
assert_eq!;
Releasing
Releases are made by merging a version-bump PR: bump version in
Cargo.toml, open a PR, merge. CI (.github/workflows/release.yml) then
tests at the release commit, publishes to crates.io via Trusted
Publishing, tags vX.Y.Z, and
creates a GitHub Release. Pushes that don't change the version never
publish. A failed release run is safe to re-run (already-published steps
skip). To exercise the pipeline without releasing: Actions → Release → Run
workflow with dry_run.
License
MIT © Posit Software, PBC