lildocs 0.1.4 → 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 +21 -4
- package/dist/render/styles.css +22 -10
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -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};
|
|
@@ -1400,6 +1401,10 @@ function Layout({ page, nav, pageNavigation, css, searchIndexJson, logo, favicon
|
|
|
1400
1401
|
rel: "icon",
|
|
1401
1402
|
href: assetSrc(page.route, favicon)
|
|
1402
1403
|
}) : null,
|
|
1404
|
+
/* @__PURE__ */ jsx("link", {
|
|
1405
|
+
rel: "stylesheet",
|
|
1406
|
+
href: rootRelativeUrl(page.route, "assets/tabler-icons.css")
|
|
1407
|
+
}),
|
|
1403
1408
|
/* @__PURE__ */ jsx("link", {
|
|
1404
1409
|
rel: "stylesheet",
|
|
1405
1410
|
href: rootRelativeUrl(page.route, "assets/lildocs.css")
|
|
@@ -1460,7 +1465,7 @@ function Layout({ page, nav, pageNavigation, css, searchIndexJson, logo, favicon
|
|
|
1460
1465
|
}),
|
|
1461
1466
|
/* @__PURE__ */ jsxs("main", {
|
|
1462
1467
|
className: `content transition-${transition}`,
|
|
1463
|
-
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 })]
|
|
1464
1469
|
}),
|
|
1465
1470
|
/* @__PURE__ */ jsx("aside", {
|
|
1466
1471
|
className: `toc transition-${transition}`,
|
|
@@ -1495,6 +1500,17 @@ function assetSrc(pageRoute, image) {
|
|
|
1495
1500
|
if (/^(?:[a-z]+:)?\/\//i.test(image) || image.startsWith("data:") || image.startsWith("/")) return image;
|
|
1496
1501
|
return rootRelativeUrl(pageRoute, image);
|
|
1497
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
|
+
}
|
|
1498
1514
|
function PageNav({ pageNavigation }) {
|
|
1499
1515
|
if (!pageNavigation?.previous && !pageNavigation?.next) return null;
|
|
1500
1516
|
return /* @__PURE__ */ jsxs("nav", {
|
|
@@ -1638,7 +1654,7 @@ async function buildSite(options) {
|
|
|
1638
1654
|
defaultText: packageName,
|
|
1639
1655
|
favicon: configOptions.favicon
|
|
1640
1656
|
});
|
|
1641
|
-
const css = `${
|
|
1657
|
+
const css = `${fontResolution.css}${themeToCssVariables(theme, fontResolution.themeFonts, configOptions.link, configOptions.navigation)}\n${backgroundResolution.css}${logoResolution.css}${baseCss}`;
|
|
1642
1658
|
const assets = [
|
|
1643
1659
|
...tablerIconFontAssets(outDir),
|
|
1644
1660
|
...fontResolution.assets,
|
|
@@ -1675,6 +1691,7 @@ async function buildSite(options) {
|
|
|
1675
1691
|
await writeFile(outputPath, html);
|
|
1676
1692
|
}));
|
|
1677
1693
|
await writeFile(path.join(outDir, "assets", "lildocs.css"), css);
|
|
1694
|
+
await writeFile(path.join(outDir, "assets", "tabler-icons.css"), tablerIconsCss);
|
|
1678
1695
|
await writeFile(path.join(outDir, "assets", "search.js"), searchScript);
|
|
1679
1696
|
await writeFile(path.join(outDir, "assets", "copy-code.js"), copyCodeScript);
|
|
1680
1697
|
await writeFile(path.join(outDir, "assets", "swup.umd.js"), swupScript);
|
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
|
|
|
@@ -146,7 +146,11 @@ html.is-animating .transition-scale {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
.content article :where(h1, h2, h3, h4, h5, h6) {
|
|
149
|
-
margin-block:
|
|
149
|
+
margin-block: 2em 0.667em;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.content article p {
|
|
153
|
+
margin-block: 1.25em;
|
|
150
154
|
}
|
|
151
155
|
|
|
152
156
|
.content img {
|
|
@@ -159,11 +163,18 @@ html.is-animating .transition-scale {
|
|
|
159
163
|
font-size: 110%;
|
|
160
164
|
}
|
|
161
165
|
|
|
166
|
+
.groupBreadcrumbs {
|
|
167
|
+
margin: 0 0 -4px;
|
|
168
|
+
color: var(--ld-color-accent);
|
|
169
|
+
font-size: 80%;
|
|
170
|
+
font-weight: 700;
|
|
171
|
+
}
|
|
172
|
+
|
|
162
173
|
.content article li {
|
|
163
|
-
margin-
|
|
174
|
+
margin-block: 1em;
|
|
164
175
|
}
|
|
165
176
|
|
|
166
|
-
.content
|
|
177
|
+
.content :first-child {
|
|
167
178
|
margin-top: 0;
|
|
168
179
|
}
|
|
169
180
|
|
|
@@ -229,11 +240,12 @@ html.is-animating .transition-scale {
|
|
|
229
240
|
.navFolder {
|
|
230
241
|
display: block;
|
|
231
242
|
padding: 6px 8px;
|
|
232
|
-
border-radius: 6px;
|
|
233
243
|
}
|
|
234
244
|
|
|
235
245
|
.navList a,
|
|
236
246
|
.navDisclosure summary {
|
|
247
|
+
padding-left: 7px;
|
|
248
|
+
border-left: 1px solid color-mix(in srgb, var(--ld-color-border) 65%, transparent);
|
|
237
249
|
color: var(--ld-color-muted-text);
|
|
238
250
|
text-decoration: none;
|
|
239
251
|
}
|
|
@@ -272,9 +284,9 @@ html.is-animating .transition-scale {
|
|
|
272
284
|
|
|
273
285
|
.navList a.active,
|
|
274
286
|
.navDisclosure summary.active {
|
|
275
|
-
color: var(--ld-color-
|
|
276
|
-
|
|
277
|
-
font-weight:
|
|
287
|
+
border-left-color: var(--ld-color-accent);
|
|
288
|
+
color: var(--ld-color-accent);
|
|
289
|
+
font-weight: 550;
|
|
278
290
|
}
|
|
279
291
|
|
|
280
292
|
.content pre {
|
|
@@ -496,7 +508,7 @@ html.is-animating .transition-scale {
|
|
|
496
508
|
|
|
497
509
|
.toc ul {
|
|
498
510
|
display: grid;
|
|
499
|
-
gap:
|
|
511
|
+
gap: 9px;
|
|
500
512
|
list-style: none;
|
|
501
513
|
padding-left: 0;
|
|
502
514
|
}
|
package/package.json
CHANGED