const categoryDisplayNames = {
'sdk' : 'SDK',
'endpoints' : 'API ENDPOINTS',
'infrastructure': 'INFRASTRUCTURE',
'architecture' : 'ARCHITECTURE',
};| Category | Slug Prefix | Example |
|---|---|---|
sdk |
sdk- |
sdk-assistants |
endpoints |
api- |
api-assistants |
infrastructure |
infra- |
infra-quick-start |
architecture |
archi- |
archi-assistant-cache |
---
title: Assistants
category: sdk
slug: sdk-assistants
------
title: Assistants API
category: endpoints
layout: api
slug: api-assistants
------
title: Quick Start
category: infrastructure
slug: infra-quick-start
------
title: Assistant Cache
category: architecture
slug: archi-assistant-cache
---- The slug prefix is the collision guard in the flat
pagesmap indocs.js. - Every
.mdfile promoted into the app must have at minimumtitle,category, andslug. - Files not ready for promotion should carry
nav_exclude: trueto keep them out of the sidebar without deleting them. - The
layout: apikey in endpoints front-matter triggersApiReferencePageinstead ofMarkdownPageinDocPage.jsx.
All markdown pages draw from a single stylesheet: src/components/MarkdownPage/markdown.css.
Styling is layered via a two-class system applied to the wrapper div in MarkdownPage.jsx.
<div className={`markdown-body ${category ? `markdown-${category}` : ''}`}>The category value is read from each page's front-matter and passed down through:
docs.js (front-matter parser)
→ DocPage.jsx (passes category prop)
→ MarkdownPage.jsx (applies modifier class)
→ markdown.css (base + category rules)
Every page receives the base class unconditionally. The category modifier stacks on top.
| Front-matter category | Classes applied |
|---|---|
sdk |
markdown-body markdown-sdk |
endpoints |
markdown-body markdown-endpoints |
infrastructure |
markdown-body markdown-infrastructure |
architecture |
markdown-body markdown-architecture |
| (none set) | markdown-body |
/* Base — all pages */
.markdown-body { max-width: 960px; ... }
/* Architecture — wide diagrams */
.markdown-architecture { max-width: 1200px; }
/* SDK — dense code, tight column */
.markdown-sdk { max-width: 860px; }
/* Endpoints — parameter tables */
.markdown-endpoints { max-width: 1080px; }
/* Infrastructure — long guides */
.markdown-infrastructure h2 { border-bottom: 1px solid #e5e7eb; }Category rules only override what they explicitly declare.
Everything else falls through to the base .markdown-body styles unchanged.
- Add the category key to
categoryDisplayNamesindocs.jsandDocsSidebar.jsx - Add front-matter
category: your-categoryto the relevant.mdfiles - Optionally add a
.markdown-your-category { }block tomarkdown.css
No other files need to change.
| File | Role |
|---|---|
src/components/MarkdownPage/markdown.css |
Single source of all markdown styles |
src/components/MarkdownPage/MarkdownPage.jsx |
Applies the two-class pattern |
src/pages/common/DocPage.jsx |
Reads front-matter, passes category prop |
src/lib/docs.js |
Parses front-matter, exposes pages map |