Skip to main content

Anchor

Definition

An Anchor is an explicit entity the user creates with #name. Unlike contextual metadata, it has its own identity and appears as an independent node in the tree, without being attached to a language symbol.

Example

// @ghost #authentication description: jwt validation | status: todo

This produces an authentication node in the tree, which can itself contain other symbols or anchors if used as a range.

The three Anchor types

An Anchor takes three forms, depending on how it is written:

TypeHas name (#)Creates own nodePage
Semantic AnchorYesYesSemantic Anchor
Contextual AnchorNoNo (attaches to the closest symbol)Contextual Anchor
Range AnchorYes, with start/endYes, and groups other nodesRange Anchor

Next step

Continue with Semantic Anchor.