@forsakringskassan/docs-generator 2.26.4 → 2.27.1
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/README.md +5 -5
- package/dist/{create-markdown-renderer-DRsx8BA_.js → create-markdown-renderer-B9Y9VYNq.mjs} +27 -33
- package/dist/create-markdown-renderer-B9Y9VYNq.mjs.map +1 -0
- package/dist/{index.d.ts → index.d.mts} +8 -0
- package/dist/{index.js → index.mjs} +195 -182
- package/dist/index.mjs.map +1 -0
- package/dist/markdown.mjs +41 -0
- package/dist/markdown.mjs.map +1 -0
- package/dist/processors/{motd.js → motd.mjs} +0 -2
- package/dist/processors/{selectable-version.js → selectable-version.mjs} +91 -92
- package/dist/{runtime-bootstrap.js → runtime-bootstrap.mjs} +0 -2
- package/dist/{runtime.js → runtime.mjs} +4 -10
- package/dist/style/core.css +1 -0
- package/dist/style/index.css +1 -0
- package/dist/tsconfig-path-bG7G_cK8.mjs +11 -0
- package/dist/tsconfig-path-bG7G_cK8.mjs.map +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/{vendor-DKOm4V-g.js → vendor-DiqWVUfS.mjs} +164 -551
- package/dist/vendor-DiqWVUfS.mjs.map +1 -0
- package/dist/{vue3-D18_q-Ol.js → vue3-BzNzaBbK.mjs} +12 -11
- package/dist/vue3-BzNzaBbK.mjs.map +1 -0
- package/dist/worker-BnI39lrZ.mjs +150 -0
- package/dist/worker-BnI39lrZ.mjs.map +1 -0
- package/package.json +18 -8
- package/dist/compile-example.js +0 -152
- package/dist/compile-example.js.map +0 -1
- package/dist/create-markdown-renderer-DRsx8BA_.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown.js +0 -47
- package/dist/markdown.js.map +0 -1
- package/dist/vendor-DKOm4V-g.js.map +0 -1
- package/dist/vue3-D18_q-Ol.js.map +0 -1
- /package/dist/{markdown.d.ts → markdown.d.mts} +0 -0
- /package/dist/{runtime.d.ts → runtime.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
livereloadProcessor,
|
|
17
17
|
} from "@forsakringskassan/docs-generator";
|
|
18
18
|
|
|
19
|
-
const docs = new Generator({
|
|
19
|
+
const docs = new Generator(import.meta.url, {
|
|
20
20
|
site: {
|
|
21
21
|
name: "My Awesome Site",
|
|
22
22
|
},
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
livereloadProcessor,
|
|
42
42
|
} from "@forsakringskassan/docs-generator";
|
|
43
43
|
|
|
44
|
-
const docs = new Generator({
|
|
44
|
+
const docs = new Generator(import.meta.url, {
|
|
45
45
|
site: {
|
|
46
46
|
name: "My Awesome Site",
|
|
47
47
|
},
|
|
@@ -117,7 +117,7 @@ Style can be compiled with `compileStyle(name, src, [options])`:
|
|
|
117
117
|
```ts
|
|
118
118
|
import { Generator } from "@forsakringskassan/docs-generator";
|
|
119
119
|
|
|
120
|
-
const docs = new Generator({
|
|
120
|
+
const docs = new Generator(import.meta.url, {
|
|
121
121
|
site: {
|
|
122
122
|
name: "My Awesome Site",
|
|
123
123
|
},
|
|
@@ -304,7 +304,7 @@ for (const entry of Object.values(icons)) {
|
|
|
304
304
|
### Matomo
|
|
305
305
|
|
|
306
306
|
```diff
|
|
307
|
-
const docs = new Generator({
|
|
307
|
+
const docs = new Generator(import.meta.url, {
|
|
308
308
|
processors: [
|
|
309
309
|
+ matomoProcessor({
|
|
310
310
|
+ siteId: "1",
|
|
@@ -318,7 +318,7 @@ for (const entry of Object.values(icons)) {
|
|
|
318
318
|
Optionally set `hostname` to limit which hostnames can run Matomo analytics:
|
|
319
319
|
|
|
320
320
|
```diff
|
|
321
|
-
const docs = new Generator({
|
|
321
|
+
const docs = new Generator(import.meta.url, {
|
|
322
322
|
processors: [
|
|
323
323
|
matomoProcessor({
|
|
324
324
|
siteId: "1",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRequire as $createRequire } from "node:module";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
const require = $createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
import { d as dedent, H as HighlightJS, c as createTwoFilesPatch, M as MarkdownIt, a as deflist_plugin } from './vendor-DiqWVUfS.mjs';
|
|
6
|
+
import path from 'node:path/posix';
|
|
7
|
+
import path$1 from 'node:path';
|
|
8
|
+
import 'crypto';
|
|
9
|
+
import crypto from 'node:crypto';
|
|
10
|
+
import 'node:child_process';
|
|
11
|
+
import fs__default from 'node:fs';
|
|
12
|
+
import { version } from 'vue';
|
|
13
|
+
import { g as generateCode } from './vue3-BzNzaBbK.mjs';
|
|
12
14
|
|
|
13
15
|
function isDocumentPage(doc) {
|
|
14
16
|
return doc.kind === "page";
|
|
@@ -73,7 +75,7 @@ function getFingerprint(source) {
|
|
|
73
75
|
|
|
74
76
|
function normalizePath(...pathSegments) {
|
|
75
77
|
const filePath = path.join(...pathSegments);
|
|
76
|
-
return path.normalize(filePath).replace(/\\/g, "/");
|
|
78
|
+
return path.normalize(filePath).replace(/^([A-Z]):\\/, "/").replace(/\\/g, "/");
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
function getOutputFilePath(outputFolder, fileInfo) {
|
|
@@ -126,7 +128,7 @@ function getExampleName(filename) {
|
|
|
126
128
|
return path$1.parse(filename).name;
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
const vueMajor = parseInt(
|
|
131
|
+
const vueMajor = parseInt(version.split(".", 2)[0], 10);
|
|
130
132
|
function vueGenerator() {
|
|
131
133
|
switch (vueMajor) {
|
|
132
134
|
case 2:
|
|
@@ -134,7 +136,7 @@ function vueGenerator() {
|
|
|
134
136
|
"Vue 2 is no longer supported, upgrade to Vue 3 or downgrade docs-generator"
|
|
135
137
|
);
|
|
136
138
|
case 3:
|
|
137
|
-
return
|
|
139
|
+
return generateCode;
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
function generateExample(options) {
|
|
@@ -144,7 +146,7 @@ function generateExample(options) {
|
|
|
144
146
|
const filename = fileMatcher(parsed.filename, "when importing example");
|
|
145
147
|
const language2 = parsed.extension;
|
|
146
148
|
const comments = parsed.comments;
|
|
147
|
-
const content =
|
|
149
|
+
const content = fs__default.readFileSync(filename, "utf-8");
|
|
148
150
|
const example = generateExample({
|
|
149
151
|
...options,
|
|
150
152
|
source: content,
|
|
@@ -317,7 +319,7 @@ function maybeDedent(value) {
|
|
|
317
319
|
return value;
|
|
318
320
|
}
|
|
319
321
|
if (/^\s/.test(value)) {
|
|
320
|
-
return
|
|
322
|
+
return dedent(value);
|
|
321
323
|
} else {
|
|
322
324
|
return value;
|
|
323
325
|
}
|
|
@@ -337,6 +339,8 @@ function transformCode(code, lang) {
|
|
|
337
339
|
return code;
|
|
338
340
|
}
|
|
339
341
|
|
|
342
|
+
var exampleWorkerUrl = new URL("./worker-BnI39lrZ.mjs", import.meta.url);
|
|
343
|
+
|
|
340
344
|
class SoftError extends Error {
|
|
341
345
|
code;
|
|
342
346
|
details;
|
|
@@ -464,6 +468,7 @@ const optionalTag = {
|
|
|
464
468
|
};
|
|
465
469
|
|
|
466
470
|
const inlineTags = [linkTag, optionalTag];
|
|
471
|
+
var inline_tags_default = inlineTags;
|
|
467
472
|
|
|
468
473
|
function findTestId(tags) {
|
|
469
474
|
const prefix = "test-id=";
|
|
@@ -510,7 +515,7 @@ function highlight({
|
|
|
510
515
|
return highlight({ source, language: "html" });
|
|
511
516
|
}
|
|
512
517
|
try {
|
|
513
|
-
const { value } =
|
|
518
|
+
const { value } = HighlightJS.highlight(source, { language });
|
|
514
519
|
return wrap(value, language);
|
|
515
520
|
} catch (err) {
|
|
516
521
|
return wrap(String(err), language);
|
|
@@ -570,7 +575,7 @@ function codePreview(options) {
|
|
|
570
575
|
transformCode(reference.content, reference.language)
|
|
571
576
|
);
|
|
572
577
|
const b = ensureTrailingNewline(transformCode(content, language));
|
|
573
|
-
const diff =
|
|
578
|
+
const diff = createTwoFilesPatch("a", "b", a, b, "", "", {
|
|
574
579
|
context: context ? parseInt(context, 10) : 3,
|
|
575
580
|
ignoreWhitespace: true
|
|
576
581
|
}).split("\n").slice(4).join("\n");
|
|
@@ -1103,10 +1108,10 @@ function createMarkdownRenderer(options) {
|
|
|
1103
1108
|
return currentDoc;
|
|
1104
1109
|
};
|
|
1105
1110
|
const included = /* @__PURE__ */ new Map();
|
|
1106
|
-
const md =
|
|
1111
|
+
const md = MarkdownIt({
|
|
1107
1112
|
html: true
|
|
1108
1113
|
});
|
|
1109
|
-
md.use(
|
|
1114
|
+
md.use(deflist_plugin);
|
|
1110
1115
|
md.use(
|
|
1111
1116
|
codePreview({
|
|
1112
1117
|
generateExample: options.generateExample,
|
|
@@ -1143,7 +1148,7 @@ function createMarkdownRenderer(options) {
|
|
|
1143
1148
|
env.ids = /* @__PURE__ */ new Set();
|
|
1144
1149
|
const html = md.render(content, env);
|
|
1145
1150
|
return processInlineTags(
|
|
1146
|
-
|
|
1151
|
+
inline_tags_default,
|
|
1147
1152
|
doc,
|
|
1148
1153
|
docs,
|
|
1149
1154
|
html,
|
|
@@ -1153,16 +1158,5 @@ function createMarkdownRenderer(options) {
|
|
|
1153
1158
|
};
|
|
1154
1159
|
}
|
|
1155
1160
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
exports.findTag = findTag;
|
|
1159
|
-
exports.generateExample = generateExample;
|
|
1160
|
-
exports.generateId = generateId;
|
|
1161
|
-
exports.getFingerprint = getFingerprint;
|
|
1162
|
-
exports.getOutputFilePath = getOutputFilePath;
|
|
1163
|
-
exports.hasTag = hasTag;
|
|
1164
|
-
exports.htmlencode = htmlencode;
|
|
1165
|
-
exports.isDocumentPage = isDocumentPage;
|
|
1166
|
-
exports.normalizePath = normalizePath;
|
|
1167
|
-
exports.parseInfostring = parseInfostring;
|
|
1168
|
-
//# sourceMappingURL=create-markdown-renderer-DRsx8BA_.js.map
|
|
1161
|
+
export { SoftError as S, getFingerprint as a, getOutputFilePath as b, createMarkdownRenderer as c, htmlencode as d, exampleWorkerUrl as e, findTag as f, generateId as g, hasTag as h, isDocumentPage as i, generateExample as j, normalizePath as n, parseInfostring as p };
|
|
1162
|
+
//# sourceMappingURL=create-markdown-renderer-B9Y9VYNq.mjs.map
|