PRDCT-347: per-page raw markdown + LLM actions dropdown#1009
Conversation
Emit every docs page as raw markdown at <slug>/index.md (new page-markdown integration, modeled on redirect-from.mjs: strips frontmatter, prepends "# <title>", skips 404, never clobbers). Extend the "Copy as Markdown" button into a split-button with a menu: View as Markdown, Open in ChatGPT, Open in Claude — links recomputed on every astro:page-load/after-swap navigation. Menu styles live in custom.css; selectors bumped to 0-3-0 to beat the structural `.page-title-row > :last-child button` rule. Menu items are <a> elements so that rule doesn't restyle them. Verified: build clean; 257 index.md emitted (404 skipped, homepage OK, nested slugs OK, no frontmatter leak); one group/menu per page; preview serves /storage/index.md as 200 text/markdown; audit-phase2 issues all pre-existing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review summaryVerdict: merge-ready with two optional nits. Solid, low-risk feature. The build-time integration mirrors Nits (optional):
Note for maintainer: deploy is Automated review pass (Claude Code), flagged for a human maintainer — not an approval. |
jordanrburger
left a comment
There was a problem hiding this comment.
Approved. Smoke-tested on the Vercel preview: dropdown opens/closes, View/Copy as Markdown work, Open-in-ChatGPT/Claude links resolve, and the actions survive client-side navigation. Two optional follow-ups noted in the review comment (document-listener leak on view transitions; confirm S3 serves .md as text/markdown so 'View as Markdown' renders rather than downloads) — neither blocks merge.
Closes PRDCT-347.
What this adds
1. Every docs page is now also published as raw markdown at
<page>/index.md(e.g.help.keboola.com/storage/index.md) — newsrc/integrations/page-markdown.mjs(modeled onredirect-from.mjs,astro:build:done): strips frontmatter, prepends# <title>, skips the 404 page, never clobbers existing files. 257 pages emitted.2. The "Copy as Markdown" button becomes a split-button with a chevron menu:
<page>/index.mdchatgpt.com/?hints=search&q=<"Read <md url> so I can ask questions about it">claude.ai/new?q=<same prompt>Links recompute on every
astro:page-load/astro:after-swap(view-transition-safe); listeners bind once behind the existingdataset.boundguard. Menu items are<a>elements so the structural.page-title-row > :last-child buttonrule doesn't restyle them; new styles are incustom.cssonly (selectors at 0-3-0 specificity to beat that structural rule — see inline comment).Verification (local production build)
[page-markdown] Emitted 257 raw-markdown pages (0 skipped).dist/storage/index.mdstarts with# Storage, no frontmatter leak; homepagedist/index.mdOK; nested slugs OK; nodist/404/index.md.initCopyBtnpath).astro preview:GET /storage/index.md→ 200text/markdown; page HTML still 200.node scripts/audit-phase2.mjs: 111 issues, all pre-existing (Jekyll link smells etc.), zero related to this change.Notes
npm run devtheindex.mdfiles don't exist (emitted at build time, like Pagefind) — View as Markdown 404s in dev only..md; if it serves as octet-stream we may want--content-type text/markdownfor*.mdin the deploy step (follow-up if needed).🤖 Generated with Claude Code