You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a976af9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/src/content/docs/advanced/markdown-headings.mdx
+30-25Lines changed: 30 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,18 @@ By default, RapiDoc displays your API's tags and endpoints in the sidebar naviga
10
10
This feature is enabled with a single attribute: `info-description-headings-in-navbar="true"`.
11
11
12
12
<Asidetype="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).
14
15
</Aside>
15
16
16
17
---
17
18
18
19
## Quick Setup in 2 Steps
19
20
20
21
<Steps>
21
-
1.**Enable the Attribute on `<rapi-doc>`**
22
+
1.**Enable the Attribute on `<rapi-doc>`**:
22
23
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`):
24
25
25
26
```html
26
27
<rapi-doc
@@ -31,7 +32,7 @@ This feature is enabled with a single attribute: `info-description-headings-in-n
31
32
</rapi-doc>
32
33
```
33
34
34
-
2.**Add `#` and `##` Headings in Your OpenAPI Spec**
35
+
2.**Add `#` and `##` Headings in Your OpenAPI Spec**:
35
36
36
37
Write standard Markdown headings inside `info.description` or any tag's `description`:
37
38
@@ -60,10 +61,12 @@ RapiDoc scans two distinct locations in your OpenAPI specification for Markdown
60
61
61
62
<CardGrid>
62
63
<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.
64
66
</Card>
65
67
<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.
67
70
</Card>
68
71
</CardGrid>
69
72
@@ -120,15 +123,16 @@ paths:
120
123
121
124
RapiDoc intentionally filters headings by depth to keep your navigation tree organized and uncluttered:
| `# 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. |
129
132
130
133
<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.
132
136
</Aside>
133
137
134
138
---
@@ -158,14 +162,15 @@ You can use these anchor hashes in your own emails, internal documentation, or e
158
162
159
163
## Render Mode Compatibility
160
164
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. |
| **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. |
166
170
167
171
<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.
169
174
</Aside>
170
175
171
176
---
@@ -176,12 +181,12 @@ Because RapiDoc uses Shadow DOM encapsulation, custom CSS targeting internal ele
176
181
177
182
RapiDoc exposes specific shadow parts for navbar heading items:
0 commit comments