Commit Graph

2 Commits

Author SHA1 Message Date
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
Steve Klabnik
3b40151218 docs: Add doc rendering via starlight
This change adds a new docs deployment to /starlight/, and that's rendering the
documentation via Starlight: https://starlight.astro.build/

mkdocs is no longer being maintained, and we'd like to move away from it for
that reason. We've chosen starlight for two main reasons: first, it has a goal
of minimizing JavaScript on the front end, and that aligns with our priorities.
Second, it is based on Astro.js, which would also be a good tool for writing a
basic marketing site. The overall sentiment from community in the Discord was
leaning towards Astro when we were talking about this.

After a few days of checking out the new docs and making sure that things are
good, we can move to making this the default.

Part of #7959.
2026-01-14 06:24:04 +00:00