Skip to content

Render markdown code fences as rich code blocks#2

Merged
chasehuh merged 1 commit into
mainfrom
codex/api-docs-code-blocks
Jun 25, 2026
Merged

Render markdown code fences as rich code blocks#2
chasehuh merged 1 commit into
mainfrom
codex/api-docs-code-blocks

Conversation

@chasehuh

Copy link
Copy Markdown
Member

Summary

  • wire Markdown-rendered fenced code blocks through the existing Sume Pre/CodeBlock component
  • make API examples render as framed, copyable, syntax-highlighted code cards with language icons/header controls instead of plain <pre> blocks
  • replace API key example literals on the touched API pages with <SUME_API_KEY> placeholders

Railway docs reference

Re-inspected railwayapp/docs and found the polished API example style is driven by their CodeBlock/Pre pipeline plus code-fence metadata support: a framed code panel, header icon, copy button, selectable text, and syntax highlighting. The new Sume docs repo already had a matching CodeBlock component, but MarkdownPage did not map fenced markdown pre elements to Pre, so regular .md fences could not use it.

Validation

  • pnpm install --frozen-lockfile
  • pnpm exec prettier --check src/components/markdown-page.tsx content/docs/public-api.md content/docs/api/reference.md content/docs/api/cookbook.md content/docs-ko/public-api.md content/docs-ko/api/reference.md content/docs-ko/api/cookbook.md
  • pnpm tsc
  • pnpm build
  • git diff --check
  • local smoke: /public-api, /api/reference, /api/cookbook, /ko/public-api, /ko/api/reference, /ko/api/cookbook all returned 200 on http://localhost:3001
  • local HTML smoke: /api/cookbook includes group/code-block and Click to copy code markup for rich code examples

Notes

  • No new dependency was added.
  • This updates the renderer for all markdown fences, using the existing site component and preserving selectable/copyable text.
  • Existing local Node engine warning and Tailwind @property warnings remain non-fatal.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 25, 2026 1:21am

Request Review

@chasehuh chasehuh merged commit e3d969b into main Jun 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant