@forsakringskassan/docs-generator 2.16.1 → 2.17.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/README.md +6 -7
- package/dist/{create-markdown-renderer-CuMSwaNA.js → create-markdown-renderer-Bj0NKzgi.js} +7 -1
- package/dist/index.js +201 -83
- package/dist/markdown.js +1 -1
- package/dist/style/core.css +49 -49
- package/dist/style/index.css +52 -49
- package/dist/style/site.css +3 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -150,13 +150,12 @@ See {@link MyAwesomeComponent} for details or the {@link getting-started getting
|
|
|
150
150
|
will be rendered as:
|
|
151
151
|
|
|
152
152
|
```html
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
>MyAwesomeComponent
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
>
|
|
153
|
+
<p>
|
|
154
|
+
See
|
|
155
|
+
<a href="./components/my-awesome-component.html">MyAwesomeComponent</a> for
|
|
156
|
+
details or the
|
|
157
|
+
<a href="../guides/getting-started.html">getting started guide</a>.
|
|
158
|
+
</p>
|
|
160
159
|
```
|
|
161
160
|
|
|
162
161
|
The ID can be either the document identifier, name or one of the aliases.
|
|
@@ -733,6 +733,7 @@ function headingLevel(options) {
|
|
|
733
733
|
ids.add(id);
|
|
734
734
|
return tag.replace(/h(\d)/, (_, n) => {
|
|
735
735
|
const level = parseInt(n, 10) + offset;
|
|
736
|
+
env.currentHeading = level;
|
|
736
737
|
return `<h${level} id="${id}"><a class="header-anchor" href="#${id}">`;
|
|
737
738
|
});
|
|
738
739
|
};
|
|
@@ -820,7 +821,11 @@ function apiContainer(context) {
|
|
|
820
821
|
}
|
|
821
822
|
included.add(doc.id);
|
|
822
823
|
if (doc.format === "html") {
|
|
823
|
-
return doc.body
|
|
824
|
+
return doc.body.replace(
|
|
825
|
+
/* replace `<next-heading-level>` and `</next-heading-level>` with actual h-tags */
|
|
826
|
+
/(?<=<\/?)next-heading-level/g,
|
|
827
|
+
`h${String(env.currentHeading + 1)}`
|
|
828
|
+
);
|
|
824
829
|
}
|
|
825
830
|
const content = md.render(doc.body, env);
|
|
826
831
|
return (
|
|
@@ -1035,6 +1040,7 @@ function createMarkdownRenderer(options) {
|
|
|
1035
1040
|
outputName: false
|
|
1036
1041
|
},
|
|
1037
1042
|
ids: /* @__PURE__ */ new Set(),
|
|
1043
|
+
currentHeading: 1,
|
|
1038
1044
|
namedExamples: /* @__PURE__ */ new Map()
|
|
1039
1045
|
};
|
|
1040
1046
|
const included = /* @__PURE__ */ new Set();
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var vendor = require('./vendor-BeoVq2Sv.js');
|
|
|
6
6
|
var path$1 = require('node:path');
|
|
7
7
|
var require$$1 = require('crypto');
|
|
8
8
|
require('node:crypto');
|
|
9
|
-
var createMarkdownRenderer = require('./create-markdown-renderer-
|
|
9
|
+
var createMarkdownRenderer = require('./create-markdown-renderer-Bj0NKzgi.js');
|
|
10
10
|
var node_child_process = require('node:child_process');
|
|
11
11
|
var util = require('node:util');
|
|
12
12
|
var codeFrame = require('@babel/code-frame');
|
|
@@ -266,8 +266,8 @@ function slugify(value) {
|
|
|
266
266
|
return value.toLowerCase().replace(/\//g, "--").replace(/[^a-z]+/g, "-").replace(/(^-+|-+$)/, "");
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
const md$
|
|
270
|
-
md$
|
|
269
|
+
const md$4 = vendor.MarkdownIt();
|
|
270
|
+
md$4.renderer.rules.fence = (tokens, idx, _options, collected) => {
|
|
271
271
|
const { content, info } = tokens[idx];
|
|
272
272
|
const { language, tags } = createMarkdownRenderer.parseInfostring(info);
|
|
273
273
|
if (language === "import") {
|
|
@@ -288,7 +288,7 @@ function findExamples$1(doc) {
|
|
|
288
288
|
return [];
|
|
289
289
|
}
|
|
290
290
|
const collected = [];
|
|
291
|
-
md$
|
|
291
|
+
md$4.render(doc.body, collected);
|
|
292
292
|
return collected;
|
|
293
293
|
}
|
|
294
294
|
function getSuffix(tags) {
|
|
@@ -354,8 +354,8 @@ function extractExamplesProcessor(options) {
|
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
-
const md$
|
|
358
|
-
md$
|
|
357
|
+
const md$3 = vendor.MarkdownIt();
|
|
358
|
+
md$3.renderer.rules.fence = (tokens, idx, _options, collected) => {
|
|
359
359
|
const { content, info, map } = tokens[idx];
|
|
360
360
|
const { language, tags } = createMarkdownRenderer.parseInfostring(info);
|
|
361
361
|
const hashContent = `${map?.[0]}:${map?.[1]}:${info}:${content}`;
|
|
@@ -389,7 +389,7 @@ function findExamples(doc) {
|
|
|
389
389
|
return [];
|
|
390
390
|
}
|
|
391
391
|
const collected = [];
|
|
392
|
-
md$
|
|
392
|
+
md$3.render(doc.body, collected);
|
|
393
393
|
return collected;
|
|
394
394
|
}
|
|
395
395
|
function manifestPageFromDocument(doc) {
|
|
@@ -1076,19 +1076,17 @@ async function frontMatterFileReader(filePath, basePath) {
|
|
|
1076
1076
|
return [doc];
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
|
-
const EMPTY_CHAR = "‐";
|
|
1080
|
-
const EM_DASH = "—";
|
|
1081
1079
|
function getPropSlotDeprecated(prop) {
|
|
1082
1080
|
const tags = prop.tags;
|
|
1083
1081
|
if (!tags) {
|
|
1084
|
-
return
|
|
1082
|
+
return null;
|
|
1085
1083
|
}
|
|
1086
1084
|
const tag = tags["deprecated"]?.[0];
|
|
1087
1085
|
if (!tag?.description) {
|
|
1088
|
-
return
|
|
1086
|
+
return null;
|
|
1089
1087
|
}
|
|
1090
1088
|
if (tag.description === true) {
|
|
1091
|
-
return "
|
|
1089
|
+
return "";
|
|
1092
1090
|
} else {
|
|
1093
1091
|
return tag.description;
|
|
1094
1092
|
}
|
|
@@ -1096,39 +1094,37 @@ function getPropSlotDeprecated(prop) {
|
|
|
1096
1094
|
function getEventDeprecated(event) {
|
|
1097
1095
|
const tags = event.tags;
|
|
1098
1096
|
if (!tags) {
|
|
1099
|
-
return
|
|
1097
|
+
return null;
|
|
1100
1098
|
}
|
|
1101
1099
|
const tag = tags.find((it) => it.title === "deprecated");
|
|
1102
1100
|
if (!tag?.content) {
|
|
1103
|
-
return
|
|
1101
|
+
return null;
|
|
1104
1102
|
}
|
|
1105
1103
|
if (tag.content === true) {
|
|
1106
|
-
return "
|
|
1104
|
+
return "";
|
|
1107
1105
|
} else {
|
|
1108
1106
|
return tag.content;
|
|
1109
1107
|
}
|
|
1110
1108
|
}
|
|
1111
1109
|
function translateProps(props) {
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1110
|
+
return props.map((prop) => {
|
|
1111
|
+
const defaultValue = prop.defaultValue ? { value: prop.defaultValue.value } : null;
|
|
1112
|
+
return {
|
|
1115
1113
|
name: prop.name,
|
|
1116
|
-
description: prop.description ??
|
|
1117
|
-
type: prop.type?.name ??
|
|
1118
|
-
required: prop.required
|
|
1119
|
-
default:
|
|
1114
|
+
description: prop.description ?? null,
|
|
1115
|
+
type: prop.type?.name ?? null,
|
|
1116
|
+
required: Boolean(prop.required),
|
|
1117
|
+
default: defaultValue,
|
|
1120
1118
|
deprecated: getPropSlotDeprecated(prop)
|
|
1121
1119
|
};
|
|
1122
|
-
|
|
1123
|
-
}
|
|
1124
|
-
return translatedProps;
|
|
1120
|
+
});
|
|
1125
1121
|
}
|
|
1126
1122
|
function translateEvents(events) {
|
|
1127
1123
|
const translatedEvents = [];
|
|
1128
1124
|
for (const event of events) {
|
|
1129
1125
|
const translatedEvent = {
|
|
1130
1126
|
name: event.name,
|
|
1131
|
-
description: event.description ??
|
|
1127
|
+
description: event.description ?? null,
|
|
1132
1128
|
properties: translateEventProperties(event),
|
|
1133
1129
|
deprecated: getEventDeprecated(event)
|
|
1134
1130
|
};
|
|
@@ -1140,10 +1136,12 @@ function translateEventProperties(event) {
|
|
|
1140
1136
|
const properties = event.properties;
|
|
1141
1137
|
const types = event.type ? Object.values(event.type.names) : [];
|
|
1142
1138
|
if (!properties && !types.length) {
|
|
1143
|
-
return
|
|
1139
|
+
return [];
|
|
1144
1140
|
}
|
|
1145
1141
|
if (!properties) {
|
|
1146
|
-
return
|
|
1142
|
+
return [
|
|
1143
|
+
{ name: "<anonymous>", type: String(types), description: null }
|
|
1144
|
+
];
|
|
1147
1145
|
}
|
|
1148
1146
|
const translatedProperties = [];
|
|
1149
1147
|
for (let i = 0; i < properties.length; i++) {
|
|
@@ -1151,19 +1149,22 @@ function translateEventProperties(event) {
|
|
|
1151
1149
|
const name = property.name ?? "<anonymous>";
|
|
1152
1150
|
const eventType = types[i];
|
|
1153
1151
|
const hasEventType = !eventType || eventType !== "undefined";
|
|
1154
|
-
const
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
|
|
1152
|
+
const type = hasEventType ? eventType : String(property.type.names);
|
|
1153
|
+
const description = typeof property.description === "string" ? property.description : null;
|
|
1154
|
+
translatedProperties.push({
|
|
1155
|
+
name,
|
|
1156
|
+
type,
|
|
1157
|
+
description
|
|
1158
|
+
});
|
|
1158
1159
|
}
|
|
1159
|
-
return translatedProperties
|
|
1160
|
+
return translatedProperties;
|
|
1160
1161
|
}
|
|
1161
1162
|
function translateSlots(slots) {
|
|
1162
1163
|
const translatedSlots = [];
|
|
1163
1164
|
for (const slot of slots) {
|
|
1164
1165
|
const translatedSlot = {
|
|
1165
1166
|
name: slot.name,
|
|
1166
|
-
description: slot.description ??
|
|
1167
|
+
description: slot.description ?? null,
|
|
1167
1168
|
bindings: translateSlotBindings(slot),
|
|
1168
1169
|
deprecated: getPropSlotDeprecated(slot)
|
|
1169
1170
|
};
|
|
@@ -1173,16 +1174,20 @@ function translateSlots(slots) {
|
|
|
1173
1174
|
}
|
|
1174
1175
|
function translateSlotBindings(slot) {
|
|
1175
1176
|
if (!slot.bindings) {
|
|
1176
|
-
return
|
|
1177
|
+
return [];
|
|
1177
1178
|
}
|
|
1178
1179
|
const translatedBindings = [];
|
|
1179
1180
|
for (const binding of slot.bindings) {
|
|
1180
|
-
const name = binding.name ??
|
|
1181
|
-
const type = binding.type
|
|
1182
|
-
const description = binding.description
|
|
1183
|
-
translatedBindings.push(
|
|
1181
|
+
const name = binding.name ?? "<anonymous>";
|
|
1182
|
+
const type = binding.type?.name ?? "unknown";
|
|
1183
|
+
const description = typeof binding.description === "string" ? binding.description : null;
|
|
1184
|
+
translatedBindings.push({
|
|
1185
|
+
name,
|
|
1186
|
+
type,
|
|
1187
|
+
description
|
|
1188
|
+
});
|
|
1184
1189
|
}
|
|
1185
|
-
return translatedBindings
|
|
1190
|
+
return translatedBindings;
|
|
1186
1191
|
}
|
|
1187
1192
|
async function translateAPI(filePath) {
|
|
1188
1193
|
const api = await vueDocgenApi.parse(filePath);
|
|
@@ -1200,69 +1205,182 @@ async function translateAPI(filePath) {
|
|
|
1200
1205
|
}
|
|
1201
1206
|
}
|
|
1202
1207
|
return {
|
|
1208
|
+
name: api.displayName,
|
|
1209
|
+
slug: slugify(api.displayName),
|
|
1203
1210
|
props,
|
|
1204
1211
|
events,
|
|
1205
1212
|
slots
|
|
1206
1213
|
};
|
|
1207
1214
|
}
|
|
1208
1215
|
|
|
1209
|
-
const md = vendor.MarkdownIt(
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
}
|
|
1217
|
-
function
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1216
|
+
const md$2 = vendor.MarkdownIt();
|
|
1217
|
+
const EMPTY_CHAR$2 = "‐";
|
|
1218
|
+
function render$3(text) {
|
|
1219
|
+
return text ? md$2.render(text) : EMPTY_CHAR$2;
|
|
1220
|
+
}
|
|
1221
|
+
function renderInline$2(text) {
|
|
1222
|
+
return text ? md$2.renderInline(text) : EMPTY_CHAR$2;
|
|
1223
|
+
}
|
|
1224
|
+
function generatePropTable(slug, props) {
|
|
1225
|
+
return (
|
|
1226
|
+
/* HTML */
|
|
1227
|
+
`
|
|
1228
|
+
<next-heading-level id="${slug}-props">
|
|
1229
|
+
<a class="header-anchor" href="#${slug}-props">Props</a>
|
|
1230
|
+
</next-heading-level>
|
|
1231
|
+
<dl class="docs-api docs-api--slots">
|
|
1232
|
+
${props.map((prop) => {
|
|
1233
|
+
const { name } = prop;
|
|
1234
|
+
const id = `${slug}-slot-${name}`;
|
|
1235
|
+
return (
|
|
1236
|
+
/* HTML */
|
|
1237
|
+
`
|
|
1238
|
+
<dt>
|
|
1239
|
+
<code id="${id}"
|
|
1240
|
+
><a class="docs-api__anchor" href="#${id}"
|
|
1241
|
+
><span class="docs-api__name">${name}</span
|
|
1242
|
+
>: ${prop.type}</a
|
|
1243
|
+
></code
|
|
1244
|
+
>
|
|
1245
|
+
${prop.required ? "" : `<span class="docs-tag docs-tag--default">Optional</span>`}
|
|
1246
|
+
${prop.deprecated === null ? "" : `<span class="docs-tag docs-tag--deprecated">Deprecated</span>`}
|
|
1247
|
+
</dt>
|
|
1248
|
+
<dd>
|
|
1249
|
+
${render$3(prop.description)}
|
|
1250
|
+
${prop.default ? `<p class="doc-api__item">Default: <code>${prop.default.value}</code></p>` : ""}
|
|
1251
|
+
${prop.deprecated ? `<p class="doc-api__item docs-deprecated">Deprecated: ${renderInline$2(prop.deprecated)}</p>` : ""}
|
|
1252
|
+
</dd>
|
|
1253
|
+
`
|
|
1254
|
+
);
|
|
1255
|
+
}).join("")}
|
|
1256
|
+
</dl>
|
|
1257
|
+
`
|
|
1258
|
+
);
|
|
1235
1259
|
}
|
|
1236
1260
|
|
|
1237
|
-
|
|
1238
|
-
|
|
1261
|
+
const md$1 = vendor.MarkdownIt();
|
|
1262
|
+
const EMPTY_CHAR$1 = "‐";
|
|
1263
|
+
const EM_DASH$1 = `<span role="presentation">—</span>`;
|
|
1264
|
+
function render$2(text) {
|
|
1265
|
+
return text ? md$1.render(text) : EMPTY_CHAR$1;
|
|
1266
|
+
}
|
|
1267
|
+
function renderInline$1(text) {
|
|
1268
|
+
return text ? md$1.renderInline(text) : EMPTY_CHAR$1;
|
|
1269
|
+
}
|
|
1270
|
+
function generateEventTable(slug, events) {
|
|
1271
|
+
return (
|
|
1272
|
+
/* HTML */
|
|
1273
|
+
`
|
|
1274
|
+
<next-heading-level id="${slug}-events">
|
|
1275
|
+
<a class="header-anchor" href="#${slug}-events">Events</a>
|
|
1276
|
+
</next-heading-level>
|
|
1277
|
+
<dl class="docs-api docs-api--events">
|
|
1278
|
+
${events.map((event) => {
|
|
1279
|
+
const { name } = event;
|
|
1280
|
+
const id = `${slug}-event-${name}`;
|
|
1281
|
+
const haveProperties = event.properties.length > 0;
|
|
1282
|
+
return (
|
|
1283
|
+
/* HTML */
|
|
1284
|
+
`
|
|
1285
|
+
<dt>
|
|
1286
|
+
<code id="${id}"
|
|
1287
|
+
><a class="docs-api__anchor" href="#${id}"
|
|
1288
|
+
><span class="docs-api__name"
|
|
1289
|
+
>${name}</span
|
|
1290
|
+
></a
|
|
1291
|
+
></code
|
|
1292
|
+
>
|
|
1293
|
+
${event.deprecated === null ? "" : `<span class="docs-tag docs-tag--deprecated">Deprecated</span>`}
|
|
1294
|
+
</dt>
|
|
1295
|
+
<dd>
|
|
1296
|
+
${render$2(event.description)}
|
|
1297
|
+
${haveProperties ? `<p class="docs-api__list-title">Arguments:</p><ul class="docs-api__list">` : ""}
|
|
1298
|
+
${event.properties.map((it) => {
|
|
1299
|
+
if (it.description) {
|
|
1300
|
+
return `<li><code>${it.name}: ${it.type}</code> ${EM_DASH$1} ${it.description}</li>`;
|
|
1301
|
+
} else {
|
|
1302
|
+
return `<li><code>${it.name}: ${it.type}</code></li>`;
|
|
1303
|
+
}
|
|
1304
|
+
}).join("")}
|
|
1305
|
+
${haveProperties ? `</ul>` : ""}
|
|
1306
|
+
${event.deprecated ? `<p class="docs-api__deprecated docs-deprecated">Deprecated: ${renderInline$1(event.deprecated)}</p>` : ""}
|
|
1307
|
+
</dd>
|
|
1308
|
+
`
|
|
1309
|
+
);
|
|
1310
|
+
}).join("")}
|
|
1311
|
+
</dl>
|
|
1312
|
+
`
|
|
1313
|
+
);
|
|
1239
1314
|
}
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
return
|
|
1315
|
+
|
|
1316
|
+
const md = vendor.MarkdownIt();
|
|
1317
|
+
const EMPTY_CHAR = "‐";
|
|
1318
|
+
const EM_DASH = `<span role="presentation">—</span>`;
|
|
1319
|
+
function render$1(text) {
|
|
1320
|
+
return text ? md.render(text) : EMPTY_CHAR;
|
|
1321
|
+
}
|
|
1322
|
+
function renderInline(text) {
|
|
1323
|
+
return text ? md.renderInline(text) : EMPTY_CHAR;
|
|
1324
|
+
}
|
|
1325
|
+
function generateSlotTable(slug, slots) {
|
|
1326
|
+
return (
|
|
1327
|
+
/* HTML */
|
|
1328
|
+
`
|
|
1329
|
+
<next-heading-level id="${slug}-slots">
|
|
1330
|
+
<a class="header-anchor" href="#${slug}-slots">Slots</a>
|
|
1331
|
+
</next-heading-level>
|
|
1332
|
+
<dl class="docs-api docs-api--slots">
|
|
1333
|
+
${slots.map((slot) => {
|
|
1334
|
+
const { name } = slot;
|
|
1335
|
+
const id = `${slug}-slot-${name}`;
|
|
1336
|
+
const haveBindings = slot.bindings.length > 0;
|
|
1337
|
+
return (
|
|
1338
|
+
/* HTML */
|
|
1339
|
+
`
|
|
1340
|
+
<dt>
|
|
1341
|
+
<code id="${id}"
|
|
1342
|
+
><a class="docs-api__anchor" href="#${id}"
|
|
1343
|
+
><span class="docs-api__name"
|
|
1344
|
+
>${name}</span
|
|
1345
|
+
></a
|
|
1346
|
+
></code
|
|
1347
|
+
>
|
|
1348
|
+
${slot.deprecated === null ? "" : `<span class="docs-tag docs-tag--deprecated">Deprecated</span>`}
|
|
1349
|
+
</dt>
|
|
1350
|
+
<dd>
|
|
1351
|
+
${render$1(slot.description)}
|
|
1352
|
+
${haveBindings ? `<p class="docs-api__list-title">Bindings:</p><ul class="docs-api__list">` : ""}
|
|
1353
|
+
${slot.bindings.map((it) => {
|
|
1354
|
+
if (it.description) {
|
|
1355
|
+
return `<li><code>${it.name}: ${it.type}</code> ${EM_DASH} ${it.description}</li>`;
|
|
1356
|
+
} else {
|
|
1357
|
+
return `<li><code>${it.name}: ${it.type}</code></li>`;
|
|
1358
|
+
}
|
|
1359
|
+
}).join("")}
|
|
1360
|
+
${haveBindings ? `</ul>` : ""}
|
|
1361
|
+
${slot.deprecated ? `<p class="docs-api__deprecated docs-deprecated">Deprecated: ${renderInline(slot.deprecated)}</p>` : ""}
|
|
1362
|
+
</dd>
|
|
1363
|
+
`
|
|
1364
|
+
);
|
|
1365
|
+
}).join("")}
|
|
1366
|
+
</dl>
|
|
1367
|
+
`
|
|
1368
|
+
);
|
|
1249
1369
|
}
|
|
1370
|
+
|
|
1250
1371
|
function parseAPI(filePath, api) {
|
|
1251
1372
|
const relative = createMarkdownRenderer.normalizePath(filePath);
|
|
1252
1373
|
const parsedPath = path$1.parse(relative);
|
|
1253
1374
|
const componentName = parsedPath.name;
|
|
1254
1375
|
let html = "";
|
|
1255
1376
|
if (api.props.length) {
|
|
1256
|
-
|
|
1257
|
-
html += generateTable("Props", propsArray[0], propsArray.slice(1));
|
|
1377
|
+
html += generatePropTable(api.slug, api.props);
|
|
1258
1378
|
}
|
|
1259
1379
|
if (api.events.length) {
|
|
1260
|
-
|
|
1261
|
-
html += generateTable("Events", eventsArray[0], eventsArray.slice(1));
|
|
1380
|
+
html += generateEventTable(api.slug, api.events);
|
|
1262
1381
|
}
|
|
1263
1382
|
if (api.slots.length) {
|
|
1264
|
-
|
|
1265
|
-
html += generateTable("Slots", slotsArray[0], slotsArray.slice(1));
|
|
1383
|
+
html += generateSlotTable(api.slug, api.slots);
|
|
1266
1384
|
}
|
|
1267
1385
|
return {
|
|
1268
1386
|
id: `fs:${filePath.replace(/\\/g, "/")}`,
|
package/dist/markdown.js
CHANGED
package/dist/style/core.css
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
|
+
.docs-api dt code {
|
|
3
|
+
margin-left: -0.25rem;
|
|
4
|
+
}
|
|
5
|
+
.docs-api dd {
|
|
6
|
+
margin-bottom: 2rem;
|
|
7
|
+
}
|
|
8
|
+
.docs-api p {
|
|
9
|
+
margin-bottom: 0.5rem;
|
|
10
|
+
}
|
|
11
|
+
.docs-api__name {
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
}
|
|
14
|
+
.docs-api__deprecated, .docs-api__item, .docs-api__list-title {
|
|
15
|
+
margin: 1rem 0 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#content a.docs-api__anchor {
|
|
19
|
+
color: var(--docs-text-color-default);
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
#content a.docs-api__anchor:hover {
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
}
|
|
25
|
+
#content a.docs-api__anchor::before {
|
|
26
|
+
content: "#";
|
|
27
|
+
display: inline-block;
|
|
28
|
+
font-size: 1em;
|
|
29
|
+
margin-left: -1em;
|
|
30
|
+
visibility: hidden;
|
|
31
|
+
width: 1em;
|
|
32
|
+
color: rgba(158, 158, 158, 0.6509803922);
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
}
|
|
35
|
+
#content a.docs-api__anchor:hover::before {
|
|
36
|
+
visibility: visible;
|
|
37
|
+
}
|
|
38
|
+
|
|
2
39
|
:root {
|
|
3
40
|
--docs-breakpoint-sm: 640px;
|
|
4
41
|
--docs-breakpoint-md: 1024px;
|
|
@@ -611,6 +648,11 @@ main {
|
|
|
611
648
|
border-color: var(--docs-tags-optional-border-color);
|
|
612
649
|
color: var(--docs-tags-optional-text-color);
|
|
613
650
|
}
|
|
651
|
+
.docs-tag--deprecated {
|
|
652
|
+
background-color: var(--docs-tags-deprecated-background-color);
|
|
653
|
+
border-color: var(--docs-tags-deprecated-border-color);
|
|
654
|
+
color: var(--docs-tags-deprecated-text-color);
|
|
655
|
+
}
|
|
614
656
|
|
|
615
657
|
#version-banner {
|
|
616
658
|
margin: 0;
|
|
@@ -843,11 +885,11 @@ h6 code {
|
|
|
843
885
|
text-decoration: inherit;
|
|
844
886
|
}
|
|
845
887
|
|
|
846
|
-
#content a:not(.code-preview a) {
|
|
888
|
+
#content a:where(:not(.code-preview a)) {
|
|
847
889
|
color: var(--docs-text-color-default);
|
|
848
890
|
}
|
|
849
891
|
|
|
850
|
-
#content a:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
|
|
892
|
+
#content a:where(:not(.code-preview a, h2 a, h3 a, h4 a, h5 a)) {
|
|
851
893
|
text-decoration: underline;
|
|
852
894
|
text-decoration-thickness: 1px;
|
|
853
895
|
color: var(--f-text-color-link);
|
|
@@ -855,7 +897,7 @@ h6 code {
|
|
|
855
897
|
text-underline-offset: 0.15rem;
|
|
856
898
|
}
|
|
857
899
|
|
|
858
|
-
#content a:hover:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
|
|
900
|
+
#content a:where(:hover:not(.code-preview a, h2 a, h3 a, h4 a, h5 a)) {
|
|
859
901
|
color: var(--f-text-color-default);
|
|
860
902
|
text-decoration-color: var(--docs-text-link-hover);
|
|
861
903
|
}
|
|
@@ -1017,52 +1059,6 @@ main #aside dd {
|
|
|
1017
1059
|
margin: 0 0 1.5rem;
|
|
1018
1060
|
}
|
|
1019
1061
|
|
|
1020
|
-
.docs-table {
|
|
1021
|
-
overflow-x: auto;
|
|
1022
|
-
margin-bottom: 48px;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
.docs-table table {
|
|
1026
|
-
width: 100%;
|
|
1027
|
-
border-collapse: collapse;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
.docs-table p {
|
|
1031
|
-
margin: 0;
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
.docs-table caption {
|
|
1035
|
-
text-align: left;
|
|
1036
|
-
font-size: var(--f-font-size-large);
|
|
1037
|
-
font-weight: var(--f-font-weight-bold);
|
|
1038
|
-
margin-top: 0.5rem;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
.docs-table thead {
|
|
1042
|
-
border-bottom: 1px solid #8d8e91;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
.docs-table th {
|
|
1046
|
-
padding-right: 16px;
|
|
1047
|
-
padding-bottom: 4px;
|
|
1048
|
-
padding-left: 8px;
|
|
1049
|
-
text-align: left;
|
|
1050
|
-
font-weight: var(--f-font-weight-medium);
|
|
1051
|
-
white-space: nowrap;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
/* not: turn off for additional tables inside the table */
|
|
1055
|
-
.docs-table tr:nth-child(even):not(.api-table tr tr) {
|
|
1056
|
-
background-color: #f4f4f4;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
.docs-table td {
|
|
1060
|
-
color: rgb(51, 51, 51);
|
|
1061
|
-
padding: 1rem 1rem 1rem 0.5rem;
|
|
1062
|
-
vertical-align: top;
|
|
1063
|
-
border-bottom: 1px solid rgb(232, 232, 232);
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
1062
|
.code-preview main,
|
|
1067
1063
|
.code-preview header,
|
|
1068
1064
|
.code-preview footer {
|
|
@@ -1227,4 +1223,8 @@ kbd {
|
|
|
1227
1223
|
|
|
1228
1224
|
#search-results .list__item__itempane:focus {
|
|
1229
1225
|
background-color: #f4f4f4;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
.docs-deprecated {
|
|
1229
|
+
color: var(--docs-error-color);
|
|
1230
1230
|
}
|
package/dist/style/index.css
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
|
+
.docs-api dt code {
|
|
3
|
+
margin-left: -0.25rem;
|
|
4
|
+
}
|
|
5
|
+
.docs-api dd {
|
|
6
|
+
margin-bottom: 2rem;
|
|
7
|
+
}
|
|
8
|
+
.docs-api p {
|
|
9
|
+
margin-bottom: 0.5rem;
|
|
10
|
+
}
|
|
11
|
+
.docs-api__name {
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
}
|
|
14
|
+
.docs-api__deprecated, .docs-api__item, .docs-api__list-title {
|
|
15
|
+
margin: 1rem 0 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#content a.docs-api__anchor {
|
|
19
|
+
color: var(--docs-text-color-default);
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
#content a.docs-api__anchor:hover {
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
}
|
|
25
|
+
#content a.docs-api__anchor::before {
|
|
26
|
+
content: "#";
|
|
27
|
+
display: inline-block;
|
|
28
|
+
font-size: 1em;
|
|
29
|
+
margin-left: -1em;
|
|
30
|
+
visibility: hidden;
|
|
31
|
+
width: 1em;
|
|
32
|
+
color: rgba(158, 158, 158, 0.6509803922);
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
}
|
|
35
|
+
#content a.docs-api__anchor:hover::before {
|
|
36
|
+
visibility: visible;
|
|
37
|
+
}
|
|
38
|
+
|
|
2
39
|
:root {
|
|
3
40
|
--docs-breakpoint-sm: 640px;
|
|
4
41
|
--docs-breakpoint-md: 1024px;
|
|
@@ -611,6 +648,11 @@ main {
|
|
|
611
648
|
border-color: var(--docs-tags-optional-border-color);
|
|
612
649
|
color: var(--docs-tags-optional-text-color);
|
|
613
650
|
}
|
|
651
|
+
.docs-tag--deprecated {
|
|
652
|
+
background-color: var(--docs-tags-deprecated-background-color);
|
|
653
|
+
border-color: var(--docs-tags-deprecated-border-color);
|
|
654
|
+
color: var(--docs-tags-deprecated-text-color);
|
|
655
|
+
}
|
|
614
656
|
|
|
615
657
|
#version-banner {
|
|
616
658
|
margin: 0;
|
|
@@ -843,11 +885,11 @@ h6 code {
|
|
|
843
885
|
text-decoration: inherit;
|
|
844
886
|
}
|
|
845
887
|
|
|
846
|
-
#content a:not(.code-preview a) {
|
|
888
|
+
#content a:where(:not(.code-preview a)) {
|
|
847
889
|
color: var(--docs-text-color-default);
|
|
848
890
|
}
|
|
849
891
|
|
|
850
|
-
#content a:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
|
|
892
|
+
#content a:where(:not(.code-preview a, h2 a, h3 a, h4 a, h5 a)) {
|
|
851
893
|
text-decoration: underline;
|
|
852
894
|
text-decoration-thickness: 1px;
|
|
853
895
|
color: var(--f-text-color-link);
|
|
@@ -855,7 +897,7 @@ h6 code {
|
|
|
855
897
|
text-underline-offset: 0.15rem;
|
|
856
898
|
}
|
|
857
899
|
|
|
858
|
-
#content a:hover:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
|
|
900
|
+
#content a:where(:hover:not(.code-preview a, h2 a, h3 a, h4 a, h5 a)) {
|
|
859
901
|
color: var(--f-text-color-default);
|
|
860
902
|
text-decoration-color: var(--docs-text-link-hover);
|
|
861
903
|
}
|
|
@@ -1017,52 +1059,6 @@ main #aside dd {
|
|
|
1017
1059
|
margin: 0 0 1.5rem;
|
|
1018
1060
|
}
|
|
1019
1061
|
|
|
1020
|
-
.docs-table {
|
|
1021
|
-
overflow-x: auto;
|
|
1022
|
-
margin-bottom: 48px;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
.docs-table table {
|
|
1026
|
-
width: 100%;
|
|
1027
|
-
border-collapse: collapse;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
.docs-table p {
|
|
1031
|
-
margin: 0;
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
.docs-table caption {
|
|
1035
|
-
text-align: left;
|
|
1036
|
-
font-size: var(--f-font-size-large);
|
|
1037
|
-
font-weight: var(--f-font-weight-bold);
|
|
1038
|
-
margin-top: 0.5rem;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
.docs-table thead {
|
|
1042
|
-
border-bottom: 1px solid #8d8e91;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
.docs-table th {
|
|
1046
|
-
padding-right: 16px;
|
|
1047
|
-
padding-bottom: 4px;
|
|
1048
|
-
padding-left: 8px;
|
|
1049
|
-
text-align: left;
|
|
1050
|
-
font-weight: var(--f-font-weight-medium);
|
|
1051
|
-
white-space: nowrap;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
/* not: turn off for additional tables inside the table */
|
|
1055
|
-
.docs-table tr:nth-child(even):not(.api-table tr tr) {
|
|
1056
|
-
background-color: #f4f4f4;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
.docs-table td {
|
|
1060
|
-
color: rgb(51, 51, 51);
|
|
1061
|
-
padding: 1rem 1rem 1rem 0.5rem;
|
|
1062
|
-
vertical-align: top;
|
|
1063
|
-
border-bottom: 1px solid rgb(232, 232, 232);
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
1062
|
.code-preview main,
|
|
1067
1063
|
.code-preview header,
|
|
1068
1064
|
.code-preview footer {
|
|
@@ -1229,6 +1225,10 @@ kbd {
|
|
|
1229
1225
|
background-color: #f4f4f4;
|
|
1230
1226
|
}
|
|
1231
1227
|
|
|
1228
|
+
.docs-deprecated {
|
|
1229
|
+
color: var(--docs-error-color);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
1232
|
:root {
|
|
1233
1233
|
--docs-font-family: arial, "Helvetica Neue", sans-serif;
|
|
1234
1234
|
--docs-font-weight: normal;
|
|
@@ -1270,6 +1270,9 @@ kbd {
|
|
|
1270
1270
|
--docs-tags-optional-background-color: transparent;
|
|
1271
1271
|
--docs-tags-optional-border-color: #5f6165;
|
|
1272
1272
|
--docs-tags-optional-text-color: var(--docs-text-color-discrete);
|
|
1273
|
+
--docs-tags-deprecated-background-color: var(--docs-error-color);
|
|
1274
|
+
--docs-tags-deprecated-border-color: #1b1e23;
|
|
1275
|
+
--docs-tags-deprecated-text-color: var(--docs-error-background);
|
|
1273
1276
|
--docs-topnav-background-color: transparent;
|
|
1274
1277
|
--docs-topnav-link-color-default: var(--docs-text-color-default);
|
|
1275
1278
|
--docs-topnav-link-color-hover: var(--docs-text-color-link-hover);
|
package/dist/style/site.css
CHANGED
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
--docs-tags-optional-background-color: transparent;
|
|
40
40
|
--docs-tags-optional-border-color: #5f6165;
|
|
41
41
|
--docs-tags-optional-text-color: var(--docs-text-color-discrete);
|
|
42
|
+
--docs-tags-deprecated-background-color: var(--docs-error-color);
|
|
43
|
+
--docs-tags-deprecated-border-color: #1b1e23;
|
|
44
|
+
--docs-tags-deprecated-text-color: var(--docs-error-background);
|
|
42
45
|
--docs-topnav-background-color: transparent;
|
|
43
46
|
--docs-topnav-link-color-default: var(--docs-text-color-default);
|
|
44
47
|
--docs-topnav-link-color-hover: var(--docs-text-color-link-hover);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/docs-generator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "Documentation generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "npm run --workspaces --if-present build",
|
|
37
37
|
"build": "tsc && node build.mjs",
|
|
38
|
-
"postbuild": "node generate-docs.mjs",
|
|
38
|
+
"postbuild": "node generate-docs.mjs && html-validate public",
|
|
39
39
|
"build:docs": "node generate-docs.mjs",
|
|
40
40
|
"eslint": "eslint --cache .",
|
|
41
41
|
"eslint:fix": "eslint --fix .",
|