Link rule
One line of a Kind's link rules, telling the generic handler which field of the state produces which kind of link.
Fetching schema…

Part of Stem. This page defines the link rule struct used in Kind.

A link rule says: references found at this path in the state become links of this kind.

Fields

field

type

required

meaning

path

string

yes

A JSON Pointer into the state value.

kind

link kind

no

The link kind to emit. Omitted when the path names a block tree: the handler then emits embed, link, mention and file links from each block's and annotation's type.

Rules

The pointer may land on a node reference, a string holding an hm:// or ipfs:// URL, a list of either, or a block tree; the handler scans the value found there for references of all three shapes. For changes kinds the state is the document, so /content reaches every block and /metadata/icon reaches one attribute. Rules never produce dep, parent or proof links; those come from fixed fields. A rule whose path does not exist in a given state produces nothing.

Today (HM24)

The scanning of blocks and annotations for hm:// and ipfs:// URLs is hard-coded per blob type in the indexer. Rules make it declarative.

Example

{"path": "/body"}

See also

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime