lildocs 0.1.3 → 0.1.5
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/cli.mjs +42 -14
- package/dist/render/copy-code.js +3 -3
- package/dist/render/search.js +2 -3
- package/dist/render/styles.css +31 -24
- package/package.json +2 -1
package/dist/cli.mjs
CHANGED
|
@@ -429,23 +429,23 @@ function ensureUniqueRoutes(pages) {
|
|
|
429
429
|
const defaultAlertVariants = [
|
|
430
430
|
{
|
|
431
431
|
type: "note",
|
|
432
|
-
icon:
|
|
432
|
+
icon: tablerIcon("info-circle")
|
|
433
433
|
},
|
|
434
434
|
{
|
|
435
435
|
type: "tip",
|
|
436
|
-
icon:
|
|
436
|
+
icon: tablerIcon("bulb")
|
|
437
437
|
},
|
|
438
438
|
{
|
|
439
439
|
type: "important",
|
|
440
|
-
icon:
|
|
440
|
+
icon: tablerIcon("message-report")
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
443
|
type: "warning",
|
|
444
|
-
icon:
|
|
444
|
+
icon: tablerIcon("alert-triangle")
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
447
|
type: "caution",
|
|
448
|
-
icon:
|
|
448
|
+
icon: tablerIcon("alert-circle")
|
|
449
449
|
}
|
|
450
450
|
];
|
|
451
451
|
function markedAlert(options = {}) {
|
|
@@ -511,8 +511,8 @@ function createSyntaxPattern(type) {
|
|
|
511
511
|
function capitalize$1(value) {
|
|
512
512
|
return value.slice(0, 1).toUpperCase() + value.slice(1).toLowerCase();
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
return `<span class="
|
|
514
|
+
function tablerIcon(name) {
|
|
515
|
+
return `<span class="ti ti-${name} markdown-alert-icon" aria-hidden="true"></span>`;
|
|
516
516
|
}
|
|
517
517
|
function escapeRegExp(value) {
|
|
518
518
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -768,7 +768,7 @@ function nestNavItems(items) {
|
|
|
768
768
|
let group = byDir.get(currentPath);
|
|
769
769
|
if (!group) {
|
|
770
770
|
group = {
|
|
771
|
-
title: titleFromDir(part),
|
|
771
|
+
title: titleFromDir$1(part),
|
|
772
772
|
route: `${currentPath}/index.html`,
|
|
773
773
|
active: false,
|
|
774
774
|
hasPage: false,
|
|
@@ -789,7 +789,7 @@ function nestNavItems(items) {
|
|
|
789
789
|
}
|
|
790
790
|
return topLevel;
|
|
791
791
|
}
|
|
792
|
-
function titleFromDir(dir) {
|
|
792
|
+
function titleFromDir$1(dir) {
|
|
793
793
|
return dir.replace(/[-_]+/g, " ").replace(/\S+/g, (word) => `${word[0]?.toLocaleUpperCase() ?? ""}${word.slice(1)}`);
|
|
794
794
|
}
|
|
795
795
|
//#endregion
|
|
@@ -1117,6 +1117,7 @@ function themeToCssVariableBlock(theme, fontOverrides) {
|
|
|
1117
1117
|
--ld-color-muted-text: ${color.mutedText};
|
|
1118
1118
|
--ld-color-border: ${color.border};
|
|
1119
1119
|
--ld-color-link: ${color.link};
|
|
1120
|
+
--ld-color-accent: ${color.link};
|
|
1120
1121
|
--ld-color-code-background: ${color.codeBackground};
|
|
1121
1122
|
--ld-color-code-foreground: ${color.codeForeground ?? color.text};
|
|
1122
1123
|
--ld-color-sidebar-background: ${color.sidebarBackground ?? color.background};
|
|
@@ -1402,7 +1403,7 @@ function Layout({ page, nav, pageNavigation, css, searchIndexJson, logo, favicon
|
|
|
1402
1403
|
}) : null,
|
|
1403
1404
|
/* @__PURE__ */ jsx("link", {
|
|
1404
1405
|
rel: "stylesheet",
|
|
1405
|
-
href:
|
|
1406
|
+
href: rootRelativeUrl(page.route, "assets/tabler-icons.css")
|
|
1406
1407
|
}),
|
|
1407
1408
|
/* @__PURE__ */ jsx("link", {
|
|
1408
1409
|
rel: "stylesheet",
|
|
@@ -1437,9 +1438,8 @@ function Layout({ page, nav, pageNavigation, css, searchIndexJson, logo, favicon
|
|
|
1437
1438
|
id: "lildocs-search-root",
|
|
1438
1439
|
className: "searchBox",
|
|
1439
1440
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1440
|
-
className: "searchIcon
|
|
1441
|
-
"aria-hidden": "true"
|
|
1442
|
-
children: "search"
|
|
1441
|
+
className: "searchIcon ti ti-search",
|
|
1442
|
+
"aria-hidden": "true"
|
|
1443
1443
|
}), /* @__PURE__ */ jsx("input", {
|
|
1444
1444
|
id: "lildocs-search-input",
|
|
1445
1445
|
type: "search",
|
|
@@ -1465,7 +1465,7 @@ function Layout({ page, nav, pageNavigation, css, searchIndexJson, logo, favicon
|
|
|
1465
1465
|
}),
|
|
1466
1466
|
/* @__PURE__ */ jsxs("main", {
|
|
1467
1467
|
className: `content transition-${transition}`,
|
|
1468
|
-
children: [/* @__PURE__ */
|
|
1468
|
+
children: [/* @__PURE__ */ jsxs("article", { children: [/* @__PURE__ */ jsx(GroupBreadcrumbs, { route: page.route }), /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: page.html ?? "" } })] }), /* @__PURE__ */ jsx(PageNav, { pageNavigation })]
|
|
1469
1469
|
}),
|
|
1470
1470
|
/* @__PURE__ */ jsx("aside", {
|
|
1471
1471
|
className: `toc transition-${transition}`,
|
|
@@ -1500,6 +1500,17 @@ function assetSrc(pageRoute, image) {
|
|
|
1500
1500
|
if (/^(?:[a-z]+:)?\/\//i.test(image) || image.startsWith("data:") || image.startsWith("/")) return image;
|
|
1501
1501
|
return rootRelativeUrl(pageRoute, image);
|
|
1502
1502
|
}
|
|
1503
|
+
function GroupBreadcrumbs({ route }) {
|
|
1504
|
+
const dir = route.split("/").slice(0, -1);
|
|
1505
|
+
if (dir.length === 0) return null;
|
|
1506
|
+
return /* @__PURE__ */ jsx("p", {
|
|
1507
|
+
className: "groupBreadcrumbs",
|
|
1508
|
+
children: dir.map(titleFromDir).join(" / ")
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
function titleFromDir(dir) {
|
|
1512
|
+
return dir.replace(/[-_]+/g, " ").replace(/\S+/g, (word) => `${word[0]?.toLocaleUpperCase() ?? ""}${word.slice(1)}`);
|
|
1513
|
+
}
|
|
1503
1514
|
function PageNav({ pageNavigation }) {
|
|
1504
1515
|
if (!pageNavigation?.previous && !pageNavigation?.next) return null;
|
|
1505
1516
|
return /* @__PURE__ */ jsxs("nav", {
|
|
@@ -1623,6 +1634,7 @@ async function buildSite(options) {
|
|
|
1623
1634
|
fonts: configOptions.fonts
|
|
1624
1635
|
});
|
|
1625
1636
|
const baseCss = await readRenderAsset("styles.css");
|
|
1637
|
+
const tablerIconsCss = await readTablerIconsCss();
|
|
1626
1638
|
const searchScript = await readRenderAsset("search.js");
|
|
1627
1639
|
const copyCodeScript = await readRenderAsset("copy-code.js");
|
|
1628
1640
|
const navigationScript = await readRenderAsset("navigation.js");
|
|
@@ -1644,6 +1656,7 @@ async function buildSite(options) {
|
|
|
1644
1656
|
});
|
|
1645
1657
|
const css = `${fontResolution.css}${themeToCssVariables(theme, fontResolution.themeFonts, configOptions.link, configOptions.navigation)}\n${backgroundResolution.css}${logoResolution.css}${baseCss}`;
|
|
1646
1658
|
const assets = [
|
|
1659
|
+
...tablerIconFontAssets(outDir),
|
|
1647
1660
|
...fontResolution.assets,
|
|
1648
1661
|
...backgroundResolution.assets,
|
|
1649
1662
|
...logoResolution.assets
|
|
@@ -1678,6 +1691,7 @@ async function buildSite(options) {
|
|
|
1678
1691
|
await writeFile(outputPath, html);
|
|
1679
1692
|
}));
|
|
1680
1693
|
await writeFile(path.join(outDir, "assets", "lildocs.css"), css);
|
|
1694
|
+
await writeFile(path.join(outDir, "assets", "tabler-icons.css"), tablerIconsCss);
|
|
1681
1695
|
await writeFile(path.join(outDir, "assets", "search.js"), searchScript);
|
|
1682
1696
|
await writeFile(path.join(outDir, "assets", "copy-code.js"), copyCodeScript);
|
|
1683
1697
|
await writeFile(path.join(outDir, "assets", "swup.umd.js"), swupScript);
|
|
@@ -1743,6 +1757,20 @@ async function readRenderAsset(name) {
|
|
|
1743
1757
|
async function readSwupAsset() {
|
|
1744
1758
|
return readFile(path.join(path.dirname(require.resolve("swup")), "Swup.umd.js"), "utf8");
|
|
1745
1759
|
}
|
|
1760
|
+
async function readTablerIconsCss() {
|
|
1761
|
+
return readFile(require.resolve("@tabler/icons-webfont/dist/tabler-icons.css"), "utf8");
|
|
1762
|
+
}
|
|
1763
|
+
function tablerIconFontAssets(outDir) {
|
|
1764
|
+
const fontsDir = path.join(path.dirname(require.resolve("@tabler/icons-webfont/dist/tabler-icons.css")), "fonts");
|
|
1765
|
+
return [
|
|
1766
|
+
"tabler-icons.woff2",
|
|
1767
|
+
"tabler-icons.woff",
|
|
1768
|
+
"tabler-icons.ttf"
|
|
1769
|
+
].map((name) => ({
|
|
1770
|
+
from: path.join(fontsDir, name),
|
|
1771
|
+
to: path.join(outDir, "assets", "fonts", name)
|
|
1772
|
+
}));
|
|
1773
|
+
}
|
|
1746
1774
|
function buildPageNavigation(pages) {
|
|
1747
1775
|
const navigation = /* @__PURE__ */ new Map();
|
|
1748
1776
|
if (pages.length < 2) return navigation;
|
package/dist/render/copy-code.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const icons = {
|
|
3
|
-
copy: '<span class="
|
|
4
|
-
check: '<span class="
|
|
5
|
-
error: '<span class="
|
|
3
|
+
copy: '<span class="ti ti-copy copyCodeIcon" aria-hidden="true"></span>',
|
|
4
|
+
check: '<span class="ti ti-copy-check copyCodeIcon" aria-hidden="true"></span>',
|
|
5
|
+
error: '<span class="ti ti-alert-circle copyCodeIcon" aria-hidden="true"></span>',
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
initCopyCode();
|
package/dist/render/search.js
CHANGED
|
@@ -3082,9 +3082,8 @@ function SearchBox({ anchorElement, index, siteRoot, preloadedUrls }) {
|
|
|
3082
3082
|
};
|
|
3083
3083
|
return /* @__PURE__ */ u(S$1, { children: [
|
|
3084
3084
|
/* @__PURE__ */ u("span", {
|
|
3085
|
-
className: "searchIcon
|
|
3086
|
-
"aria-hidden": "true"
|
|
3087
|
-
children: "search"
|
|
3085
|
+
className: "searchIcon ti ti-search",
|
|
3086
|
+
"aria-hidden": "true"
|
|
3088
3087
|
}),
|
|
3089
3088
|
/* @__PURE__ */ u("input", {
|
|
3090
3089
|
ref: inputRef,
|
package/dist/render/styles.css
CHANGED
|
@@ -122,7 +122,7 @@ html.is-animating .transition-scale {
|
|
|
122
122
|
align-self: start;
|
|
123
123
|
max-height: 100vh;
|
|
124
124
|
overflow: auto;
|
|
125
|
-
padding-block: 24px;
|
|
125
|
+
padding-block: 28px 24px;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
.sidebar {
|
|
@@ -132,7 +132,7 @@ html.is-animating .transition-scale {
|
|
|
132
132
|
|
|
133
133
|
.content {
|
|
134
134
|
min-width: 0;
|
|
135
|
-
padding-block:
|
|
135
|
+
padding-block: 28px 64px;
|
|
136
136
|
line-height: 1.65;
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -145,16 +145,36 @@ html.is-animating .transition-scale {
|
|
|
145
145
|
font-family: var(--ld-font-heading);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
.content article :where(h1, h2, h3, h4, h5, h6) {
|
|
149
|
+
margin-block: 2em 0.667em;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.content article p {
|
|
153
|
+
margin-block: 1.25em;
|
|
154
|
+
}
|
|
155
|
+
|
|
148
156
|
.content img {
|
|
149
157
|
max-width: 100%;
|
|
150
158
|
height: auto;
|
|
151
159
|
}
|
|
152
160
|
|
|
161
|
+
.content article {
|
|
162
|
+
max-width: 60ch;
|
|
163
|
+
font-size: 110%;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.groupBreadcrumbs {
|
|
167
|
+
margin: 0 0 -4px;
|
|
168
|
+
color: var(--ld-color-accent);
|
|
169
|
+
font-size: 80%;
|
|
170
|
+
font-weight: 700;
|
|
171
|
+
}
|
|
172
|
+
|
|
153
173
|
.content article li {
|
|
154
|
-
margin-
|
|
174
|
+
margin-block: 1em;
|
|
155
175
|
}
|
|
156
176
|
|
|
157
|
-
.content
|
|
177
|
+
.content :first-child {
|
|
158
178
|
margin-top: 0;
|
|
159
179
|
}
|
|
160
180
|
|
|
@@ -220,11 +240,12 @@ html.is-animating .transition-scale {
|
|
|
220
240
|
.navFolder {
|
|
221
241
|
display: block;
|
|
222
242
|
padding: 6px 8px;
|
|
223
|
-
border-radius: 6px;
|
|
224
243
|
}
|
|
225
244
|
|
|
226
245
|
.navList a,
|
|
227
246
|
.navDisclosure summary {
|
|
247
|
+
padding-left: 7px;
|
|
248
|
+
border-left: 1px solid color-mix(in srgb, var(--ld-color-border) 65%, transparent);
|
|
228
249
|
color: var(--ld-color-muted-text);
|
|
229
250
|
text-decoration: none;
|
|
230
251
|
}
|
|
@@ -263,9 +284,9 @@ html.is-animating .transition-scale {
|
|
|
263
284
|
|
|
264
285
|
.navList a.active,
|
|
265
286
|
.navDisclosure summary.active {
|
|
266
|
-
color: var(--ld-color-
|
|
267
|
-
|
|
268
|
-
font-weight:
|
|
287
|
+
border-left-color: var(--ld-color-accent);
|
|
288
|
+
color: var(--ld-color-accent);
|
|
289
|
+
font-weight: 550;
|
|
269
290
|
}
|
|
270
291
|
|
|
271
292
|
.content pre {
|
|
@@ -399,6 +420,7 @@ html.is-animating .transition-scale {
|
|
|
399
420
|
|
|
400
421
|
.markdown-alert-icon {
|
|
401
422
|
flex: 0 0 auto;
|
|
423
|
+
font-size: 20px;
|
|
402
424
|
}
|
|
403
425
|
|
|
404
426
|
.markdown-alert-note {
|
|
@@ -486,7 +508,7 @@ html.is-animating .transition-scale {
|
|
|
486
508
|
|
|
487
509
|
.toc ul {
|
|
488
510
|
display: grid;
|
|
489
|
-
gap:
|
|
511
|
+
gap: 9px;
|
|
490
512
|
list-style: none;
|
|
491
513
|
padding-left: 0;
|
|
492
514
|
}
|
|
@@ -557,21 +579,6 @@ html.is-animating .transition-scale {
|
|
|
557
579
|
transform: translateY(-50%);
|
|
558
580
|
}
|
|
559
581
|
|
|
560
|
-
.material-symbols-rounded {
|
|
561
|
-
font-family: "Material Symbols Rounded";
|
|
562
|
-
font-weight: normal;
|
|
563
|
-
font-style: normal;
|
|
564
|
-
font-size: 20px;
|
|
565
|
-
line-height: 1;
|
|
566
|
-
letter-spacing: normal;
|
|
567
|
-
text-transform: none;
|
|
568
|
-
white-space: nowrap;
|
|
569
|
-
word-wrap: normal;
|
|
570
|
-
direction: ltr;
|
|
571
|
-
font-feature-settings: "liga";
|
|
572
|
-
-webkit-font-smoothing: antialiased;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
582
|
.searchBox input {
|
|
576
583
|
box-sizing: border-box;
|
|
577
584
|
width: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lildocs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "A lightweight CLI that turns Markdown docs into a static searchable documentation site.",
|
|
5
5
|
"homepage": "https://aleclarson.github.io/lildocs/",
|
|
6
6
|
"repository": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@goddard-ai/ui-primitives": "^0.1.1",
|
|
28
28
|
"@preact/signals": "^2.9.2",
|
|
29
|
+
"@tabler/icons-webfont": "^3.44.0",
|
|
29
30
|
"beautiful-mermaid": "^1.1.3",
|
|
30
31
|
"cmd-ts": "^0.15.0",
|
|
31
32
|
"culori": "^4.0.2",
|