Skip to main content

Module render

Module render 

Source
Expand description

PI.6 / AD.1: rendering the plugin-API catalog for humans.

Moved out of the host at PI.6. It renders the CATALOG, which is this crate’s, and the move is what lets the site’s reference page be generated by a test here rather than only by :export-plugin-api in a running editor.

AD.1 extends every seam from a list of function names to its full surface: signatures, resources and their methods, and every type with its fields or cases. The same seam renderer backs the single-document form (markdown) and, from AD.2, one page per seam — so the two cannot disagree about what a seam contains.

Constants§

GENERATED_HEADER
The first line of every generated file. Says what generated it and how to regenerate it, so nobody hand-edits a file the next test run reverts.

Functions§

capability_prose
A seam’s Capability as a phrase for prose: filesystem, network, …
capability_short
A seam’s Capability as one token for a table cell: fs, net, proc, or - for none.
direction_prose
A seam’s Direction as a phrase for prose: “guest implements this interface”. Used by the reference pages and :describe-plugin-api.
direction_short
A seam’s Direction as one word for a table cell: exports, imports, both, types.
markdown
PI.6: the whole plugin API as markdown, rendered from the canonical wit/ package.
pages
AD.2: the reference as a set of files, relative to docs/dev/reference/: the index plugin-api.md, one plugin-api/<seam>.md per interface, and the machine-readable plugin-api.json.
seam
One seam’s full reference, its title at heading level level (1 for a page of its own, 2 inside the single document).
summary
The first sentence of a doc’s first paragraph, on one line.
type_anchor
The anchor a type’s heading gets: record raw-candidate → record-raw-candidate. Zola and GitHub slug the heading record `raw-candidate` to the same string, which is what lets one generated link work in both.
wit_definition
The type written back as a WIT declaration, members without docs — the shape at a glance, with the prose below it.