@forsakringskassan/docs-generator 1.24.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/LICENSE.md +24 -0
- package/README.md +311 -0
- package/dist/compile-example.js +13406 -0
- package/dist/generator.d.ts +512 -0
- package/dist/generator.js +84168 -0
- package/dist/markdown.d.ts +243 -0
- package/dist/markdown.js +19369 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +206572 -0
- package/dist/style/core.css +840 -0
- package/dist/style/index.css +927 -0
- package/dist/style/site.css +86 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +68 -0
- package/templates/base.template.html +132 -0
- package/templates/component.template.html +28 -0
- package/templates/content-with-menu.template.html +15 -0
- package/templates/content-without-menu.template.html +10 -0
- package/templates/default.template.html +10 -0
- package/templates/example.template.html +70 -0
- package/templates/json.template.json +1 -0
- package/templates/macro/menu.html +39 -0
- package/templates/partials/footer.html +3 -0
- package/templates/partials/header.html +14 -0
- package/templates/partials/livereload.html +1 -0
- package/templates/partials/matomo.html +29 -0
- package/templates/partials/search-dialog.html +25 -0
- package/templates/partials/search-toolbar.html +9 -0
- package/templates/partials/selectable-version.html +28 -0
- package/templates/partials/spritesheet.html +44 -0
- package/templates/partials/theme-select.html +68 -0
- package/templates/partials/topnav.html +22 -0
- package/templates/partials/version-banner.html +14 -0
- package/templates/partials/version.html +3 -0
- package/templates/pattern.template.html +19 -0
- package/tsconfig-examples.json +9 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<div class="toolbar__item">
|
|
2
|
+
<div class="select-field" hidden>
|
|
3
|
+
<label for="fkds-theme-select" class="label sr-only"> Tema </label>
|
|
4
|
+
<div class="select-field__icon-wrapper">
|
|
5
|
+
<select id="fkds-theme-select" class="select-field__select">
|
|
6
|
+
<option value="exp">Externportal</option>
|
|
7
|
+
<option value="int">Intern</option>
|
|
8
|
+
</select>
|
|
9
|
+
<svg focusable="false" class="icon select-field__icon">
|
|
10
|
+
<use xlink:href="#docs-icon-arrow-down"></use>
|
|
11
|
+
</svg>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
function themeSelector() {
|
|
17
|
+
const cookieName = "fkds-theme";
|
|
18
|
+
|
|
19
|
+
function getCookie(key) {
|
|
20
|
+
const cookie = document.cookie.split("; ").find((item) => item.trim().startsWith(`${key}=`));
|
|
21
|
+
if (cookie) {
|
|
22
|
+
const [, value] = cookie.split("=", 2);
|
|
23
|
+
return value;
|
|
24
|
+
} else {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function setCookie(key, value) {
|
|
30
|
+
document.cookie = `${key}=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=strict`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function enableTheme(theme) {
|
|
34
|
+
const style = Array.from(document.querySelectorAll("[data-theme]"));
|
|
35
|
+
for (const el of style) {
|
|
36
|
+
el.disabled = el.dataset.theme !== theme;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const el = document.querySelector("#fkds-theme-select");
|
|
41
|
+
const wrapper = el.closest(".select-field");
|
|
42
|
+
el.addEventListener("change", () => {
|
|
43
|
+
const theme = el.value;
|
|
44
|
+
setCookie(cookieName, theme);
|
|
45
|
+
enableTheme(theme);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const selected = getCookie(cookieName) || "exp";
|
|
49
|
+
enableTheme(selected);
|
|
50
|
+
el.value = selected;
|
|
51
|
+
|
|
52
|
+
wrapper.hidden = false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* technical debt, this entire script should be moved to src/runtime and
|
|
56
|
+
* import this function instead */
|
|
57
|
+
function onContentReady(callback) {
|
|
58
|
+
const { readyState } = document;
|
|
59
|
+
if (readyState === "complete" || readyState === "interactive") {
|
|
60
|
+
setTimeout(callback, 0);
|
|
61
|
+
} else {
|
|
62
|
+
document.addEventListener("DOMContentLoaded", callback);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
onContentReady(themeSelector);
|
|
67
|
+
</script>
|
|
68
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<nav class="imenu imenu--horizontal" aria-label="Primär">
|
|
2
|
+
<ul class="imenu__list">
|
|
3
|
+
<!-- prettier-ignore -->
|
|
4
|
+
{%- for nav in topnav.children -%}
|
|
5
|
+
{% set navPath = nav.path | replace("html", "") %}
|
|
6
|
+
{% set navPath = navPath | replace(".", "") %}
|
|
7
|
+
{% set activePage = navPath in doc.fileInfo.fullPath %}
|
|
8
|
+
<li class="imenu__list__item {% if activePage %}imenu__list__item--highlight{% endif %}">
|
|
9
|
+
<div
|
|
10
|
+
class="imenu__list__anchor-container {% if activePage %}imenu__list__anchor-container--highlight{% endif %}"
|
|
11
|
+
>
|
|
12
|
+
<a
|
|
13
|
+
class="imenu__list__anchor {% if activePage %}imenu__list__anchor--highlight{% endif %}"
|
|
14
|
+
href="{{ nav.path | relative(doc) }}"
|
|
15
|
+
>
|
|
16
|
+
{{ nav.title }}
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
</li>
|
|
20
|
+
{%- endfor -%}
|
|
21
|
+
</ul>
|
|
22
|
+
</nav>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div id="version-banner" class="message-box message-box--info" style="display: none">
|
|
2
|
+
<span class="message-box__icon">
|
|
3
|
+
<span class="icon-stack icon-stack--info">
|
|
4
|
+
<svg class="icon__info icon" focusable="false" aria-hidden="true">
|
|
5
|
+
<use xlink:href="#docs-icon-circle"></use>
|
|
6
|
+
</svg>
|
|
7
|
+
<svg class="icon" focusable="false" aria-hidden="true">
|
|
8
|
+
<use xlink:href="#docs-icon-i"></use>
|
|
9
|
+
</svg>
|
|
10
|
+
</span>
|
|
11
|
+
</span>
|
|
12
|
+
<span class="sr-only">Informationsmeddelande</span>
|
|
13
|
+
<p>{{ message }}</p>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{% extends "content-with-menu.template.html" %}
|
|
2
|
+
<!-- prettier-ignore -->
|
|
3
|
+
{% block aside %}
|
|
4
|
+
<dl>
|
|
5
|
+
<!-- prettier-ignore -->
|
|
6
|
+
{% if doc.attributes.component %}
|
|
7
|
+
<dt>Komponent</dt>
|
|
8
|
+
<dd>
|
|
9
|
+
{% for component in doc.attributes.component %}
|
|
10
|
+
<code>{{ component }}</code>{% if not loop.last %}, {% endif %} {% endfor %}
|
|
11
|
+
</dd>
|
|
12
|
+
{% endif %}
|
|
13
|
+
</dl>
|
|
14
|
+
{% endblock %}
|
|
15
|
+
|
|
16
|
+
<!-- prettier-ignore -->
|
|
17
|
+
{% block content %}
|
|
18
|
+
{{ doc.body | marked }}
|
|
19
|
+
{% endblock %}
|