lildocs 0.1.6 → 0.1.7
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 +1 -1
- package/dist/cli.mjs +8 -20
- package/dist/render/styles.css +13 -1
- package/dist/render/tabler-icons.css +46 -0
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ The project uses:
|
|
|
60
60
|
- `cmd-ts` for CLI parsing
|
|
61
61
|
- Preact SSR for rendering
|
|
62
62
|
- `marked` and `gray-matter` for Markdown and frontmatter
|
|
63
|
-
- `
|
|
63
|
+
- native dynamic `import()` for local theme loading
|
|
64
64
|
- `tsdown` for bundling
|
|
65
65
|
- `oxlint` for linting
|
|
66
66
|
- `oxfmt` for formatting
|
package/dist/cli.mjs
CHANGED
|
@@ -15,7 +15,6 @@ import { renderMermaidSVG } from "beautiful-mermaid";
|
|
|
15
15
|
import os from "node:os";
|
|
16
16
|
import { generateMarkdownForModule } from "exports-md";
|
|
17
17
|
import { clampGamut, converter, formatHex, parse, wcagContrast } from "culori";
|
|
18
|
-
import { createJiti } from "jiti";
|
|
19
18
|
import { render } from "preact-render-to-string";
|
|
20
19
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
21
20
|
import http from "node:http";
|
|
@@ -997,7 +996,12 @@ async function resolveTheme(options) {
|
|
|
997
996
|
};
|
|
998
997
|
}
|
|
999
998
|
const localThemePath = path.join(options.docsRoot, "theme.ts");
|
|
1000
|
-
if (await exists(localThemePath))
|
|
999
|
+
if (await exists(localThemePath)) {
|
|
1000
|
+
const localThemeUrl = pathToFileURL(localThemePath);
|
|
1001
|
+
const localThemeStats = await stat(localThemePath);
|
|
1002
|
+
localThemeUrl.searchParams.set("mtime", String(localThemeStats.mtimeMs));
|
|
1003
|
+
return { light: validateTheme((await import(localThemeUrl.href)).default, localThemePath) };
|
|
1004
|
+
}
|
|
1001
1005
|
return {
|
|
1002
1006
|
light: themes.default,
|
|
1003
1007
|
dark: await resolveThemeName("github-dark")
|
|
@@ -1623,7 +1627,6 @@ async function buildSite(options) {
|
|
|
1623
1627
|
const packageName = await resolvePackageName(packagePath);
|
|
1624
1628
|
const projectName = configOptions.projectName ?? packageName;
|
|
1625
1629
|
const theme = await resolveTheme({
|
|
1626
|
-
cwd: options.cwd,
|
|
1627
1630
|
docsRoot: input.docsRoot,
|
|
1628
1631
|
requestedTheme: configOptions.theme
|
|
1629
1632
|
});
|
|
@@ -1634,7 +1637,7 @@ async function buildSite(options) {
|
|
|
1634
1637
|
fonts: configOptions.fonts
|
|
1635
1638
|
});
|
|
1636
1639
|
const baseCss = await readRenderAsset("styles.css");
|
|
1637
|
-
const tablerIconsCss = await
|
|
1640
|
+
const tablerIconsCss = await readRenderAsset("tabler-icons.css");
|
|
1638
1641
|
const searchScript = await readRenderAsset("search.js");
|
|
1639
1642
|
const copyCodeScript = await readRenderAsset("copy-code.js");
|
|
1640
1643
|
const navigationScript = await readRenderAsset("navigation.js");
|
|
@@ -1656,7 +1659,6 @@ async function buildSite(options) {
|
|
|
1656
1659
|
});
|
|
1657
1660
|
const css = `${fontResolution.css}${themeToCssVariables(theme, fontResolution.themeFonts, configOptions.link, configOptions.navigation)}\n${backgroundResolution.css}${logoResolution.css}${baseCss}`;
|
|
1658
1661
|
const assets = [
|
|
1659
|
-
...tablerIconFontAssets(outDir),
|
|
1660
1662
|
...fontResolution.assets,
|
|
1661
1663
|
...backgroundResolution.assets,
|
|
1662
1664
|
...logoResolution.assets
|
|
@@ -1757,20 +1759,6 @@ async function readRenderAsset(name) {
|
|
|
1757
1759
|
async function readSwupAsset() {
|
|
1758
1760
|
return readFile(path.join(path.dirname(require.resolve("swup")), "Swup.umd.js"), "utf8");
|
|
1759
1761
|
}
|
|
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
|
-
}
|
|
1774
1762
|
function buildPageNavigation(pages) {
|
|
1775
1763
|
const navigation = /* @__PURE__ */ new Map();
|
|
1776
1764
|
if (pages.length < 2) return navigation;
|
|
@@ -2119,7 +2107,7 @@ const fontCodeOption = option({
|
|
|
2119
2107
|
const backgroundImageOption = option({
|
|
2120
2108
|
type: optional(string),
|
|
2121
2109
|
long: "background.image",
|
|
2122
|
-
description: "Background image URL or docs-relative image path."
|
|
2110
|
+
description: "Background image URL, CSS image function, or docs-relative image path."
|
|
2123
2111
|
});
|
|
2124
2112
|
const backgroundGradientOption = option({
|
|
2125
2113
|
type: optional(string),
|
package/dist/render/styles.css
CHANGED
|
@@ -160,7 +160,7 @@ html.is-animating .transition-scale {
|
|
|
160
160
|
|
|
161
161
|
.content article {
|
|
162
162
|
max-width: 60ch;
|
|
163
|
-
font-size:
|
|
163
|
+
font-size: 105%;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
.groupBreadcrumbs {
|
|
@@ -187,6 +187,18 @@ html.is-animating .transition-scale {
|
|
|
187
187
|
color: var(--ld-color-muted-text);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
.content article h1 + blockquote {
|
|
191
|
+
margin: 0 0 1.5em;
|
|
192
|
+
margin-top: -1.1em;
|
|
193
|
+
padding: 0;
|
|
194
|
+
border-left: 0;
|
|
195
|
+
border-radius: 0;
|
|
196
|
+
background: transparent;
|
|
197
|
+
color: color-mix(in srgb, var(--ld-color-muted-text) 88%, var(--ld-color-text));
|
|
198
|
+
font-size: 1.15em;
|
|
199
|
+
line-height: 1.45;
|
|
200
|
+
}
|
|
201
|
+
|
|
190
202
|
.content blockquote > :first-child {
|
|
191
203
|
margin-top: 0;
|
|
192
204
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Tabler Icons 3.44.0, MIT License.
|
|
3
|
+
* Bundles only the icon masks used by lildocs.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.ti {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
width: 1em;
|
|
9
|
+
height: 1em;
|
|
10
|
+
background: currentColor;
|
|
11
|
+
vertical-align: -0.125em;
|
|
12
|
+
mask: var(--ld-tabler-icon) center / contain no-repeat;
|
|
13
|
+
-webkit-mask: var(--ld-tabler-icon) center / contain no-repeat;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ti-search {
|
|
17
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M3%2010a7%207%200%201%200%2014%200a7%207%200%201%200%20-14%200%22%20%2F%3E%3Cpath%20d%3D%22M21%2021l-6%20-6%22%20%2F%3E%3C%2Fsvg%3E");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ti-copy {
|
|
21
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M7%209.667a2.667%202.667%200%200%201%202.667%20-2.667h8.666a2.667%202.667%200%200%201%202.667%202.667v8.666a2.667%202.667%200%200%201%20-2.667%202.667h-8.666a2.667%202.667%200%200%201%20-2.667%20-2.667l0%20-8.666%22%20%2F%3E%3Cpath%20d%3D%22M4.012%2016.737a2.005%202.005%200%200%201%20-1.012%20-1.737v-10c0%20-1.1%20.9%20-2%202%20-2h10c.75%200%201.158%20.385%201.5%201%22%20%2F%3E%3C%2Fsvg%3E");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ti-copy-check {
|
|
25
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M7%209.667a2.667%202.667%200%200%201%202.667%20-2.667h8.666a2.667%202.667%200%200%201%202.667%202.667v8.666a2.667%202.667%200%200%201%20-2.667%202.667h-8.666a2.667%202.667%200%200%201%20-2.667%20-2.667l0%20-8.666%22%20%2F%3E%3Cpath%20d%3D%22M4.012%2016.737a2%202%200%200%201%20-1.012%20-1.737v-10c0%20-1.1%20.9%20-2%202%20-2h10c.75%200%201.158%20.385%201.5%201%22%20%2F%3E%3Cpath%20d%3D%22M11%2014l2%202l4%20-4%22%20%2F%3E%3C%2Fsvg%3E");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ti-alert-circle {
|
|
29
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M3%2012a9%209%200%201%200%2018%200a9%209%200%200%200%20-18%200%22%20%2F%3E%3Cpath%20d%3D%22M12%208v4%22%20%2F%3E%3Cpath%20d%3D%22M12%2016h.01%22%20%2F%3E%3C%2Fsvg%3E");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ti-alert-triangle {
|
|
33
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M12%209v4%22%20%2F%3E%3Cpath%20d%3D%22M10.363%203.591l-8.106%2013.534a1.914%201.914%200%200%200%201.636%202.871h16.214a1.914%201.914%200%200%200%201.636%20-2.87l-8.106%20-13.536a1.914%201.914%200%200%200%20-3.274%200%22%20%2F%3E%3Cpath%20d%3D%22M12%2016h.01%22%20%2F%3E%3C%2Fsvg%3E");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ti-info-circle {
|
|
37
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M3%2012a9%209%200%201%200%2018%200a9%209%200%200%200%20-18%200%22%20%2F%3E%3Cpath%20d%3D%22M12%209h.01%22%20%2F%3E%3Cpath%20d%3D%22M11%2012h1v4h1%22%20%2F%3E%3C%2Fsvg%3E");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ti-bulb {
|
|
41
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M3%2012h1m8%20-9v1m8%208h1m-15.4%20-6.4l.7%20.7m12.1%20-.7l-.7%20.7%22%20%2F%3E%3Cpath%20d%3D%22M9%2016a5%205%200%201%201%206%200a3.5%203.5%200%200%200%20-1%203a2%202%200%200%201%20-4%200a3.5%203.5%200%200%200%20-1%20-3%22%20%2F%3E%3Cpath%20d%3D%22M9.7%2017l4.6%200%22%20%2F%3E%3C%2Fsvg%3E");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ti-message-report {
|
|
45
|
+
--ld-tabler-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%20%2F%3E%3Cpath%20d%3D%22M18%204a3%203%200%200%201%203%203v8a3%203%200%200%201%20-3%203h-5l-5%203v-3h-2a3%203%200%200%201%20-3%20-3v-8a3%203%200%200%201%203%20-3h12%22%20%2F%3E%3Cpath%20d%3D%22M12%208v3%22%20%2F%3E%3Cpath%20d%3D%22M12%2014v.01%22%20%2F%3E%3C%2Fsvg%3E");
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lildocs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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,13 +26,11 @@
|
|
|
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",
|
|
30
29
|
"beautiful-mermaid": "^1.1.3",
|
|
31
30
|
"cmd-ts": "^0.15.0",
|
|
32
31
|
"culori": "^4.0.2",
|
|
33
32
|
"exports-md": "^0.1.7",
|
|
34
33
|
"gray-matter": "^4.0.3",
|
|
35
|
-
"jiti": "^2.7.0",
|
|
36
34
|
"marked": "^18.0.3",
|
|
37
35
|
"marked-shiki": "^1.2.1",
|
|
38
36
|
"preact": "^10.29.2",
|
|
@@ -50,7 +48,7 @@
|
|
|
50
48
|
"typescript": "^5.9.0"
|
|
51
49
|
},
|
|
52
50
|
"engines": {
|
|
53
|
-
"node": "^22.18.0 || >=24.
|
|
51
|
+
"node": "^22.18.0 || >=24.3.0"
|
|
54
52
|
},
|
|
55
53
|
"packageManager": "pnpm@10.29.3"
|
|
56
54
|
}
|