Skip to content

Commit a976af9

Browse files
committed
updated documentation
1 parent 189728e commit a976af9

1 file changed

Lines changed: 30 additions & 25 deletions

File tree

‎docs/src/content/docs/advanced/markdown-headings.mdx‎

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ By default, RapiDoc displays your API's tags and endpoints in the sidebar naviga
1010
This feature is enabled with a single attribute: `info-description-headings-in-navbar="true"`.
1111

1212
<Aside type="tip" title="Interactive Showcase & Live Demo">
13-
Experience this feature in action on the [Markdown Headings Demo Page](/examples/markdown-headings) and inspect the underlying OpenAPI definition in [`docs/public/specs/markdown-headings.yaml`](/specs/markdown-headings.yaml).
13+
Experience this feature in action on the [Markdown Headings Demo Page](/examples/markdown-headings) and inspect the underlying OpenAPI
14+
definition in [`docs/public/specs/markdown-headings.yaml`](/specs/markdown-headings.yaml).
1415
</Aside>
1516

1617
---
1718

1819
## Quick Setup in 2 Steps
1920

2021
<Steps>
21-
1. **Enable the Attribute on `<rapi-doc>`**
22+
1. **Enable the Attribute on `<rapi-doc>`**:
2223

23-
Add `info-description-headings-in-navbar="true"` and ensure your render style is set to `read` (or `focused`):
24+
Add `info-description-headings-in-navbar="true"` and set `render-style="read"` (or `focused`):
2425

2526
```html
2627
<rapi-doc
@@ -31,7 +32,7 @@ This feature is enabled with a single attribute: `info-description-headings-in-n
3132
</rapi-doc>
3233
```
3334

34-
2. **Add `#` and `##` Headings in Your OpenAPI Spec**
35+
2. **Add `#` and `##` Headings in Your OpenAPI Spec**:
3536

3637
Write standard Markdown headings inside `info.description` or any tag's `description`:
3738

@@ -60,10 +61,12 @@ RapiDoc scans two distinct locations in your OpenAPI specification for Markdown
6061
6162
<CardGrid>
6263
<Card title="1. Info Description (`info.description`)" icon="document">
63-
Headings are inserted under the **Overview** menu item at the top of the sidebar. Ideal for architecture overviews, quickstarts, and global guidelines.
64+
Headings are inserted under the **Overview** menu item at the top of the sidebar. Ideal for architecture overviews, quickstarts, and
65+
global guidelines.
6466
</Card>
6567
<Card title="2. Tag Descriptions (`tags[].description`)" icon="list-format">
66-
Headings are inserted nested under the respective **Tag Group** in the sidebar. Ideal for object schemas, lifecycle rules, or tag-specific workflows.
68+
Headings are inserted nested under the respective **Tag Group** in the sidebar. Ideal for object schemas, lifecycle rules, or
69+
tag-specific workflows.
6770
</Card>
6871
</CardGrid>
6972

@@ -120,15 +123,16 @@ paths:
120123
121124
RapiDoc intentionally filters headings by depth to keep your navigation tree organized and uncluttered:
122125
123-
| Markdown Syntax | Level | Display in Navbar | Placement & Behavior |
124-
| :--- | :--- | :--- | :--- |
125-
| `# Title` | **H1** | ✅ **Included** | Top-level item under Overview or Tag. Uses `nav-bar-h1` style. |
126-
| `## Subtitle` | **H2** | ✅ **Included** | Indented sub-item under the parent topic. Uses `nav-bar-h2` style. |
127-
| `### Section` | **H3** | ❌ Excluded | Stays in the main reading canvas only. Keeps the sidebar concise. |
128-
| `#### Detail` | **H4+** | ❌ Excluded | Stays in the main reading canvas only. |
126+
| Markdown Syntax | Level | Display in Navbar | Placement & Behavior |
127+
| :-------------- | :------ | :---------------- | :----------------------------------------------------------------- |
128+
| `# Title` | **H1** | ✅ **Included** | Top-level item under Overview or Tag. Uses `nav-bar-h1` style. |
129+
| `## Subtitle` | **H2** | ✅ **Included** | Indented sub-item under the parent topic. Uses `nav-bar-h2` style. |
130+
| `### Section` | **H3** | ❌ Excluded | Stays in the main reading canvas only. Keeps the sidebar concise. |
131+
| `#### Detail` | **H4+** | ❌ Excluded | Stays in the main reading canvas only. |
129132

