You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: replace prepare-docs.sh with rehype plugin and frontmatter (#435)
* docs: replace prepare-docs.sh with rehype plugin and frontmatter
Eliminate the .docs-temp preprocessing pipeline by:
- Adding a rehype plugin (rehype-rewrite-links.mjs) that rewrites .md
links at build time, replacing the fragile sed-based approach
- Adding minimal frontmatter (title + description) to all 31 doc files
and removing H1 headings (Starlight renders title as H1)
- Pointing the content loader directly at ../docs/ with glob exclusions
- Adding a global Banner component override for the feedback banner
- Removing prepare-docs.sh and all references to .docs-temp
Closes#423
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: preserve frontmatter in generate-cli-docs.sh
The CLI docs generation script overwrites cli.md from scratch. Update it
to prepend the required YAML frontmatter (title + description) before
the auto-generated content.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: strip H1 from generated CLI docs to match frontmatter title
The --markdown-help output includes a `# Command-Line Help` H1 heading.
Since we now use frontmatter title (which Starlight renders as H1),
strip the generated H1 to avoid duplication and match the committed file.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/docs-guidelines.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ Documentation follows the Diátaxis framework:
42
42
Source documentation in `docs/` must work in two contexts:
43
43
44
44
1.**GitHub**: Renders Markdown directly with `.md` extensions
45
-
2.**Starlight docs site**: `scripts/prepare-docs.sh` transforms links to clean URLs
45
+
2.**Starlight docs site**: A rehype plugin (`docs-site/plugins/rehype-rewrite-links.mjs`) transforms links to clean URLs at build time
46
46
47
47
**Link format rules:**
48
48
@@ -62,4 +62,4 @@ Source documentation in `docs/` must work in two contexts:
62
62
[root-level link](../tutorial.md)
63
63
```
64
64
65
-
The `prepare-docs.sh` script handles the transformation to Starlight's URL structure. If you add new link patterns, verify they work by building the docs site locally with `cd docs-site && npm run build`.
65
+
The rehype plugin handles the transformation to Starlight's URL structure at build time. If you add new link patterns, verify they work by building the docs site locally with `cd docs-site && npm run build`.
Copy file name to clipboardExpand all lines: docs-site/README.md
+32-42Lines changed: 32 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,54 +4,42 @@ This directory contains the Starlight-based documentation website for ICP CLI.
4
4
5
5
## Overview
6
6
7
-
The documentation site is built with [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/), reading markdown files from the `../docs/` directory.
7
+
The documentation site is built with [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/), reading markdown files directly from the `../docs/` directory.
0 commit comments