Skip to main content

Module site_page

Module site_page 

Source
Expand description

Shared test helper: turn a generated mdBook-format reference page into the Starlight page committed under site/src/content/docs/. This is the same transform site/scripts/migrate-page.mjs applied during the Book migration — lift the leading # H1 into title: frontmatter (dropping the heading), and rewrite relative .md links to site routes — so the generated-page drift guards keep their committed site pages byte-identical to the migrated originals once docs/ is gone.

Functions§

to_site_page
Transform markdown (a generated reference page, mdBook form) into its committed Starlight form. page_dir is the page’s directory, as the Book’s mdBook sources lay it out (e.g. "reference"), used to resolve relative links. A link that resolves into reference/ is a Reference route (web presence slice 5); any other, a Book route.