sdocs 0.0.58 → 0.0.59
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,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.0.59] - 2026-07-05
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **Code blocks render on a dark stage.** Highlighted code — page fences and
|
|
15
|
+
the code panels — always uses the dark syntax theme, so blocks read as
|
|
16
|
+
code at a glance in both app themes (they previously rendered white-on-white
|
|
17
|
+
in light mode).
|
|
18
|
+
- **A page's body `#` title matches the entity title size** (24px/700) — it
|
|
19
|
+
is the page title, after all.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **Every fence gets a themed block.** `bash`, `json`, `markdown`, `yaml`,
|
|
24
|
+
and `diff` fences highlight properly, and unknown languages fall back to a
|
|
25
|
+
plaintext shiki block instead of an unstyled bare `<pre>`.
|
|
26
|
+
|
|
10
27
|
## [0.0.58] - 2026-07-05
|
|
11
28
|
|
|
12
29
|
### Added
|
|
@@ -162,7 +162,11 @@
|
|
|
162
162
|
margin: 1.6em 0 0.5em;
|
|
163
163
|
scroll-margin-top: 16px;
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
/* The body h1 serves as the page title — match .sdocs-view-title */
|
|
166
|
+
.sdocs-page-content :global(h1) {
|
|
167
|
+
font-size: 24px;
|
|
168
|
+
font-weight: 700;
|
|
169
|
+
}
|
|
166
170
|
.sdocs-page-content :global(h2) { font-size: 18px; }
|
|
167
171
|
.sdocs-page-content :global(h3) { font-size: 15px; }
|
|
168
172
|
.sdocs-page-content :global(h4),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** Highlight source code and return HTML
|
|
1
|
+
/** Highlight source code and return HTML. Unknown languages render as
|
|
2
|
+
* plaintext, so a fence is always a themed shiki block, never a bare pre. */
|
|
2
3
|
export declare function highlight(code: string, lang?: string): Promise<string>;
|
|
3
4
|
/** Dispose the highlighter (for cleanup) */
|
|
4
5
|
export declare function disposeHighlighter(): Promise<void>;
|
|
@@ -5,16 +5,21 @@ async function getHighlighter() {
|
|
|
5
5
|
if (!highlighterPromise) {
|
|
6
6
|
highlighterPromise = createHighlighter({
|
|
7
7
|
themes: ['github-light', 'github-dark'],
|
|
8
|
-
langs: [
|
|
8
|
+
langs: [
|
|
9
|
+
'svelte', 'typescript', 'javascript', 'css', 'html',
|
|
10
|
+
'bash', 'json', 'markdown', 'yaml', 'diff',
|
|
11
|
+
],
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
return highlighterPromise;
|
|
12
15
|
}
|
|
13
|
-
/** Highlight source code and return HTML
|
|
16
|
+
/** Highlight source code and return HTML. Unknown languages render as
|
|
17
|
+
* plaintext, so a fence is always a themed shiki block, never a bare pre. */
|
|
14
18
|
export async function highlight(code, lang = 'svelte') {
|
|
15
19
|
const highlighter = await getHighlighter();
|
|
20
|
+
const resolved = highlighter.getLoadedLanguages().includes(lang) ? lang : 'text';
|
|
16
21
|
return highlighter.codeToHtml(code, {
|
|
17
|
-
lang,
|
|
22
|
+
lang: resolved,
|
|
18
23
|
themes: {
|
|
19
24
|
light: 'github-light',
|
|
20
25
|
dark: 'github-dark',
|
package/dist/ui/styles/sdocs.css
CHANGED
|
@@ -28,6 +28,15 @@
|
|
|
28
28
|
text-decoration: none;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/* Highlighted code blocks always render shiki's dark theme — a dark stage
|
|
32
|
+
* for code in both app themes (the inline light-theme colors lose to the
|
|
33
|
+
* dual-theme --shiki-dark variables). */
|
|
34
|
+
.sdocs-app pre.shiki,
|
|
35
|
+
.sdocs-app pre.shiki span {
|
|
36
|
+
color: var(--shiki-dark) !important;
|
|
37
|
+
background-color: var(--shiki-dark-bg) !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
/* Type chips and value literals, color-coded by kind (shared by doc tables) */
|
|
32
41
|
.sdocs-app code[class*='sdocs-type-'] {
|
|
33
42
|
font-family: var(--mono);
|