Interface CorpusScope

What a corpus viewer declares about the corpus it is rendering.

interface CorpusScope {
    entry: null | string;
    root: null | string;
    toHref: (corpusPath: string) => string;
}

Properties

Properties

entry: null | string

Corpus-absolute path of the entry currently being read (/roadmap/R3-174.mdx), or null when nothing is. This is the entry, NOT the file being rendered: a component in a _layout.mdx wrapping that entry sees the entry, which is what makes furniture in the layout chain (a status line, a dependency rail) able to describe the page.

root: null | string

Absolute filesystem path of the corpus root, WITHOUT a trailing slash (/app/content in a fork, /mnt/<hash> under dispatch), or null when the surrounding app is not rendering a corpus — the default, which leaves every hook here returning the empty result rather than guessing a root.

toHref: (corpusPath: string) => string

Corpus-absolute path → the href to navigate to it. Supplied by the viewer; the identity function by default, which is correct for a viewer whose URL space IS the corpus space.