Skip to content

Dialect: Anchors, Wikilinks, and Vault References

Each example builds on the one before it — read the ladder in order, or jump to the rung you need. Every shipped artifact is regression-checked against the real CLI and library output.

  1. DIALECT-01: Anchor a block, resolve it with byAnchor — A caret block-id (^id) terminating a block binds it for doc.byAnchor lookup.
  2. DIALECT-02: Anchor a section, read it from .anchors — A standalone ^id under a heading binds at section level and surfaces via SectionView.anchors (not byAnchor).
  3. DIALECT-03: Extract a bare wikilink — extractVaultRefs recognizes a bare [[page]] and returns its target.
  4. DIALECT-04: Read a wikilink alias — A [[page|alias]] splits into target plus the display alias.
  5. DIALECT-05: Read heading and anchor fragments — A #heading or #^anchor fragment is parsed out as VaultRef.fragment.
  6. DIALECT-06: Recognize a transclusion — ![[page]] is recognized as a transclusion via VaultRef.kind.
  7. DIALECT-07: Harvest every reference in a document — extractVaultRefs over a document’s text returns every wikilink and transclusion in order.
  8. DIALECT-08: Build a vault reference inventory — Running extractVaultRefs across a directory yields a from→to link edge list for the whole vault.
  9. DIALECT-09: Require an anchor with a contract — A declared section anchor emits structure/anchor-missing when no matching ^id resolves.
  10. DIALECT-10: Flag a dead anchor with a docRule — A docRule pairs extractVaultRefs with byAnchor to flag a #^anchor fragment that resolves nowhere in the same doc.
  11. DIALECT-11: Validate every wikilink across a vault — A cross-document docRule checks each wikilink target against the vault’s page set under runCorpus.