@forsakringskassan/docs-generator 2.42.0 → 3.0.0
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/{create-markdown-renderer-DX0B9T-x.mjs → create-markdown-renderer-CoqQjBrC.mjs} +40 -32
- package/dist/create-markdown-renderer-CoqQjBrC.mjs.map +1 -0
- package/dist/{format-code.worker-E71lNJrD.mjs → format-code.worker-CE6SMet0.mjs} +2 -2
- package/dist/{format-code.worker-E71lNJrD.mjs.map → format-code.worker-CE6SMet0.mjs.map} +1 -1
- package/dist/index.d.mts +36 -2
- package/dist/index.mjs +305 -22
- package/dist/index.mjs.map +1 -1
- package/dist/markdown.d.mts +19 -2
- package/dist/markdown.mjs +3 -3
- package/dist/processors/selectable-version.mjs +43 -0
- package/dist/runtime.mjs +30590 -24196
- package/dist/style/core.css +20 -0
- package/dist/style/index.css +20 -0
- package/dist/{vendor-BoRn-ubH.mjs → vendor-B7bJ2okl.mjs} +7989 -7969
- package/dist/{vendor-BoRn-ubH.mjs.map → vendor-B7bJ2okl.mjs.map} +1 -1
- package/dist/{vue3-fRI2JWNs.mjs → vue3-RC792pPN.mjs} +59 -59
- package/dist/{vue3-fRI2JWNs.mjs.map → vue3-RC792pPN.mjs.map} +1 -1
- package/dist/{worker-DEFReXeu.mjs → worker-CpM7V-Ue.mjs} +2 -2
- package/dist/{worker-DEFReXeu.mjs.map → worker-CpM7V-Ue.mjs.map} +1 -1
- package/package.json +4 -2
- package/dist/create-markdown-renderer-DX0B9T-x.mjs.map +0 -1
package/dist/{create-markdown-renderer-DX0B9T-x.mjs → create-markdown-renderer-CoqQjBrC.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { createRequire as $createRequire } from "node:module";
|
|
|
2
2
|
|
|
3
3
|
const require = $createRequire(import.meta.url);
|
|
4
4
|
|
|
5
|
-
import { c as createSyncFn, d as dedent, H as HighlightJS, b as createTwoFilesPatch, M as MarkdownIt, e as deflist_plugin } from './vendor-
|
|
5
|
+
import { c as createSyncFn, d as dedent, H as HighlightJS, b as createTwoFilesPatch, M as MarkdownIt, e as deflist_plugin } from './vendor-B7bJ2okl.mjs';
|
|
6
6
|
import path from 'node:path/posix';
|
|
7
7
|
import path__default from 'node:path';
|
|
8
8
|
import crypto from 'node:crypto';
|
|
@@ -10,26 +10,21 @@ import 'node:child_process';
|
|
|
10
10
|
import { fileURLToPath } from 'node:url';
|
|
11
11
|
import fs__default from 'node:fs';
|
|
12
12
|
import { version } from 'vue';
|
|
13
|
-
import { g as generateCode } from './vue3-
|
|
14
|
-
|
|
15
|
-
function isDocumentPage(doc) {
|
|
16
|
-
return doc.kind === "page";
|
|
17
|
-
}
|
|
13
|
+
import { g as generateCode } from './vue3-RC792pPN.mjs';
|
|
18
14
|
|
|
19
15
|
function findDocument(haystack, needle) {
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
16
|
+
for (const document of haystack) {
|
|
17
|
+
if (document.id === needle) {
|
|
18
|
+
return { document, kind: "id", reference: needle };
|
|
23
19
|
}
|
|
24
|
-
if (
|
|
25
|
-
return
|
|
20
|
+
if (document.name === needle) {
|
|
21
|
+
return { document, kind: "name", reference: needle };
|
|
26
22
|
}
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
23
|
+
if (document.alias.includes(needle)) {
|
|
24
|
+
return { document, kind: "alias", reference: needle };
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
return match ?? null;
|
|
26
|
+
}
|
|
27
|
+
return { document: null, kind: null, reference: null };
|
|
33
28
|
}
|
|
34
29
|
|
|
35
30
|
function findTag(tags, tag) {
|
|
@@ -89,10 +84,10 @@ function getOutputFilePath(outputFolder, fileInfo) {
|
|
|
89
84
|
return normalizePath(outputFolder, path, outputName);
|
|
90
85
|
}
|
|
91
86
|
|
|
92
|
-
const url$1 = new URL("./format-code.worker-
|
|
87
|
+
const url$1 = new URL("./format-code.worker-CE6SMet0.mjs", import.meta.url);
|
|
93
88
|
const filePath$1 = fileURLToPath(url$1);
|
|
94
89
|
|
|
95
|
-
createSyncFn(filePath$1);
|
|
90
|
+
const formatCode = createSyncFn(filePath$1);
|
|
96
91
|
|
|
97
92
|
function hasTag(tags, tag) {
|
|
98
93
|
const match = tags.find((it) => it === tag || it.startsWith(`${tag}=`));
|
|
@@ -132,6 +127,14 @@ function parseImport(raw) {
|
|
|
132
127
|
};
|
|
133
128
|
}
|
|
134
129
|
|
|
130
|
+
function getDocumentBody(document, tags, reference) {
|
|
131
|
+
return typeof document.body === "string" ? document.body : document.body(tags, reference);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function isDocumentPage(doc) {
|
|
135
|
+
return doc.kind === "page";
|
|
136
|
+
}
|
|
137
|
+
|
|
135
138
|
function getExampleName(filename) {
|
|
136
139
|
return path__default.parse(filename).name;
|
|
137
140
|
}
|
|
@@ -367,7 +370,7 @@ function transformCode(code, lang) {
|
|
|
367
370
|
return code;
|
|
368
371
|
}
|
|
369
372
|
|
|
370
|
-
const url = new URL("./worker-
|
|
373
|
+
const url = new URL("./worker-CpM7V-Ue.mjs", import.meta.url);
|
|
371
374
|
const filePath = fileURLToPath(url);
|
|
372
375
|
|
|
373
376
|
class SoftError extends Error {
|
|
@@ -430,7 +433,7 @@ const linkTag = {
|
|
|
430
433
|
if (key.startsWith("http://") || key.startsWith("https://")) {
|
|
431
434
|
return `<a href="${key}${hash ?? ""}">${explicitTitle ?? key}</a>`;
|
|
432
435
|
}
|
|
433
|
-
const linked = findDocument(docs, key);
|
|
436
|
+
const { document: linked } = findDocument(docs, key);
|
|
434
437
|
if (!linked) {
|
|
435
438
|
throw new SoftError(
|
|
436
439
|
"ELINKTARGET",
|
|
@@ -839,9 +842,13 @@ function altContainer(context) {
|
|
|
839
842
|
const token = tokens[index];
|
|
840
843
|
const needle = token.info;
|
|
841
844
|
const tags = token.info.trim().split(/\s+/);
|
|
842
|
-
const
|
|
843
|
-
if (
|
|
844
|
-
|
|
845
|
+
const result = findDocument(docs, needle);
|
|
846
|
+
if (!result.document) {
|
|
847
|
+
return md.render(token.content, env);
|
|
848
|
+
}
|
|
849
|
+
const { document, kind, reference } = result;
|
|
850
|
+
if (result.document.format === "markdown") {
|
|
851
|
+
const body = getDocumentBody(document, tags, { kind, reference });
|
|
845
852
|
return md.render(body, env);
|
|
846
853
|
}
|
|
847
854
|
return md.render(token.content, env);
|
|
@@ -854,8 +861,8 @@ function apiContainer(context) {
|
|
|
854
861
|
const token = tokens[index];
|
|
855
862
|
const needle = token.content.trim();
|
|
856
863
|
const tags = token.info.trim().split(/\s+/);
|
|
857
|
-
const
|
|
858
|
-
if (!
|
|
864
|
+
const result = findDocument(docs, needle);
|
|
865
|
+
if (!result.document) {
|
|
859
866
|
return handleSoftError(
|
|
860
867
|
new SoftError(
|
|
861
868
|
"EINCLUDETARGET",
|
|
@@ -864,19 +871,20 @@ function apiContainer(context) {
|
|
|
864
871
|
)
|
|
865
872
|
);
|
|
866
873
|
}
|
|
867
|
-
const
|
|
868
|
-
const
|
|
874
|
+
const { document, kind, reference } = result;
|
|
875
|
+
const key = [document.id, ...tags].join("|");
|
|
876
|
+
const loop = included.get(document.id);
|
|
869
877
|
if (loop && loop !== context.doc.id) {
|
|
870
878
|
return handleSoftError(
|
|
871
879
|
new SoftError(
|
|
872
880
|
"EINCLUDERECURSION",
|
|
873
|
-
`Recursion detected when including document "${
|
|
881
|
+
`Recursion detected when including document "${document.id}"`
|
|
874
882
|
)
|
|
875
883
|
);
|
|
876
884
|
}
|
|
877
885
|
included.set(key, context.doc.id);
|
|
878
|
-
const body =
|
|
879
|
-
if (
|
|
886
|
+
const body = getDocumentBody(document, tags, { kind, reference });
|
|
887
|
+
if (document.format === "html") {
|
|
880
888
|
const { currentHeading } = env;
|
|
881
889
|
const nextHeadingLevel = currentHeading + 1;
|
|
882
890
|
return body.replaceAll(
|
|
@@ -1215,5 +1223,5 @@ function createMarkdownRenderer(options) {
|
|
|
1215
1223
|
};
|
|
1216
1224
|
}
|
|
1217
1225
|
|
|
1218
|
-
export { SoftError as S, getFingerprint as a,
|
|
1219
|
-
//# sourceMappingURL=create-markdown-renderer-
|
|
1226
|
+
export { SoftError as S, getFingerprint as a, findTag as b, createMarkdownRenderer as c, getOutputFilePath as d, htmlencode as e, formatCode as f, generateId as g, hasTag as h, isDocumentPage as i, filePath as j, generateExample as k, normalizePath as n, parseInfostring as p };
|
|
1227
|
+
//# sourceMappingURL=create-markdown-renderer-CoqQjBrC.mjs.map
|