130133
<Aside type="note" title="Why are H3+ excluded?">
131-
Sidebar navigation is meant to be a high-level table of contents. Excluding H3 and deeper headings prevents the sidebar from becoming overwhelmed by granular sub-sections while allowing your main documentation body to use rich heading structures.
134+
Sidebar navigation is meant to be a high-level table of contents. Excluding H3 and deeper headings prevents the sidebar from becoming
135+
overwhelmed by granular sub-sections while allowing your main documentation body to use rich heading structures.
132136
</Aside>
133137

134138
---
@@ -158,14 +162,15 @@ You can use these anchor hashes in your own emails, internal documentation, or e
158162

159163
## Render Mode Compatibility
160164

161-
| Render Mode | Supported? | Description |
162-
| :--- | :---: | :--- |
163-
| **Read Mode** (`render-style="read"`) | ✅ **Recommended** | Displays the full sticky sidebar with all Overview headings and Tag headings alongside operations. |
164-
| **Focused Mode** (`render-style="focused"`) | ✅ Supported | Headings appear under Overview and under active tags when `on-nav-tag-click="show-description"`. |
165-
| **View Mode** (`render-style="view"`) | ❌ N/A | View mode uses horizontal tabs for endpoints rather than a persistent sidebar navigation bar. |
165+
| Render Mode | Supported? | Description |
166+
| :------------------------------------------ | :----------------: | :------------------------------------------------------------------------------------------------- |
167+
| **Read Mode** (`render-style="read"`) | ✅ **Recommended** | Displays the full sticky sidebar with all Overview headings and Tag headings alongside operations. |
168+
| **Focused Mode** (`render-style="focused"`) | ✅ Supported | Headings appear under Overview and under active tags when `on-nav-tag-click="show-description"`. |
169+
| **View Mode** (`render-style="view"`) | ❌ N/A | View mode uses horizontal tabs for endpoints rather than a persistent sidebar navigation bar. |
166170

167171
<Aside type="caution" title="Ensure Info Section is Visible">
168-
Sidebar headings for the overview section require the info card to be enabled. If you set `show-info="false"`, the overview headings will not be rendered in the sidebar.
172+
Sidebar headings for the overview section require the info card to be enabled. If you set `show-info="false"`, the overview headings will
173+
not be rendered in the sidebar.
169174
</Aside>
170175

171176
---
@@ -176,12 +181,12 @@ Because RapiDoc uses Shadow DOM encapsulation, custom CSS targeting internal ele
176181

177182
RapiDoc exposes specific shadow parts for navbar heading items:
178183

179-
| Part Selector | Description |
180-
| :--- | :--- |
181-
| `rapi-doc::part(section-navbar-item)` | Targets all navbar navigation items (Overview, tags, headings, endpoints). |
182-
| `rapi-doc::part(section-navbar-overview)` | Targets the main Overview header item. |
183-
| `rapi-doc::part(section-navbar-h1)` | Targets all level-1 (`#`) heading items in the sidebar. |
184-
| `rapi-doc::part(section-navbar-h2)` | Targets all level-2 (`##`) heading items in the sidebar. |
184+
| Part Selector | Description |
185+
| :---------------------------------------- | :------------------------------------------------------------------------- |
186+
| `rapi-doc::part(section-navbar-item)` | Targets all navbar navigation items (Overview, tags, headings, endpoints). |
187+
| `rapi-doc::part(section-navbar-overview)` | Targets the main Overview header item. |
188+
| `rapi-doc::part(section-navbar-h1)` | Targets all level-1 (`#`) heading items in the sidebar. |
189+
| `rapi-doc::part(section-navbar-h2)` | Targets all level-2 (`##`) heading items in the sidebar. |
185190

186191
### Example: Customizing Heading Typography & Indentation
187192

0 commit comments

Comments
 (0)