@forsakringskassan/docs-generator 2.9.1 → 2.9.2
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/compile-example.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25 -13
- package/package.json +1 -1
- package/templates/partials/topnav.html +4 -2
package/dist/compile-example.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -371,6 +371,7 @@ export declare interface NavigationSection {
|
|
|
371
371
|
readonly path: string;
|
|
372
372
|
readonly sortorder: number;
|
|
373
373
|
readonly children: NavigationNode[];
|
|
374
|
+
readonly visible: boolean;
|
|
374
375
|
}
|
|
375
376
|
|
|
376
377
|
/**
|
|
@@ -619,6 +620,8 @@ export declare function themeSelectProcessor(): Processor;
|
|
|
619
620
|
export declare interface TopnavEntry {
|
|
620
621
|
path: string;
|
|
621
622
|
title: string;
|
|
623
|
+
sortorder?: number;
|
|
624
|
+
visible?: boolean;
|
|
622
625
|
}
|
|
623
626
|
|
|
624
627
|
/**
|
package/dist/index.js
CHANGED
|
@@ -440,6 +440,7 @@ function generateNavigation(entries) {
|
|
|
440
440
|
key,
|
|
441
441
|
sortorder: index,
|
|
442
442
|
children: [],
|
|
443
|
+
visible: true,
|
|
443
444
|
...it
|
|
444
445
|
};
|
|
445
446
|
});
|
|
@@ -447,7 +448,8 @@ function generateNavigation(entries) {
|
|
|
447
448
|
key: ".",
|
|
448
449
|
path: "./index.html",
|
|
449
450
|
sortorder: Infinity,
|
|
450
|
-
children
|
|
451
|
+
children,
|
|
452
|
+
visible: true
|
|
451
453
|
};
|
|
452
454
|
}
|
|
453
455
|
function topnavProcessor(filename, title) {
|
|
@@ -1347,18 +1349,20 @@ function getParentKey(name) {
|
|
|
1347
1349
|
}
|
|
1348
1350
|
function generateNavtree(docs) {
|
|
1349
1351
|
const section = {};
|
|
1350
|
-
function createSection(key, title, sortorder) {
|
|
1352
|
+
function createSection(key, title, sortorder, { visible } = {}) {
|
|
1351
1353
|
const existing = section[key];
|
|
1352
1354
|
if (existing) {
|
|
1353
1355
|
existing.title = title;
|
|
1354
1356
|
existing.sortorder = sortorder;
|
|
1357
|
+
existing.visible = visible ?? true;
|
|
1355
1358
|
} else {
|
|
1356
1359
|
const node = {
|
|
1357
1360
|
key,
|
|
1358
1361
|
title,
|
|
1359
1362
|
path: "",
|
|
1360
1363
|
sortorder,
|
|
1361
|
-
children: []
|
|
1364
|
+
children: [],
|
|
1365
|
+
visible: visible ?? true
|
|
1362
1366
|
};
|
|
1363
1367
|
section[key] = node;
|
|
1364
1368
|
if (key !== ".") {
|
|
@@ -1378,7 +1382,8 @@ function generateNavtree(docs) {
|
|
|
1378
1382
|
title: parentKey.split("/").at(-1) ?? "(missing title)",
|
|
1379
1383
|
path: "",
|
|
1380
1384
|
sortorder: Infinity,
|
|
1381
|
-
children: []
|
|
1385
|
+
children: [],
|
|
1386
|
+
visible: true
|
|
1382
1387
|
};
|
|
1383
1388
|
section[parentKey] = parent;
|
|
1384
1389
|
let anchestor = parentKey;
|
|
@@ -1394,7 +1399,8 @@ function generateNavtree(docs) {
|
|
|
1394
1399
|
title: "",
|
|
1395
1400
|
path: "",
|
|
1396
1401
|
sortorder: Infinity,
|
|
1397
|
-
children: [current]
|
|
1402
|
+
children: [current],
|
|
1403
|
+
visible: true
|
|
1398
1404
|
};
|
|
1399
1405
|
section[anchestor] = node;
|
|
1400
1406
|
current = node;
|
|
@@ -1425,7 +1431,7 @@ function generateNavtree(docs) {
|
|
|
1425
1431
|
}
|
|
1426
1432
|
if (!doc.visible) {
|
|
1427
1433
|
if (isSection) {
|
|
1428
|
-
createSection(name, title, sortorder);
|
|
1434
|
+
createSection(name, title, sortorder, { visible: false });
|
|
1429
1435
|
}
|
|
1430
1436
|
continue;
|
|
1431
1437
|
}
|
|
@@ -1448,13 +1454,15 @@ function generateNavtree(docs) {
|
|
|
1448
1454
|
existing.path = leafNode.path;
|
|
1449
1455
|
existing.sortorder = sortorder;
|
|
1450
1456
|
existing.children.unshift(leafNode);
|
|
1457
|
+
existing.visible = true;
|
|
1451
1458
|
} else {
|
|
1452
1459
|
const sectionNode = {
|
|
1453
1460
|
key: name,
|
|
1454
1461
|
title,
|
|
1455
1462
|
path: leafNode.path,
|
|
1456
1463
|
sortorder,
|
|
1457
|
-
children: [leafNode]
|
|
1464
|
+
children: [leafNode],
|
|
1465
|
+
visible: true
|
|
1458
1466
|
};
|
|
1459
1467
|
section[name] = sectionNode;
|
|
1460
1468
|
parent.children.push(sectionNode);
|
|
@@ -1479,7 +1487,8 @@ function generateNavtree(docs) {
|
|
|
1479
1487
|
title: "",
|
|
1480
1488
|
path: "",
|
|
1481
1489
|
sortorder: Infinity,
|
|
1482
|
-
children: []
|
|
1490
|
+
children: [],
|
|
1491
|
+
visible: true
|
|
1483
1492
|
};
|
|
1484
1493
|
}
|
|
1485
1494
|
}
|
|
@@ -2015,9 +2024,10 @@ async function compileVendor(assetFolder, vendor, options) {
|
|
|
2015
2024
|
platform: "browser",
|
|
2016
2025
|
tsconfig,
|
|
2017
2026
|
define: {
|
|
2018
|
-
"process.env.NODE_ENV": JSON.stringify(
|
|
2019
|
-
|
|
2020
|
-
|
|
2027
|
+
"process.env.NODE_ENV": JSON.stringify("development"),
|
|
2028
|
+
__VUE_OPTIONS_API__: "true",
|
|
2029
|
+
__VUE_PROD_DEVTOOLS__: "true",
|
|
2030
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false"
|
|
2021
2031
|
},
|
|
2022
2032
|
alias: vendor.alias ? { [`${vendor.package}`]: vendor.alias } : void 0,
|
|
2023
2033
|
...options
|
|
@@ -2247,14 +2257,16 @@ function createContext(templateLoader) {
|
|
|
2247
2257
|
title: "",
|
|
2248
2258
|
path: "",
|
|
2249
2259
|
sortorder: Infinity,
|
|
2250
|
-
children: []
|
|
2260
|
+
children: [],
|
|
2261
|
+
visible: true
|
|
2251
2262
|
};
|
|
2252
2263
|
let sidenav = {
|
|
2253
2264
|
key: ".",
|
|
2254
2265
|
title: "",
|
|
2255
2266
|
path: "",
|
|
2256
2267
|
sortorder: Infinity,
|
|
2257
|
-
children: []
|
|
2268
|
+
children: [],
|
|
2269
|
+
visible: true
|
|
2258
2270
|
};
|
|
2259
2271
|
const templateData = {};
|
|
2260
2272
|
return {
|
package/package.json
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
{% set navPath = nav.path | replace("html", "") %}
|
|
6
6
|
{% set navPath = navPath | replace(".", "") %}
|
|
7
7
|
{% set activePage = navPath in doc.fileInfo.fullPath %}
|
|
8
|
+
{% if nav.visible %}
|
|
8
9
|
<li class="docs-topnav__item {% if activePage %}highlight{% endif %}">
|
|
9
10
|
<a class="docs-topnav__anchor" href="{{ nav.path | relative(doc) }}"> {{ nav.title }} </a>
|
|
10
11
|
</li>
|
|
11
|
-
{%- endfor -%}
|
|
12
|
+
{% endif %} {%- endfor -%}
|
|
12
13
|
<li class="docs-topnav__item docs-topnav__item--more" style="visibility: hidden">
|
|
13
14
|
<button type="button" class="docs-topnav__anchor" aria-expanded="false">
|
|
14
15
|
<span>Mer</span>
|
|
@@ -23,10 +24,11 @@
|
|
|
23
24
|
{% set navPath = nav.path | replace("html", "") %}
|
|
24
25
|
{% set navPath = navPath | replace(".", "") %}
|
|
25
26
|
{% set activePage = navPath in doc.fileInfo.fullPath %}
|
|
27
|
+
{% if nav.visible %}
|
|
26
28
|
<li class="docs-contextmenu__item {% if activePage %}highlight{% endif %}" style="display: none">
|
|
27
29
|
<a class="docs-contextmenu__anchor" href="{{ nav.path | relative(doc) }}"> {{ nav.title }} </a>
|
|
28
30
|
</li>
|
|
29
|
-
{%- endfor -%}
|
|
31
|
+
{% endif %} {%- endfor -%}
|
|
30
32
|
</ul>
|
|
31
33
|
</div>
|
|
32
34
|
</li>
|