@blaaiz/docs-core 0.7.1 → 0.7.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/{chunk-II3RGD6Q.js → chunk-KIE7J526.js} +12 -4
- package/dist/chunk-KIE7J526.js.map +1 -0
- package/dist/generator.js +1 -1
- package/dist/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/ui.cjs +5 -1
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.js +5 -1
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
- package/styles/ask-ai.css +4 -1
- package/styles/docs.css +16 -3
- package/dist/chunk-II3RGD6Q.js.map +0 -1
package/dist/generator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseNavigation, planDocsTree, mergeOpenApiDocuments, hasOpenApi } from './chunk-
|
|
1
|
+
import { parseNavigation, planDocsTree, mergeOpenApiDocuments, hasOpenApi } from './chunk-KIE7J526.js';
|
|
2
2
|
import { readFile, rm, mkdir, writeFile } from 'fs/promises';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
|
package/dist/index.cjs
CHANGED
|
@@ -2192,12 +2192,20 @@ function isGeneratedApiPage(frontmatter) {
|
|
|
2192
2192
|
return /^_openapi\s*:/m.test(frontmatter);
|
|
2193
2193
|
}
|
|
2194
2194
|
function cleanBody(body) {
|
|
2195
|
-
const segments = body.split(/(```[\s\S]
|
|
2195
|
+
const segments = body.split(/(```[\s\S]*?```|`[^`\n]+`)/g);
|
|
2196
2196
|
const cleaned = segments.map(
|
|
2197
|
-
(segment) => segment.startsWith("
|
|
2197
|
+
(segment) => segment.startsWith("`") ? segment : segment.replace(/^\s*(import|export)\s.*$/gm, "").replace(/\{\/\*[\s\S]*?\*\/\}/g, "").replace(/<[A-Za-z][^>]*>/g, keepTagTitle).replace(/<\/[A-Za-z][^>]*>/g, "")
|
|
2198
2198
|
);
|
|
2199
2199
|
return cleaned.join("").replace(/\n{3,}/g, "\n\n").trim();
|
|
2200
2200
|
}
|
|
2201
|
+
function keepTagTitle(tag) {
|
|
2202
|
+
const title = /\btitle="([^"]*)"/.exec(tag)?.[1];
|
|
2203
|
+
if (title === void 0 || title === "") {
|
|
2204
|
+
return "";
|
|
2205
|
+
}
|
|
2206
|
+
const href = /\bhref="([^"]*)"/.exec(tag)?.[1];
|
|
2207
|
+
return href === void 0 ? `**${title}**` : `[${title}](${href})`;
|
|
2208
|
+
}
|
|
2201
2209
|
function summariseApiPage(title, description, body, documents) {
|
|
2202
2210
|
const opMatch = /operations=\{(\[[\s\S]*?\])\}/.exec(body);
|
|
2203
2211
|
let ops = [];
|