Files
Steve Klabnik e1365d7ff1 web/docs: add remark plugin for GitHub-compatible markdown links
This adds a remark plugin that transforms .md links (e.g., [text](other.md))
into clean URLs (e.g., other/) that work in the built Starlight site while
keeping the original .md links functional on GitHub.

Key design decisions:

1. Uses relative paths instead of absolute paths. This ensures links work
   regardless of the base path configuration (e.g., --base /starlight/).
   Absolute paths like /glossary/ would break when deployed at a non-root
   base path.

2. Accounts for Starlight's trailing slash URL behavior. Pages like
   guides/divergence.md are served at /guides/divergence/, which browsers
   treat as a directory. For non-index files, the plugin prepends ../ to
   counteract this, so a link to ../glossary.md becomes ../../glossary/
   (which correctly resolves to /glossary/ from /guides/divergence/).

3. Wrapped in a Starlight plugin (starlight-strip-md-extension.mjs).
   This is required because Starlight overrides the markdown.remarkPlugins
   config for content collection .md files. Plugins in the top-level
   markdown config only run on .mdx files. The Starlight plugin wrapper
   hooks into Starlight's integration system to ensure the transformation
   runs on all content collection markdown files.
2026-03-03 19:07:18 +00:00
..