sdocs 0.0.48 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.0.49] - 2026-07-05
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **The `:` group marker no longer leaks into page headings.** A title like
|
|
15
|
+
`:Group / Name` groups an entry in the sidebar, but the leading colon was
|
|
16
|
+
rendered verbatim in the component/page `<h1>`. Headings now strip it, so the
|
|
17
|
+
title reads `Group / Name`.
|
|
18
|
+
|
|
10
19
|
## [0.0.48] - 2026-07-05
|
|
11
20
|
|
|
12
21
|
### Changed
|
|
@@ -20,6 +20,12 @@ interface SidebarConfig {
|
|
|
20
20
|
}
|
|
21
21
|
/** Build a tree from flat doc entries */
|
|
22
22
|
export declare function buildTree(docs: DocEntry[], sidebar?: SidebarConfig): TreeNode[];
|
|
23
|
+
/**
|
|
24
|
+
* The title shown to users. A leading ':' on the first segment is a sidebar
|
|
25
|
+
* grouping directive (see buildTree), not part of the displayed title, so it
|
|
26
|
+
* is stripped for headings.
|
|
27
|
+
*/
|
|
28
|
+
export declare function displayTitle(title: string | null | undefined): string;
|
|
23
29
|
/** Check if a path matches a tree node (for active state) */
|
|
24
30
|
export declare function pathMatchesNode(currentPath: string[], node: TreeNode): boolean;
|
|
25
31
|
/** Find the doc entry for a given path */
|
|
@@ -172,6 +172,14 @@ function sortByOrder(nodes, order) {
|
|
|
172
172
|
nodes.push(node);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* The title shown to users. A leading ':' on the first segment is a sidebar
|
|
177
|
+
* grouping directive (see buildTree), not part of the displayed title, so it
|
|
178
|
+
* is stripped for headings.
|
|
179
|
+
*/
|
|
180
|
+
export function displayTitle(title) {
|
|
181
|
+
return (title ?? '').replace(/^:\s*/, '');
|
|
182
|
+
}
|
|
175
183
|
/** Check if a path matches a tree node (for active state) */
|
|
176
184
|
export function pathMatchesNode(currentPath, node) {
|
|
177
185
|
if (node.path.length !== currentPath.length)
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import ApiTable from './ApiTable.svelte';
|
|
8
8
|
import PropControl from './PropControl.svelte';
|
|
9
9
|
import CssPropControl from './CssPropControl.svelte';
|
|
10
|
+
import { displayTitle } from '../tree-builder.js';
|
|
10
11
|
|
|
11
12
|
interface Props {
|
|
12
13
|
doc: DocEntry;
|
|
@@ -291,7 +292,7 @@
|
|
|
291
292
|
{#if focusedSnippet}
|
|
292
293
|
<!-- Example full-page view -->
|
|
293
294
|
<div class="sdocs-view-header">
|
|
294
|
-
<h1 class="sdocs-view-title">{meta.title} / {snippetName}</h1>
|
|
295
|
+
<h1 class="sdocs-view-title">{displayTitle(meta.title)} / {snippetName}</h1>
|
|
295
296
|
</div>
|
|
296
297
|
<div class="sdocs-panels">
|
|
297
298
|
<CollapsiblePanel title="Preview">
|
|
@@ -304,7 +305,7 @@
|
|
|
304
305
|
{:else}
|
|
305
306
|
<!-- Full component view -->
|
|
306
307
|
<div class="sdocs-view-header">
|
|
307
|
-
<h1 class="sdocs-view-title">{meta.title}</h1>
|
|
308
|
+
<h1 class="sdocs-view-title">{displayTitle(meta.title)}</h1>
|
|
308
309
|
{#if meta.description}
|
|
309
310
|
<p class="sdocs-view-description">{meta.description}</p>
|
|
310
311
|
{/if}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { DocEntry } from '../../types.js';
|
|
3
3
|
import PreviewFrame from './PreviewFrame.svelte';
|
|
4
|
+
import { displayTitle } from '../tree-builder.js';
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
6
7
|
doc: DocEntry;
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
<div class="sdocs-page-main">
|
|
26
27
|
<!-- Header -->
|
|
27
28
|
<div class="sdocs-view-header">
|
|
28
|
-
<h1 class="sdocs-view-title">{meta.title}</h1>
|
|
29
|
+
<h1 class="sdocs-view-title">{displayTitle(meta.title)}</h1>
|
|
29
30
|
{#if meta.description}
|
|
30
31
|
<p class="sdocs-view-description">{meta.description}</p>
|
|
31
32
|
{/if}
|