@classic-homes/theme-docs 0.0.2
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/dist/lib/components/CodeBlock.svelte +73 -0
- package/dist/lib/components/CodeBlock.svelte.d.ts +16 -0
- package/dist/lib/components/DocsCard.svelte +99 -0
- package/dist/lib/components/DocsCard.svelte.d.ts +11 -0
- package/dist/lib/components/DocsHub.svelte +83 -0
- package/dist/lib/components/DocsHub.svelte.d.ts +28 -0
- package/dist/lib/components/MarkdownPage.svelte +100 -0
- package/dist/lib/components/MarkdownPage.svelte.d.ts +33 -0
- package/dist/lib/components/MermaidDiagram.svelte +87 -0
- package/dist/lib/components/MermaidDiagram.svelte.d.ts +14 -0
- package/dist/lib/components/MermaidInit.svelte +100 -0
- package/dist/lib/components/MermaidInit.svelte.d.ts +9 -0
- package/dist/lib/components/TableOfContents.svelte +179 -0
- package/dist/lib/components/TableOfContents.svelte.d.ts +16 -0
- package/dist/lib/components/TocPanel.svelte +263 -0
- package/dist/lib/components/TocPanel.svelte.d.ts +20 -0
- package/dist/lib/highlighter/index.d.ts +15 -0
- package/dist/lib/highlighter/index.js +78 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/lib/index.js +31 -0
- package/dist/lib/parser/extensions.d.ts +75 -0
- package/dist/lib/parser/extensions.js +311 -0
- package/dist/lib/parser/index.d.ts +57 -0
- package/dist/lib/parser/index.js +150 -0
- package/dist/lib/styles/markdown.css +516 -0
- package/dist/lib/types/docs.d.ts +72 -0
- package/dist/lib/types/docs.js +4 -0
- package/dist/lib/types/frontmatter.d.ts +68 -0
- package/dist/lib/types/frontmatter.js +4 -0
- package/dist/lib/types/index.d.ts +5 -0
- package/dist/lib/types/index.js +4 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.js +9 -0
- package/package.json +68 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown Content Styles
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive styling for rendered markdown content.
|
|
5
|
+
* Uses Tailwind CSS utility classes and design token CSS variables.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import '@classic-homes/theme-docs/styles';
|
|
9
|
+
*
|
|
10
|
+
* Required CSS Variables:
|
|
11
|
+
* These HSL color channel values must be defined in your CSS (typically via @classic-homes/theme-tokens):
|
|
12
|
+
*
|
|
13
|
+
* --foreground - Main text color (e.g., "222 84% 5%" for dark text)
|
|
14
|
+
* --muted-foreground - Secondary/muted text color
|
|
15
|
+
* --primary - Primary accent color for links and highlights
|
|
16
|
+
* --muted - Muted background color for code blocks, tables
|
|
17
|
+
* --border - Border color for dividers, code blocks, tables
|
|
18
|
+
*
|
|
19
|
+
* Example CSS variable definitions:
|
|
20
|
+
* :root {
|
|
21
|
+
* --foreground: 222.2 84% 4.9%;
|
|
22
|
+
* --muted-foreground: 215.4 16.3% 46.9%;
|
|
23
|
+
* --primary: 222.2 47.4% 11.2%;
|
|
24
|
+
* --muted: 210 40% 96.1%;
|
|
25
|
+
* --border: 214.3 31.8% 91.4%;
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
.markdown-content {
|
|
30
|
+
color: hsl(var(--foreground));
|
|
31
|
+
line-height: 1.7;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Headings */
|
|
35
|
+
.markdown-content h1 {
|
|
36
|
+
font-size: 1.875rem;
|
|
37
|
+
line-height: 2.25rem;
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
color: hsl(var(--foreground));
|
|
40
|
+
margin-top: 2rem;
|
|
41
|
+
margin-bottom: 1rem;
|
|
42
|
+
padding-bottom: 0.75rem;
|
|
43
|
+
border-bottom: 1px solid hsl(var(--border));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.markdown-content h2 {
|
|
47
|
+
font-size: 1.5rem;
|
|
48
|
+
line-height: 2rem;
|
|
49
|
+
font-weight: 700;
|
|
50
|
+
color: hsl(var(--foreground));
|
|
51
|
+
margin-top: 2rem;
|
|
52
|
+
margin-bottom: 1rem;
|
|
53
|
+
padding-bottom: 0.5rem;
|
|
54
|
+
border-bottom: 1px solid hsl(var(--border));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.markdown-content h3 {
|
|
58
|
+
font-size: 1.25rem;
|
|
59
|
+
line-height: 1.75rem;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
color: hsl(var(--foreground));
|
|
62
|
+
margin-top: 1.5rem;
|
|
63
|
+
margin-bottom: 0.75rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.markdown-content h4 {
|
|
67
|
+
font-size: 1.125rem;
|
|
68
|
+
line-height: 1.75rem;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
color: hsl(var(--foreground));
|
|
71
|
+
margin-top: 1rem;
|
|
72
|
+
margin-bottom: 0.5rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.markdown-content h5 {
|
|
76
|
+
font-size: 1rem;
|
|
77
|
+
line-height: 1.5rem;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
color: hsl(var(--foreground));
|
|
80
|
+
margin-top: 0.75rem;
|
|
81
|
+
margin-bottom: 0.5rem;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.markdown-content h6 {
|
|
85
|
+
font-size: 0.875rem;
|
|
86
|
+
line-height: 1.25rem;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
/* Use foreground with slight opacity for better contrast than muted-foreground */
|
|
89
|
+
color: hsl(var(--foreground) / 0.85);
|
|
90
|
+
margin-top: 0.75rem;
|
|
91
|
+
margin-bottom: 0.5rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* First heading should not have top margin */
|
|
95
|
+
.markdown-content > h1:first-child,
|
|
96
|
+
.markdown-content > h2:first-child,
|
|
97
|
+
.markdown-content > h3:first-child {
|
|
98
|
+
margin-top: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Paragraphs */
|
|
102
|
+
.markdown-content p {
|
|
103
|
+
margin-bottom: 1rem;
|
|
104
|
+
color: hsl(var(--muted-foreground));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Links */
|
|
108
|
+
.markdown-content a {
|
|
109
|
+
color: hsl(var(--primary));
|
|
110
|
+
text-decoration: underline;
|
|
111
|
+
text-underline-offset: 2px;
|
|
112
|
+
transition: color 0.2s;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.markdown-content a:hover {
|
|
116
|
+
color: hsl(var(--primary) / 0.8);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Lists */
|
|
120
|
+
.markdown-content ul {
|
|
121
|
+
list-style-type: disc;
|
|
122
|
+
list-style-position: inside;
|
|
123
|
+
margin-bottom: 1rem;
|
|
124
|
+
color: hsl(var(--muted-foreground));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.markdown-content ol {
|
|
128
|
+
list-style-type: decimal;
|
|
129
|
+
list-style-position: inside;
|
|
130
|
+
margin-bottom: 1rem;
|
|
131
|
+
color: hsl(var(--muted-foreground));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.markdown-content li {
|
|
135
|
+
margin-left: 1rem;
|
|
136
|
+
margin-bottom: 0.5rem;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.markdown-content ul ul,
|
|
140
|
+
.markdown-content ol ul,
|
|
141
|
+
.markdown-content ul ol,
|
|
142
|
+
.markdown-content ol ol {
|
|
143
|
+
margin-left: 1.5rem;
|
|
144
|
+
margin-top: 0.5rem;
|
|
145
|
+
margin-bottom: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Code blocks - Shiki handles syntax colors, we handle layout */
|
|
149
|
+
.markdown-content pre {
|
|
150
|
+
border-radius: 0.5rem;
|
|
151
|
+
padding: 1rem;
|
|
152
|
+
margin-bottom: 1rem;
|
|
153
|
+
overflow-x: auto;
|
|
154
|
+
border: 1px solid hsl(var(--border));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.markdown-content pre code {
|
|
158
|
+
background: transparent;
|
|
159
|
+
padding: 0;
|
|
160
|
+
font-size: 0.875rem;
|
|
161
|
+
font-family:
|
|
162
|
+
ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Inline code */
|
|
166
|
+
.markdown-content code {
|
|
167
|
+
background: hsl(var(--muted));
|
|
168
|
+
color: hsl(var(--foreground));
|
|
169
|
+
padding: 0.125rem 0.375rem;
|
|
170
|
+
border-radius: 0.25rem;
|
|
171
|
+
font-size: 0.875rem;
|
|
172
|
+
font-family:
|
|
173
|
+
ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Blockquotes */
|
|
177
|
+
.markdown-content blockquote {
|
|
178
|
+
border-left: 4px solid hsl(var(--primary));
|
|
179
|
+
background: hsl(var(--muted) / 0.5);
|
|
180
|
+
padding: 0.75rem 1rem;
|
|
181
|
+
margin-bottom: 1rem;
|
|
182
|
+
font-style: italic;
|
|
183
|
+
color: hsl(var(--muted-foreground));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.markdown-content blockquote p {
|
|
187
|
+
margin-bottom: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Horizontal rules */
|
|
191
|
+
.markdown-content hr {
|
|
192
|
+
margin: 2rem 0;
|
|
193
|
+
border: none;
|
|
194
|
+
border-top: 1px solid hsl(var(--border));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Tables */
|
|
198
|
+
.markdown-content table {
|
|
199
|
+
width: 100%;
|
|
200
|
+
border-collapse: collapse;
|
|
201
|
+
margin-bottom: 1rem;
|
|
202
|
+
font-size: 0.875rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.markdown-content thead {
|
|
206
|
+
background: hsl(var(--muted));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.markdown-content th {
|
|
210
|
+
border: 1px solid hsl(var(--border));
|
|
211
|
+
padding: 0.5rem 1rem;
|
|
212
|
+
text-align: left;
|
|
213
|
+
font-weight: 600;
|
|
214
|
+
color: hsl(var(--foreground));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.markdown-content td {
|
|
218
|
+
border: 1px solid hsl(var(--border));
|
|
219
|
+
padding: 0.5rem 1rem;
|
|
220
|
+
color: hsl(var(--muted-foreground));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.markdown-content tbody tr:nth-child(even) {
|
|
224
|
+
background: hsl(var(--muted) / 0.5);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Strong/Bold */
|
|
228
|
+
.markdown-content strong {
|
|
229
|
+
font-weight: 600;
|
|
230
|
+
color: hsl(var(--foreground));
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* Emphasis/Italic */
|
|
234
|
+
.markdown-content em {
|
|
235
|
+
font-style: italic;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Images */
|
|
239
|
+
.markdown-content img {
|
|
240
|
+
max-width: 100%;
|
|
241
|
+
height: auto;
|
|
242
|
+
border-radius: 0.5rem;
|
|
243
|
+
border: 1px solid hsl(var(--border));
|
|
244
|
+
margin: 1rem 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* Task lists */
|
|
248
|
+
.markdown-content input[type='checkbox'] {
|
|
249
|
+
margin-right: 0.5rem;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Shiki code block styling overrides */
|
|
253
|
+
.markdown-content .shiki {
|
|
254
|
+
border-radius: 0.5rem;
|
|
255
|
+
padding: 1rem;
|
|
256
|
+
margin-bottom: 1rem;
|
|
257
|
+
overflow-x: auto;
|
|
258
|
+
border: 1px solid hsl(var(--border));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* Code block wrapper styling */
|
|
262
|
+
.code-block-wrapper {
|
|
263
|
+
margin-bottom: 1rem;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.code-block-wrapper .shiki {
|
|
267
|
+
margin-bottom: 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.code-block-wrapper:has(.code-block-filename) .shiki {
|
|
271
|
+
border-top-left-radius: 0;
|
|
272
|
+
border-top-right-radius: 0;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* ==========================================================================
|
|
276
|
+
Admonitions / Callouts
|
|
277
|
+
========================================================================== */
|
|
278
|
+
|
|
279
|
+
.markdown-content .admonition {
|
|
280
|
+
margin: 1.5rem 0;
|
|
281
|
+
border-radius: 0.5rem;
|
|
282
|
+
border: 1px solid hsl(var(--border));
|
|
283
|
+
overflow: hidden;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.markdown-content .admonition-heading {
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
gap: 0.5rem;
|
|
290
|
+
padding: 0.75rem 1rem;
|
|
291
|
+
font-weight: 600;
|
|
292
|
+
font-size: 0.875rem;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.markdown-content .admonition-icon {
|
|
296
|
+
width: 1.25rem;
|
|
297
|
+
height: 1.25rem;
|
|
298
|
+
flex-shrink: 0;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.markdown-content .admonition-content {
|
|
302
|
+
padding: 0 1rem 1rem;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.markdown-content .admonition-content > :first-child {
|
|
306
|
+
margin-top: 0;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.markdown-content .admonition-content > :last-child {
|
|
310
|
+
margin-bottom: 0;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* Note - Blue */
|
|
314
|
+
.markdown-content .admonition-note {
|
|
315
|
+
border-color: hsl(210 100% 50% / 0.3);
|
|
316
|
+
background: hsl(210 100% 50% / 0.05);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.markdown-content .admonition-note .admonition-heading {
|
|
320
|
+
background: hsl(210 100% 50% / 0.1);
|
|
321
|
+
color: hsl(210 100% 40%);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Tip - Green */
|
|
325
|
+
.markdown-content .admonition-tip {
|
|
326
|
+
border-color: hsl(142 71% 45% / 0.3);
|
|
327
|
+
background: hsl(142 71% 45% / 0.05);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.markdown-content .admonition-tip .admonition-heading {
|
|
331
|
+
background: hsl(142 71% 45% / 0.1);
|
|
332
|
+
color: hsl(142 71% 35%);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* Warning - Yellow/Orange */
|
|
336
|
+
.markdown-content .admonition-warning {
|
|
337
|
+
border-color: hsl(38 92% 50% / 0.3);
|
|
338
|
+
background: hsl(38 92% 50% / 0.05);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.markdown-content .admonition-warning .admonition-heading {
|
|
342
|
+
background: hsl(38 92% 50% / 0.1);
|
|
343
|
+
color: hsl(38 92% 35%);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* Important - Purple */
|
|
347
|
+
.markdown-content .admonition-important {
|
|
348
|
+
border-color: hsl(265 83% 57% / 0.3);
|
|
349
|
+
background: hsl(265 83% 57% / 0.05);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.markdown-content .admonition-important .admonition-heading {
|
|
353
|
+
background: hsl(265 83% 57% / 0.1);
|
|
354
|
+
color: hsl(265 83% 45%);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/* Caution - Red */
|
|
358
|
+
.markdown-content .admonition-caution {
|
|
359
|
+
border-color: hsl(0 84% 60% / 0.3);
|
|
360
|
+
background: hsl(0 84% 60% / 0.05);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.markdown-content .admonition-caution .admonition-heading {
|
|
364
|
+
background: hsl(0 84% 60% / 0.1);
|
|
365
|
+
color: hsl(0 84% 45%);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* ==========================================================================
|
|
369
|
+
Footnotes
|
|
370
|
+
========================================================================== */
|
|
371
|
+
|
|
372
|
+
.markdown-content .footnotes {
|
|
373
|
+
margin-top: 3rem;
|
|
374
|
+
font-size: 0.875rem;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.markdown-content .footnotes-separator {
|
|
378
|
+
margin-bottom: 1.5rem;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.markdown-content .footnotes-list {
|
|
382
|
+
padding-left: 1.5rem;
|
|
383
|
+
color: hsl(var(--muted-foreground));
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.markdown-content .footnote-item {
|
|
387
|
+
margin-bottom: 0.5rem;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.markdown-content .footnote-item p {
|
|
391
|
+
display: inline;
|
|
392
|
+
margin: 0;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.markdown-content .footnote-backref {
|
|
396
|
+
margin-left: 0.25rem;
|
|
397
|
+
text-decoration: none;
|
|
398
|
+
font-size: 0.75rem;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.markdown-content .footnote-ref a {
|
|
402
|
+
text-decoration: none;
|
|
403
|
+
color: hsl(var(--primary));
|
|
404
|
+
font-size: 0.75rem;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.markdown-content .footnote-ref a:hover {
|
|
408
|
+
text-decoration: underline;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* ==========================================================================
|
|
412
|
+
Definition Lists
|
|
413
|
+
========================================================================== */
|
|
414
|
+
|
|
415
|
+
.markdown-content .definition-list {
|
|
416
|
+
margin-bottom: 1.5rem;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.markdown-content .definition-list dt {
|
|
420
|
+
font-weight: 600;
|
|
421
|
+
color: hsl(var(--foreground));
|
|
422
|
+
margin-top: 1rem;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.markdown-content .definition-list dt:first-child {
|
|
426
|
+
margin-top: 0;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.markdown-content .definition-list dd {
|
|
430
|
+
margin-left: 1.5rem;
|
|
431
|
+
margin-top: 0.25rem;
|
|
432
|
+
color: hsl(var(--muted-foreground));
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/* ==========================================================================
|
|
436
|
+
Mermaid Diagrams
|
|
437
|
+
========================================================================== */
|
|
438
|
+
|
|
439
|
+
.markdown-content .mermaid-diagram {
|
|
440
|
+
margin: 1.5rem 0;
|
|
441
|
+
padding: 1rem;
|
|
442
|
+
background: hsl(var(--muted) / 0.3);
|
|
443
|
+
border: 1px solid hsl(var(--border));
|
|
444
|
+
border-radius: 0.5rem;
|
|
445
|
+
overflow-x: auto;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.markdown-content .mermaid-diagram.mermaid-rendered {
|
|
449
|
+
display: flex;
|
|
450
|
+
justify-content: center;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.markdown-content .mermaid-diagram svg {
|
|
454
|
+
max-width: 100%;
|
|
455
|
+
height: auto;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.markdown-content .mermaid-diagram pre.mermaid {
|
|
459
|
+
margin: 0;
|
|
460
|
+
padding: 0;
|
|
461
|
+
background: transparent;
|
|
462
|
+
border: none;
|
|
463
|
+
font-size: 0.875rem;
|
|
464
|
+
color: hsl(var(--muted-foreground));
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* Standalone Mermaid component styles */
|
|
468
|
+
.mermaid-container {
|
|
469
|
+
margin: 1.5rem 0;
|
|
470
|
+
padding: 1rem;
|
|
471
|
+
background: hsl(var(--muted) / 0.3);
|
|
472
|
+
border: 1px solid hsl(var(--border));
|
|
473
|
+
border-radius: 0.5rem;
|
|
474
|
+
overflow-x: auto;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.mermaid-container svg {
|
|
478
|
+
max-width: 100%;
|
|
479
|
+
height: auto;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.mermaid-fallback {
|
|
483
|
+
margin: 0;
|
|
484
|
+
padding: 0.5rem;
|
|
485
|
+
background: transparent;
|
|
486
|
+
border: none;
|
|
487
|
+
font-size: 0.875rem;
|
|
488
|
+
color: hsl(var(--muted-foreground));
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.mermaid-error {
|
|
492
|
+
border-color: hsl(0 84% 60% / 0.3);
|
|
493
|
+
background: hsl(0 84% 60% / 0.05);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.mermaid-error-message {
|
|
497
|
+
color: hsl(0 84% 45%);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.mermaid-error-title {
|
|
501
|
+
font-weight: 600;
|
|
502
|
+
margin-bottom: 0.5rem;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.mermaid-error-code {
|
|
506
|
+
margin: 0.5rem 0;
|
|
507
|
+
padding: 0.5rem;
|
|
508
|
+
background: hsl(var(--muted) / 0.5);
|
|
509
|
+
border-radius: 0.25rem;
|
|
510
|
+
font-size: 0.75rem;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.mermaid-error-details {
|
|
514
|
+
font-size: 0.75rem;
|
|
515
|
+
margin: 0;
|
|
516
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DocsHub Configuration Types
|
|
3
|
+
*/
|
|
4
|
+
/** Individual documentation item */
|
|
5
|
+
export interface DocsItem {
|
|
6
|
+
/** Display title */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Brief description */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Link/route to the document */
|
|
11
|
+
href: string;
|
|
12
|
+
/** Icon identifier or component */
|
|
13
|
+
icon?: string;
|
|
14
|
+
/** Tags for filtering */
|
|
15
|
+
tags?: string[];
|
|
16
|
+
/** Whether item is new/updated */
|
|
17
|
+
badge?: 'new' | 'updated' | 'deprecated' | string;
|
|
18
|
+
/** External link (opens in new tab) */
|
|
19
|
+
external?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Documentation section/category */
|
|
22
|
+
export interface DocsSection {
|
|
23
|
+
/** Section identifier */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Section title */
|
|
26
|
+
title?: string;
|
|
27
|
+
/** Section description */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Items in this section */
|
|
30
|
+
items: DocsItem[];
|
|
31
|
+
/** Collapse section by default */
|
|
32
|
+
collapsed?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Full DocsHub configuration */
|
|
35
|
+
export interface DocsHubConfig {
|
|
36
|
+
/** Documentation sections */
|
|
37
|
+
sections: DocsSection[];
|
|
38
|
+
/** Optional search configuration */
|
|
39
|
+
search?: {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** DocsHub component props */
|
|
45
|
+
export interface DocsHubProps {
|
|
46
|
+
config: DocsHubConfig;
|
|
47
|
+
columns?: 1 | 2 | 3 | 4;
|
|
48
|
+
class?: string;
|
|
49
|
+
}
|
|
50
|
+
/** DocsCard component props */
|
|
51
|
+
export interface DocsCardProps {
|
|
52
|
+
item: DocsItem;
|
|
53
|
+
class?: string;
|
|
54
|
+
}
|
|
55
|
+
/** TableOfContents heading entry */
|
|
56
|
+
export interface TocEntry {
|
|
57
|
+
/** Heading text */
|
|
58
|
+
text: string;
|
|
59
|
+
/** Heading level (1-6) */
|
|
60
|
+
level: number;
|
|
61
|
+
/** Generated ID for linking */
|
|
62
|
+
id: string;
|
|
63
|
+
}
|
|
64
|
+
/** TableOfContents component props */
|
|
65
|
+
export interface TableOfContentsProps {
|
|
66
|
+
/** HTML content to extract headings from */
|
|
67
|
+
html: string;
|
|
68
|
+
/** Maximum heading depth to include (default: 3) */
|
|
69
|
+
maxDepth?: number;
|
|
70
|
+
/** Custom class */
|
|
71
|
+
class?: string;
|
|
72
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontmatter Types for Documentation
|
|
3
|
+
*/
|
|
4
|
+
/** Author information as an object */
|
|
5
|
+
export interface AuthorInfo {
|
|
6
|
+
/** Author's display name */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Author's email address */
|
|
9
|
+
email?: string;
|
|
10
|
+
/** URL to author's avatar image */
|
|
11
|
+
avatar?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Standard frontmatter fields */
|
|
14
|
+
export interface FrontmatterData {
|
|
15
|
+
/** Document title */
|
|
16
|
+
title?: string;
|
|
17
|
+
/** Document description/summary */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Tags for categorization */
|
|
20
|
+
tags?: string[];
|
|
21
|
+
/** Publication/last updated date (ISO 8601 string or Date object) */
|
|
22
|
+
date?: string | Date;
|
|
23
|
+
/** Author - can be a simple name string or detailed author info */
|
|
24
|
+
author?: string | AuthorInfo;
|
|
25
|
+
/** Document category */
|
|
26
|
+
category?: string;
|
|
27
|
+
/** Sort order within category (lower numbers appear first) */
|
|
28
|
+
order?: number;
|
|
29
|
+
/** Whether document is draft (not for production) */
|
|
30
|
+
draft?: boolean;
|
|
31
|
+
/** Custom icon (emoji or icon name for DocsHub cards) */
|
|
32
|
+
icon?: string;
|
|
33
|
+
/** Estimated reading time (e.g., "5 min read") */
|
|
34
|
+
readingTime?: string;
|
|
35
|
+
/** Related document slugs for cross-linking */
|
|
36
|
+
related?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Custom metadata fields - allows extending frontmatter with additional properties.
|
|
39
|
+
* Note: Type safety is not enforced for custom fields. Consider creating a
|
|
40
|
+
* specific interface extending FrontmatterData for your project's needs.
|
|
41
|
+
*/
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
/** Parsed markdown result */
|
|
45
|
+
export interface ParsedMarkdown {
|
|
46
|
+
/** Extracted frontmatter data */
|
|
47
|
+
frontmatter: FrontmatterData | null;
|
|
48
|
+
/** Raw markdown content (without frontmatter) */
|
|
49
|
+
markdown: string;
|
|
50
|
+
/** Rendered HTML content */
|
|
51
|
+
html: string;
|
|
52
|
+
}
|
|
53
|
+
/** Parser options */
|
|
54
|
+
export interface ParseOptions {
|
|
55
|
+
/** Shiki theme for code highlighting */
|
|
56
|
+
theme?: string;
|
|
57
|
+
/** Whether to generate heading IDs */
|
|
58
|
+
generateHeadingIds?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** MarkdownPage component props */
|
|
61
|
+
export interface MarkdownPageProps {
|
|
62
|
+
/** Raw markdown content (with optional frontmatter) */
|
|
63
|
+
content: string;
|
|
64
|
+
/** Custom class for the content container */
|
|
65
|
+
class?: string;
|
|
66
|
+
/** Shiki theme to use */
|
|
67
|
+
theme?: 'github-dark' | 'github-light' | 'one-dark-pro' | string;
|
|
68
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type exports for @classic-homes/theme-docs
|
|
3
|
+
*/
|
|
4
|
+
export type { AuthorInfo, FrontmatterData, ParsedMarkdown, ParseOptions, MarkdownPageProps, } from './frontmatter.js';
|
|
5
|
+
export type { DocsItem, DocsSection, DocsHubConfig, DocsHubProps, DocsCardProps, TocEntry, TableOfContentsProps, } from './docs.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
/**
|
|
4
|
+
* Utility function to merge Tailwind CSS classes
|
|
5
|
+
* Uses clsx for conditional classes and tailwind-merge to handle conflicts
|
|
6
|
+
*/
|
|
7
|
+
export function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|