sourcey 3.4.0 → 3.4.3
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/client/scroll-tracker.js +168 -156
- package/dist/client/search.js +186 -160
- package/dist/client/sidebar.js +56 -48
- package/dist/client/tabs.js +154 -146
- package/dist/components/layout/Head.d.ts.map +1 -1
- package/dist/components/layout/Head.js +4 -12
- package/dist/components/layout/Header.d.ts.map +1 -1
- package/dist/components/layout/Header.js +3 -3
- package/dist/components/layout/Page.d.ts.map +1 -1
- package/dist/components/layout/Page.js +9 -9
- package/dist/components/layout/Sidebar.d.ts.map +1 -1
- package/dist/components/layout/Sidebar.js +18 -14
- package/dist/components/layout/TableOfContents.d.ts.map +1 -1
- package/dist/components/layout/TableOfContents.js +2 -1
- package/dist/components/openapi/EndpointBar.js +5 -5
- package/dist/components/openapi/Introduction.js +1 -1
- package/dist/components/openapi/Responses.js +4 -4
- package/dist/components/openapi/Security.js +1 -1
- package/dist/components/ui/SectionLabel.js +1 -1
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -3
- package/dist/core/doxygen-loader.d.ts +1 -0
- package/dist/core/doxygen-loader.d.ts.map +1 -1
- package/dist/core/doxygen-loader.js +12 -3
- package/dist/core/markdown-loader.d.ts.map +1 -1
- package/dist/core/markdown-loader.js +46 -2
- package/dist/core/search-indexer.d.ts +3 -1
- package/dist/core/search-indexer.d.ts.map +1 -1
- package/dist/core/search-indexer.js +7 -3
- package/dist/dev-server.js +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/init.js +1 -1
- package/dist/renderer/html-builder.d.ts +2 -0
- package/dist/renderer/html-builder.d.ts.map +1 -1
- package/dist/renderer/html-builder.js +6 -0
- package/dist/renderer/llms.d.ts +6 -0
- package/dist/renderer/llms.d.ts.map +1 -0
- package/dist/renderer/llms.js +247 -0
- package/dist/themes/default/main.css +6 -3
- package/dist/themes/default/sourcey.css +92 -58
- package/dist/utils/icons.d.ts +4 -0
- package/dist/utils/icons.d.ts.map +1 -1
- package/dist/utils/icons.js +6 -0
- package/dist/utils/markdown.d.ts +10 -0
- package/dist/utils/markdown.d.ts.map +1 -1
- package/dist/utils/markdown.js +82 -6
- package/package.json +1 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { htmlId } from "../utils/html-id.js";
|
|
2
|
+
export function generateLlmsTxt(pages, navigation, site) {
|
|
3
|
+
const lines = [];
|
|
4
|
+
const title = resolveSiteTitle(pages, site);
|
|
5
|
+
const summary = resolveSiteSummary(pages, site);
|
|
6
|
+
lines.push(`# ${title}`);
|
|
7
|
+
lines.push("");
|
|
8
|
+
if (summary) {
|
|
9
|
+
lines.push(`> ${firstLine(summary)}`);
|
|
10
|
+
lines.push("");
|
|
11
|
+
}
|
|
12
|
+
for (const tab of navigation.tabs) {
|
|
13
|
+
const tabPages = pages.filter((page) => page.tabSlug === tab.slug);
|
|
14
|
+
if (!tabPages.length)
|
|
15
|
+
continue;
|
|
16
|
+
lines.push(`## ${tab.label}`);
|
|
17
|
+
lines.push("");
|
|
18
|
+
for (const page of tabPages) {
|
|
19
|
+
if (page.currentPage.kind === "markdown" && page.currentPage.markdown) {
|
|
20
|
+
const doc = page.currentPage.markdown;
|
|
21
|
+
const desc = doc.description || excerpt(stripHtml(doc.html));
|
|
22
|
+
lines.push(`- [${doc.title}](${page.outputPath})${desc ? `: ${desc}` : ""}`);
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const spec = page.currentPage.spec ?? page.spec;
|
|
26
|
+
const overview = spec.info.description ? firstLine(spec.info.description) : `${spec.operations.length} documented operations`;
|
|
27
|
+
lines.push(`- [${spec.info.title}](${page.outputPath})${overview ? `: ${overview}` : ""}`);
|
|
28
|
+
for (const op of spec.operations) {
|
|
29
|
+
if (op.hidden)
|
|
30
|
+
continue;
|
|
31
|
+
const opLabel = op.summary ?? operationDisplayName(op);
|
|
32
|
+
const opSummary = [operationKind(op), firstLine(op.description)].filter(Boolean).join(" — ");
|
|
33
|
+
lines.push(`- [${opLabel}](${page.outputPath}#${operationAnchor(op)})${opSummary ? `: ${opSummary}` : ""}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lines.push("");
|
|
37
|
+
}
|
|
38
|
+
return lines.join("\n");
|
|
39
|
+
}
|
|
40
|
+
export function generateLlmsFullTxt(pages, navigation, site) {
|
|
41
|
+
const lines = [];
|
|
42
|
+
const title = resolveSiteTitle(pages, site);
|
|
43
|
+
const summary = resolveSiteSummary(pages, site);
|
|
44
|
+
lines.push(`# ${title}`);
|
|
45
|
+
lines.push("");
|
|
46
|
+
if (summary) {
|
|
47
|
+
lines.push(summary);
|
|
48
|
+
lines.push("");
|
|
49
|
+
}
|
|
50
|
+
for (const tab of navigation.tabs) {
|
|
51
|
+
const tabPages = pages.filter((page) => page.tabSlug === tab.slug);
|
|
52
|
+
if (!tabPages.length)
|
|
53
|
+
continue;
|
|
54
|
+
lines.push(`## ${tab.label}`);
|
|
55
|
+
lines.push("");
|
|
56
|
+
for (const page of tabPages) {
|
|
57
|
+
if (page.currentPage.kind === "markdown" && page.currentPage.markdown) {
|
|
58
|
+
appendMarkdownPage(lines, page);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
appendSpecPage(lines, page);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return lines.join("\n");
|
|
66
|
+
}
|
|
67
|
+
function appendMarkdownPage(lines, page) {
|
|
68
|
+
const doc = page.currentPage.markdown;
|
|
69
|
+
lines.push(`### ${doc.title}`);
|
|
70
|
+
lines.push("");
|
|
71
|
+
lines.push(`Path: \`${page.outputPath}\``);
|
|
72
|
+
lines.push("");
|
|
73
|
+
if (doc.description) {
|
|
74
|
+
lines.push(doc.description);
|
|
75
|
+
lines.push("");
|
|
76
|
+
}
|
|
77
|
+
const body = stripHtml(doc.html);
|
|
78
|
+
if (body) {
|
|
79
|
+
lines.push(body);
|
|
80
|
+
lines.push("");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function appendSpecPage(lines, page) {
|
|
84
|
+
const spec = page.currentPage.spec ?? page.spec;
|
|
85
|
+
lines.push(`### ${spec.info.title}`);
|
|
86
|
+
lines.push("");
|
|
87
|
+
lines.push(`Path: \`${page.outputPath}\``);
|
|
88
|
+
if (spec.info.version) {
|
|
89
|
+
lines.push(`Version: ${spec.info.version}`);
|
|
90
|
+
}
|
|
91
|
+
lines.push("");
|
|
92
|
+
if (spec.info.description) {
|
|
93
|
+
lines.push(spec.info.description);
|
|
94
|
+
lines.push("");
|
|
95
|
+
}
|
|
96
|
+
if (spec.operations.length) {
|
|
97
|
+
lines.push("#### Operations");
|
|
98
|
+
lines.push("");
|
|
99
|
+
for (const op of spec.operations) {
|
|
100
|
+
if (op.hidden)
|
|
101
|
+
continue;
|
|
102
|
+
appendOperation(lines, op);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const schemas = Object.entries(spec.schemas);
|
|
106
|
+
if (schemas.length) {
|
|
107
|
+
lines.push("#### Models");
|
|
108
|
+
lines.push("");
|
|
109
|
+
for (const [name, schema] of schemas) {
|
|
110
|
+
const desc = schema.description ? `: ${schema.description}` : "";
|
|
111
|
+
lines.push(`- ${name}${desc}`);
|
|
112
|
+
}
|
|
113
|
+
lines.push("");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function appendOperation(lines, op) {
|
|
117
|
+
lines.push(`##### ${operationDisplayName(op)}`);
|
|
118
|
+
lines.push("");
|
|
119
|
+
if (op.summary && op.summary !== operationDisplayName(op)) {
|
|
120
|
+
lines.push(`Summary: ${op.summary}`);
|
|
121
|
+
lines.push("");
|
|
122
|
+
}
|
|
123
|
+
if (op.description) {
|
|
124
|
+
lines.push(op.description);
|
|
125
|
+
lines.push("");
|
|
126
|
+
}
|
|
127
|
+
if (op.parameters.length) {
|
|
128
|
+
lines.push("Parameters:");
|
|
129
|
+
for (const param of op.parameters) {
|
|
130
|
+
const req = param.required ? "required" : "optional";
|
|
131
|
+
const type = param.schema ? formatSchemaType(param.schema) : "unknown";
|
|
132
|
+
const desc = param.description ? ` — ${firstLine(param.description)}` : "";
|
|
133
|
+
lines.push(`- \`${param.name}\` (${param.in}, ${type}, ${req})${desc}`);
|
|
134
|
+
}
|
|
135
|
+
lines.push("");
|
|
136
|
+
}
|
|
137
|
+
if (op.requestBody) {
|
|
138
|
+
const mediaTypes = Object.keys(op.requestBody.content);
|
|
139
|
+
if (mediaTypes.length) {
|
|
140
|
+
lines.push(`Request body: ${mediaTypes.join(", ")}`);
|
|
141
|
+
lines.push("");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (op.mcpExtras?.outputSchema) {
|
|
145
|
+
lines.push("Returns:");
|
|
146
|
+
lines.push("```json");
|
|
147
|
+
lines.push(JSON.stringify(op.mcpExtras.outputSchema, null, 2));
|
|
148
|
+
lines.push("```");
|
|
149
|
+
lines.push("");
|
|
150
|
+
}
|
|
151
|
+
else if (op.responses.length) {
|
|
152
|
+
lines.push("Responses:");
|
|
153
|
+
for (const response of op.responses) {
|
|
154
|
+
lines.push(`- ${formatResponse(response)}`);
|
|
155
|
+
}
|
|
156
|
+
lines.push("");
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function resolveSiteTitle(pages, site) {
|
|
160
|
+
if (site.name && site.name !== "API Reference")
|
|
161
|
+
return site.name;
|
|
162
|
+
const specPages = pages.filter((page) => page.currentPage.kind === "spec");
|
|
163
|
+
if (specPages.length === 1) {
|
|
164
|
+
const spec = specPages[0].currentPage.spec ?? specPages[0].spec;
|
|
165
|
+
if (spec.info.title)
|
|
166
|
+
return spec.info.title;
|
|
167
|
+
}
|
|
168
|
+
const firstMarkdown = pages.find((page) => page.currentPage.kind === "markdown" && page.currentPage.markdown);
|
|
169
|
+
if (firstMarkdown?.currentPage.markdown?.title)
|
|
170
|
+
return firstMarkdown.currentPage.markdown.title;
|
|
171
|
+
return site.name || "Documentation";
|
|
172
|
+
}
|
|
173
|
+
function resolveSiteSummary(pages, site) {
|
|
174
|
+
const firstMarkdown = pages.find((page) => page.currentPage.kind === "markdown" && page.currentPage.markdown?.description);
|
|
175
|
+
if (firstMarkdown?.currentPage.markdown?.description)
|
|
176
|
+
return firstMarkdown.currentPage.markdown.description;
|
|
177
|
+
const firstSpec = pages.find((page) => page.currentPage.kind === "spec");
|
|
178
|
+
const spec = firstSpec ? (firstSpec.currentPage.spec ?? firstSpec.spec) : undefined;
|
|
179
|
+
if (spec?.info.description)
|
|
180
|
+
return spec.info.description;
|
|
181
|
+
return site.name ? `${site.name} documentation generated by Sourcey.` : undefined;
|
|
182
|
+
}
|
|
183
|
+
function operationDisplayName(op) {
|
|
184
|
+
if (op.mcpExtras?.type === "tool")
|
|
185
|
+
return `TOOL ${op.path}`;
|
|
186
|
+
if (op.mcpExtras?.type === "resource")
|
|
187
|
+
return `RESOURCE ${op.path}`;
|
|
188
|
+
if (op.mcpExtras?.type === "prompt")
|
|
189
|
+
return `PROMPT ${op.path}`;
|
|
190
|
+
return `${op.method.toUpperCase()} ${op.path}`;
|
|
191
|
+
}
|
|
192
|
+
function operationKind(op) {
|
|
193
|
+
if (op.mcpExtras?.type === "tool")
|
|
194
|
+
return "tool";
|
|
195
|
+
if (op.mcpExtras?.type === "resource")
|
|
196
|
+
return "resource";
|
|
197
|
+
if (op.mcpExtras?.type === "prompt")
|
|
198
|
+
return "prompt";
|
|
199
|
+
return `${op.method.toUpperCase()} ${op.path}`;
|
|
200
|
+
}
|
|
201
|
+
function operationAnchor(op) {
|
|
202
|
+
return `operation-${htmlId(op.path)}-${htmlId(op.method)}`;
|
|
203
|
+
}
|
|
204
|
+
function formatResponse(response) {
|
|
205
|
+
const desc = response.description ? firstLine(response.description) : "";
|
|
206
|
+
return desc ? `${response.statusCode}: ${desc}` : response.statusCode;
|
|
207
|
+
}
|
|
208
|
+
function formatSchemaType(schema) {
|
|
209
|
+
if (Array.isArray(schema.type))
|
|
210
|
+
return schema.type.join(" | ");
|
|
211
|
+
if (schema.type)
|
|
212
|
+
return schema.type;
|
|
213
|
+
if (schema.oneOf?.length)
|
|
214
|
+
return schema.oneOf.map(formatSchemaType).join(" | ");
|
|
215
|
+
if (schema.anyOf?.length)
|
|
216
|
+
return schema.anyOf.map(formatSchemaType).join(" | ");
|
|
217
|
+
if (schema.allOf?.length)
|
|
218
|
+
return "object";
|
|
219
|
+
if (schema.properties)
|
|
220
|
+
return "object";
|
|
221
|
+
return "unknown";
|
|
222
|
+
}
|
|
223
|
+
function stripHtml(html) {
|
|
224
|
+
return decodeEntities(html)
|
|
225
|
+
.replace(/<pre[\s\S]*?<\/pre>/gi, (match) => match.replace(/<[^>]+>/g, " "))
|
|
226
|
+
.replace(/<code[\s\S]*?<\/code>/gi, (match) => match.replace(/<[^>]+>/g, " "))
|
|
227
|
+
.replace(/<[^>]+>/g, " ")
|
|
228
|
+
.replace(/\s+/g, " ")
|
|
229
|
+
.trim();
|
|
230
|
+
}
|
|
231
|
+
function decodeEntities(text) {
|
|
232
|
+
return text
|
|
233
|
+
.replace(/ /g, " ")
|
|
234
|
+
.replace(/&/g, "&")
|
|
235
|
+
.replace(/</g, "<")
|
|
236
|
+
.replace(/>/g, ">")
|
|
237
|
+
.replace(/"/g, "\"")
|
|
238
|
+
.replace(/'/g, "'");
|
|
239
|
+
}
|
|
240
|
+
function excerpt(text, max = 140) {
|
|
241
|
+
if (text.length <= max)
|
|
242
|
+
return text;
|
|
243
|
+
return `${text.slice(0, max - 1).trimEnd()}…`;
|
|
244
|
+
}
|
|
245
|
+
function firstLine(text) {
|
|
246
|
+
return text?.split("\n").map((line) => line.trim()).find(Boolean) ?? "";
|
|
247
|
+
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
--color-primary: 99 102 241;
|
|
24
24
|
--color-primary-light: 129 140 248;
|
|
25
25
|
--color-primary-dark: 79 70 229;
|
|
26
|
+
--color-primary-ink: 79 70 229;
|
|
26
27
|
|
|
27
28
|
/* Backgrounds */
|
|
28
29
|
--color-background-light: 255 255 255;
|
|
@@ -65,9 +66,11 @@
|
|
|
65
66
|
--method-put: #d97706;
|
|
66
67
|
--method-delete: #dc2626;
|
|
67
68
|
--method-patch: #9333ea;
|
|
69
|
+
--method-tool: #9333ea;
|
|
70
|
+
--method-resource: #16a34a;
|
|
71
|
+
--method-prompt: #2563eb;
|
|
68
72
|
|
|
69
73
|
/* Typography */
|
|
70
|
-
--font-sans:
|
|
71
|
-
--font-mono:
|
|
74
|
+
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
75
|
+
--font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;
|
|
72
76
|
}
|
|
73
|
-
|
|
@@ -7,6 +7,42 @@
|
|
|
7
7
|
* utilities in generated HTML.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/* ── Page Description (display font) ─────────────────────────────── */
|
|
11
|
+
|
|
12
|
+
#sourcey .page-description {
|
|
13
|
+
font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
|
|
14
|
+
font-size: 1.125rem;
|
|
15
|
+
line-height: 1.35;
|
|
16
|
+
font-style: italic;
|
|
17
|
+
color: rgb(var(--color-gray-600));
|
|
18
|
+
}
|
|
19
|
+
@media (min-width: 1024px) {
|
|
20
|
+
#sourcey .page-description {
|
|
21
|
+
font-size: 1.375rem;
|
|
22
|
+
line-height: 1.4;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.dark #sourcey .page-description {
|
|
26
|
+
color: rgb(var(--color-gray-400));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* ── Page Top Gradient ────────────────────────────────────────────── */
|
|
30
|
+
|
|
31
|
+
#sourcey #page::before {
|
|
32
|
+
content: "";
|
|
33
|
+
position: fixed;
|
|
34
|
+
top: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
height: 400px;
|
|
38
|
+
background: linear-gradient(to bottom, rgb(var(--color-primary) / 0.03), transparent);
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
z-index: -1;
|
|
41
|
+
}
|
|
42
|
+
.dark #sourcey #page::before {
|
|
43
|
+
background: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
10
46
|
/* ── Scroll Offset (clears fixed navbar on anchor clicks) ──────────── */
|
|
11
47
|
|
|
12
48
|
[data-traverse-target],
|
|
@@ -74,6 +110,24 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
74
110
|
height: 100%;
|
|
75
111
|
}
|
|
76
112
|
|
|
113
|
+
/* ── Prose Iframe (::iframe directive) ────────────────────────────── */
|
|
114
|
+
|
|
115
|
+
#sourcey .prose-iframe {
|
|
116
|
+
width: 100%;
|
|
117
|
+
margin: 1.5rem 0;
|
|
118
|
+
border-radius: var(--radius);
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
border: 1px solid rgb(var(--color-stone-950) / 0.1);
|
|
121
|
+
}
|
|
122
|
+
.dark #sourcey .prose-iframe {
|
|
123
|
+
border-color: rgb(255 255 255 / 0.1);
|
|
124
|
+
}
|
|
125
|
+
#sourcey .prose-iframe iframe {
|
|
126
|
+
width: 100%;
|
|
127
|
+
height: 100%;
|
|
128
|
+
display: block;
|
|
129
|
+
}
|
|
130
|
+
|
|
77
131
|
/* ── Prose Code Block (fenced code in markdown pages) ─────────────── */
|
|
78
132
|
|
|
79
133
|
#sourcey .prose-code-block {
|
|
@@ -195,7 +249,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
195
249
|
background: rgb(var(--color-gray-800) / 0.4);
|
|
196
250
|
}
|
|
197
251
|
#sourcey .nav-link.active {
|
|
198
|
-
color: rgb(var(--color-primary));
|
|
252
|
+
color: rgb(var(--color-primary-ink));
|
|
199
253
|
background: rgb(var(--color-primary) / 0.08);
|
|
200
254
|
font-weight: 500;
|
|
201
255
|
}
|
|
@@ -211,12 +265,15 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
211
265
|
padding-left: 0.75rem;
|
|
212
266
|
transition: color 0.15s, border-color 0.15s;
|
|
213
267
|
}
|
|
268
|
+
#sourcey #toc ul ul .toc-item {
|
|
269
|
+
margin-left: 0.75rem;
|
|
270
|
+
}
|
|
214
271
|
.dark #sourcey #toc .toc-item {
|
|
215
272
|
border-left-color: rgb(var(--color-gray-700));
|
|
216
273
|
}
|
|
217
274
|
#sourcey #toc .toc-item.active {
|
|
218
|
-
color: rgb(var(--color-primary));
|
|
219
|
-
border-left-color: rgb(var(--color-primary));
|
|
275
|
+
color: rgb(var(--color-primary-ink));
|
|
276
|
+
border-left-color: rgb(var(--color-primary-ink));
|
|
220
277
|
}
|
|
221
278
|
.dark #sourcey #toc .toc-item.active {
|
|
222
279
|
color: rgb(var(--color-primary-light));
|
|
@@ -260,7 +317,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
260
317
|
}
|
|
261
318
|
|
|
262
319
|
#sourcey .response-tab.active {
|
|
263
|
-
color: rgb(var(--color-primary));
|
|
320
|
+
color: rgb(var(--color-primary-ink));
|
|
264
321
|
}
|
|
265
322
|
.dark #sourcey .response-tab.active {
|
|
266
323
|
color: rgb(var(--color-primary-light));
|
|
@@ -461,7 +518,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
461
518
|
font-family: var(--font-mono);
|
|
462
519
|
font-size: 0.875rem;
|
|
463
520
|
font-weight: 600;
|
|
464
|
-
color: rgb(var(--color-primary));
|
|
521
|
+
color: rgb(var(--color-primary-ink));
|
|
465
522
|
background: transparent;
|
|
466
523
|
border: none;
|
|
467
524
|
padding: 0;
|
|
@@ -509,7 +566,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
509
566
|
|
|
510
567
|
#sourcey .steps {
|
|
511
568
|
margin-left: 0.875rem;
|
|
512
|
-
margin-top:
|
|
569
|
+
margin-top: 1rem;
|
|
513
570
|
margin-bottom: 1.5rem;
|
|
514
571
|
}
|
|
515
572
|
|
|
@@ -743,16 +800,17 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
743
800
|
|
|
744
801
|
#sourcey .callout {
|
|
745
802
|
margin: 1.25rem 0;
|
|
746
|
-
border
|
|
747
|
-
border: 1px solid
|
|
748
|
-
border-
|
|
803
|
+
border: none;
|
|
804
|
+
border-left: 1px solid;
|
|
805
|
+
border-radius: 0;
|
|
749
806
|
padding: 0.875rem 1rem;
|
|
750
807
|
font-size: 0.875rem;
|
|
751
808
|
line-height: 1.6;
|
|
752
809
|
color: rgb(var(--color-gray-700));
|
|
810
|
+
border-left-color: rgb(var(--color-gray-300));
|
|
753
811
|
}
|
|
754
812
|
.dark #sourcey .callout {
|
|
755
|
-
border-color: rgb(var(--color-gray-
|
|
813
|
+
border-left-color: rgb(var(--color-gray-700));
|
|
756
814
|
color: rgb(var(--color-gray-400));
|
|
757
815
|
}
|
|
758
816
|
|
|
@@ -781,50 +839,26 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
781
839
|
}
|
|
782
840
|
|
|
783
841
|
/* Note — blue */
|
|
784
|
-
#sourcey .callout-note {
|
|
785
|
-
|
|
786
|
-
background: rgb(59 130 246 / 0.04);
|
|
787
|
-
}
|
|
788
|
-
.dark #sourcey .callout-note {
|
|
789
|
-
border-left-color: #60a5fa;
|
|
790
|
-
background: rgb(59 130 246 / 0.06);
|
|
791
|
-
}
|
|
842
|
+
#sourcey .callout-note { border-left-color: #3b82f6; }
|
|
843
|
+
.dark #sourcey .callout-note { border-left-color: #60a5fa; }
|
|
792
844
|
#sourcey .callout-note .callout-title { color: #3b82f6; }
|
|
793
845
|
.dark #sourcey .callout-note .callout-title { color: #60a5fa; }
|
|
794
846
|
|
|
795
847
|
/* Warning — amber */
|
|
796
|
-
#sourcey .callout-warning {
|
|
797
|
-
|
|
798
|
-
background: rgb(245 158 11 / 0.04);
|
|
799
|
-
}
|
|
800
|
-
.dark #sourcey .callout-warning {
|
|
801
|
-
border-left-color: #fbbf24;
|
|
802
|
-
background: rgb(245 158 11 / 0.06);
|
|
803
|
-
}
|
|
848
|
+
#sourcey .callout-warning { border-left-color: #f59e0b; }
|
|
849
|
+
.dark #sourcey .callout-warning { border-left-color: #fbbf24; }
|
|
804
850
|
#sourcey .callout-warning .callout-title { color: #f59e0b; }
|
|
805
851
|
.dark #sourcey .callout-warning .callout-title { color: #fbbf24; }
|
|
806
852
|
|
|
807
853
|
/* Tip — green */
|
|
808
|
-
#sourcey .callout-tip {
|
|
809
|
-
|
|
810
|
-
background: rgb(34 197 94 / 0.04);
|
|
811
|
-
}
|
|
812
|
-
.dark #sourcey .callout-tip {
|
|
813
|
-
border-left-color: #4ade80;
|
|
814
|
-
background: rgb(34 197 94 / 0.06);
|
|
815
|
-
}
|
|
854
|
+
#sourcey .callout-tip { border-left-color: #22c55e; }
|
|
855
|
+
.dark #sourcey .callout-tip { border-left-color: #4ade80; }
|
|
816
856
|
#sourcey .callout-tip .callout-title { color: #22c55e; }
|
|
817
857
|
.dark #sourcey .callout-tip .callout-title { color: #4ade80; }
|
|
818
858
|
|
|
819
859
|
/* Info — violet */
|
|
820
|
-
#sourcey .callout-info {
|
|
821
|
-
|
|
822
|
-
background: rgb(139 92 246 / 0.04);
|
|
823
|
-
}
|
|
824
|
-
.dark #sourcey .callout-info {
|
|
825
|
-
border-left-color: #a78bfa;
|
|
826
|
-
background: rgb(139 92 246 / 0.06);
|
|
827
|
-
}
|
|
860
|
+
#sourcey .callout-info { border-left-color: #8b5cf6; }
|
|
861
|
+
.dark #sourcey .callout-info { border-left-color: #a78bfa; }
|
|
828
862
|
#sourcey .callout-info .callout-title { color: #8b5cf6; }
|
|
829
863
|
.dark #sourcey .callout-info .callout-title { color: #a78bfa; }
|
|
830
864
|
|
|
@@ -871,7 +905,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
871
905
|
}
|
|
872
906
|
|
|
873
907
|
#sourcey .directive-tab.active {
|
|
874
|
-
color: rgb(var(--color-primary));
|
|
908
|
+
color: rgb(var(--color-primary-ink));
|
|
875
909
|
}
|
|
876
910
|
.dark #sourcey .directive-tab.active {
|
|
877
911
|
color: rgb(var(--color-primary-light));
|
|
@@ -1047,7 +1081,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
1047
1081
|
background: rgb(var(--color-gray-800));
|
|
1048
1082
|
}
|
|
1049
1083
|
.drawer-dropdown-item.active {
|
|
1050
|
-
color: rgb(var(--color-primary));
|
|
1084
|
+
color: rgb(var(--color-primary-ink));
|
|
1051
1085
|
font-weight: 500;
|
|
1052
1086
|
}
|
|
1053
1087
|
.dark .drawer-dropdown-item.active {
|
|
@@ -1108,30 +1142,25 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
1108
1142
|
position: fixed;
|
|
1109
1143
|
inset: 0;
|
|
1110
1144
|
z-index: 500;
|
|
1111
|
-
background:
|
|
1112
|
-
backdrop-filter: blur(4px);
|
|
1113
|
-
-webkit-backdrop-filter: blur(4px);
|
|
1114
|
-
align-items: flex-start;
|
|
1115
|
-
justify-content: center;
|
|
1116
|
-
padding-top: 15vh;
|
|
1145
|
+
background: transparent;
|
|
1117
1146
|
}
|
|
1118
1147
|
|
|
1119
1148
|
#sourcey #search-dialog.open {
|
|
1120
|
-
display:
|
|
1149
|
+
display: block;
|
|
1121
1150
|
}
|
|
1122
1151
|
|
|
1123
1152
|
#sourcey .search-dialog-inner {
|
|
1124
|
-
|
|
1125
|
-
max-width: 540px;
|
|
1153
|
+
position: absolute;
|
|
1126
1154
|
background: rgb(var(--color-background-light));
|
|
1127
1155
|
border-radius: var(--radius);
|
|
1128
|
-
|
|
1156
|
+
border: 1px solid rgb(var(--color-gray-200) / 0.7);
|
|
1157
|
+
box-shadow: 0 8px 32px rgb(var(--color-overlay) / 0.12);
|
|
1129
1158
|
overflow: hidden;
|
|
1130
|
-
margin: 0 1rem;
|
|
1131
1159
|
}
|
|
1132
1160
|
.dark #sourcey .search-dialog-inner {
|
|
1133
1161
|
background: rgb(var(--color-gray-900));
|
|
1134
|
-
|
|
1162
|
+
border-color: rgb(var(--color-gray-700) / 0.5);
|
|
1163
|
+
box-shadow: 0 8px 32px rgb(var(--color-overlay) / 0.4);
|
|
1135
1164
|
}
|
|
1136
1165
|
|
|
1137
1166
|
#sourcey .search-input-row {
|
|
@@ -1201,7 +1230,8 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
1201
1230
|
gap: 0.25rem;
|
|
1202
1231
|
}
|
|
1203
1232
|
|
|
1204
|
-
#sourcey .search-footer kbd
|
|
1233
|
+
#sourcey .search-footer kbd,
|
|
1234
|
+
#sourcey #search-open kbd {
|
|
1205
1235
|
display: inline-flex;
|
|
1206
1236
|
align-items: center;
|
|
1207
1237
|
justify-content: center;
|
|
@@ -1216,7 +1246,8 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
1216
1246
|
background: rgb(var(--color-gray-50));
|
|
1217
1247
|
color: rgb(var(--color-gray-500));
|
|
1218
1248
|
}
|
|
1219
|
-
.dark #sourcey .search-footer kbd
|
|
1249
|
+
.dark #sourcey .search-footer kbd,
|
|
1250
|
+
.dark #sourcey #search-open kbd {
|
|
1220
1251
|
border-color: rgb(var(--color-gray-700));
|
|
1221
1252
|
background: rgb(var(--color-gray-800));
|
|
1222
1253
|
color: rgb(var(--color-gray-400));
|
|
@@ -1277,6 +1308,9 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
1277
1308
|
#sourcey .search-result-method.method-put { background: var(--method-put); }
|
|
1278
1309
|
#sourcey .search-result-method.method-delete { background: var(--method-delete); }
|
|
1279
1310
|
#sourcey .search-result-method.method-patch { background: var(--method-patch); }
|
|
1311
|
+
#sourcey .search-result-method.method-tool { background: var(--method-tool); }
|
|
1312
|
+
#sourcey .search-result-method.method-resource { background: var(--method-resource); }
|
|
1313
|
+
#sourcey .search-result-method.method-prompt { background: var(--method-prompt); }
|
|
1280
1314
|
|
|
1281
1315
|
#sourcey .search-result-path {
|
|
1282
1316
|
font-family: var(--font-mono);
|
package/dist/utils/icons.d.ts
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* Each value is the inner path content (no wrapping <svg>).
|
|
7
7
|
* Render with: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">${path}</svg>`
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Return raw inner SVG content for a named icon, or undefined.
|
|
11
|
+
*/
|
|
12
|
+
export declare function iconPath(name: string): string | undefined;
|
|
9
13
|
/**
|
|
10
14
|
* Render a Heroicon as an inline SVG string.
|
|
11
15
|
* Returns empty string if the icon name is not found.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/utils/icons.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgFH;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C"}
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/utils/icons.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgFH;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEzD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C"}
|
package/dist/utils/icons.js
CHANGED
|
@@ -46,6 +46,12 @@ const icons = {
|
|
|
46
46
|
info: '<path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"/>',
|
|
47
47
|
warning: '<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"/>',
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Return raw inner SVG content for a named icon, or undefined.
|
|
51
|
+
*/
|
|
52
|
+
export function iconPath(name) {
|
|
53
|
+
return icons[name];
|
|
54
|
+
}
|
|
49
55
|
/**
|
|
50
56
|
* Render a Heroicon as an inline SVG string.
|
|
51
57
|
* Returns empty string if the icon name is not found.
|
package/dist/utils/markdown.d.ts
CHANGED
|
@@ -14,6 +14,16 @@ export interface PageHeading {
|
|
|
14
14
|
* No rendering needed; pure token walk.
|
|
15
15
|
*/
|
|
16
16
|
export declare function extractHeadings(input: string): PageHeading[];
|
|
17
|
+
/**
|
|
18
|
+
* Extract the first paragraph token from markdown.
|
|
19
|
+
* Useful for generated docs where a summary paragraph is embedded in the body.
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractFirstParagraph(input?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Replace markdown links with their visible labels.
|
|
24
|
+
* Useful when rendering inside an existing clickable container.
|
|
25
|
+
*/
|
|
26
|
+
export declare function stripMarkdownLinks(input?: string): string;
|
|
17
27
|
/**
|
|
18
28
|
* Render Markdown to HTML.
|
|
19
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/utils/markdown.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CASnE;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/utils/markdown.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CASnE;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAgJD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,CAe5D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAY5D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3D"}
|