Skip to content

Commit 57aaee7

Browse files
committed
fix: display meta.name in route card header and sidebar (v0.6.1)
1 parent c6b6e1d commit 57aaee7

File tree

9 files changed

+34
-6
lines changed

9 files changed

+34
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ dist/
55
.idea
66
src/assets-inline.ts
77
/.prettierrc
8+
scripts/generate-preview.ts
9+
preview.html

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
66
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.6.1] - 2026-02-26
9+
10+
### Fixed
11+
12+
- **`meta.name` not rendered in UI** — The `name` field from route metadata was never displayed in
13+
the generated documentation. It now appears as a title in the route card header, with the path
14+
shown beneath it as a secondary label. The sidebar also uses the name when available, falling back
15+
to the path segment.
16+
17+
---
18+
819
## [0.6.0] - 2026-02-25
920

1021
### Breaking Changes

assets/screenshot-1.png

6.08 KB
Loading

assets/screenshot-2.png

19.4 KB
Loading

assets/screenshot-3.png

-1.66 KB
Loading

assets/screenshot-4.png

10.1 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trpc-docs-generator",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"author": "Lior Cohen",
55
"homepage": "https://github.com/liorcodev/trpc-docs-generator#readme",
66
"repository": {

src/generate-html.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function generateDocsHtml(routes: RouteInfo[], options: DocsGeneratorOpti
8383
.map(
8484
route => `
8585
<a href="#${route.path.replace(/\./g, '-')}" class="sidebar-link">
86-
${route.path.split('.').pop()}
86+
${route.meta?.name ?? route.path.split('.').pop()}
8787
</a>
8888
`
8989
)
@@ -186,7 +186,10 @@ function generateRouteCard(route: RouteInfo): string {
186186
<div class="route-card" id="${routeId}">
187187
<div class="route-header">
188188
<span class="method-badge method-${route.type}">${route.type}</span>
189-
<span class="route-path">${route.path}</span>
189+
<div class="route-path-info">
190+
${route.meta?.name ? `<span class="route-name">${route.meta.name}</span>` : ''}
191+
<span class="route-path">${route.path}</span>
192+
</div>
190193
<div class="route-tags">
191194
${docs?.auth ? '<span class="tag tag-auth"><span class="iconify" data-icon="mdi:shield-lock" style="vertical-align: -0.125em; margin-right: 0.25rem;"></span>Auth</span>' : ''}
192195
${docs?.deprecated ? '<span class="tag tag-deprecated"><span class="iconify" data-icon="mdi:alert" style="vertical-align: -0.125em; margin-right: 0.25rem;"></span>Deprecated</span>' : ''}

src/styles.css

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,24 @@ header p {
333333
color: white;
334334
}
335335

336+
.route-path-info {
337+
display: flex;
338+
flex-direction: column;
339+
gap: 0.1rem;
340+
flex: 1;
341+
}
342+
343+
.route-name {
344+
font-size: 0.875rem;
345+
font-weight: 600;
346+
color: var(--text-primary);
347+
}
348+
336349
.route-path {
337350
font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
338-
font-size: 0.875rem;
351+
font-size: 0.8rem;
339352
font-weight: 500;
340-
color: var(--text-primary);
341-
flex: 1;
353+
color: var(--text-secondary);
342354
letter-spacing: -0.01em;
343355
}
344356

0 commit comments

Comments
 (0)