Skip to main content

Module content_path

Module content_path 

Source
Expand description

The content path: the chain of block names from the document root down to the level being drawn, as a plain string — top/Thing 1/Core.

It reads along the status strip as a breadcrumb, is printed across the bottom of every PDF sheet, and is parsed back — by the navigator’s tree, which carries the same names — for the command palette’s go <path>, so a path can be copied out of one window and pasted into another to navigate there.

Constants§

SEPARATOR
What separates two names in a path string.
SEPARATOR_STR
The same separator, for a caller measuring what it costs in a line.

Functions§

join
The one spelling of a path: its names, separated.
name_of
A block’s name for path purposes: its title, or its id when untitled. The navigator’s richer name/type label would only make a path harder to read and to retype.
segments
The path’s names, outermost first. Every segment is a block the path descended into — the document root is the unnamed scope they hang from, so it contributes nothing and the empty path (the root itself) has no segments at all.
to_string
The path as a string, outermost first: top/Thing 1/Core.

Type Aliases§

Doc 🔒
The document read a path walks: the whole document with its index, since resolving a name needs each scope’s children.