Skip to content

Rework API reference Endpoint to use standard code blocks#3341

Draft
pwizla wants to merge 9 commits into
mainfrom
repo/api-reference-standard-code-blocks
Draft

Rework API reference Endpoint to use standard code blocks#3341
pwizla wants to merge 9 commits into
mainfrom
repo/api-reference-standard-code-blocks

Conversation

@pwizla

@pwizla pwizla commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

This PR reworks the API reference Endpoint component so request and response code is rendered by the site's standard Tabs and CodeBlock components instead of code passed as props. This restores syntax highlighting, the native copy/wrap/Ask AI buttons, and status tabs that are consistent with every other code block on the site.

Work in progress: only the first REST endpoint is migrated to the new authoring format so far. The remaining REST endpoints and other API reference pages still use the old props-based API and will be migrated in follow-up commits.

Direct preview link 👉 here

The Endpoint component now delegates request and response code to the site's standard Tabs and CodeBlock components instead of re-rendering code passed as props. This restores syntax highlighting, native copy/wrap/Ask AI buttons, and status tabs consistent with the rest of the site. Only the first REST endpoint is migrated so far.
@pwizla pwizla self-assigned this Jul 17, 2026
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview, Comment Jul 17, 2026 2:24pm

Request Review

@github-actions github-actions Bot added pr: new content PRs for new product features or new documentation sections source: CMS internal PRs created by the Strapi core team labels Jul 17, 2026
The full-width bottom border under each endpoint fell in an awkward spot below the parameter table. Drop it (and the now-unused isLast prop).
The endpoint header and columns had 44px horizontal padding that pushed content inward and a leftover border under the parameter column. Drop the padding so content spans the available width, add a column gap instead, reduce the header top padding, and remove the extra border.
Use a column-only gap so stacked params/code no longer get a large row gap, reduce the code column top padding, and remove the vertical and horizontal separators between the parameter and code columns.
Convert the get, create, update, and delete endpoints on the REST API reference page to the new authoring format (Tabs + fenced code + Responses), and widen the gap between the parameter and code columns.
Vertically center tab labels site-wide by removing the extra bottom padding and using flex centering. In terminal-style code blocks, drop the language (BASH) label and move the copy/wrap buttons up into the title bar next to Ask AI instead of floating over the code.
The copy/wrap button group in terminal code blocks was oversized and overflowed the title bar. Size it to match the Ask AI button and align it on the same row, inside the bar.
Align the copy/wrap button group to the title bar's right padding and reserve space so the Ask AI button sits just left of it, on the same row, without overflowing the bar.
Style the copy/wrap buttons in terminal code blocks as the same white pill with a neutral border used on regular code blocks, sized and positioned to align with the Ask AI button in both light and dark.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: new content PRs for new product features or new documentation sections source: CMS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant