@t8/docsgen 0.1.16 → 0.1.18
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/bin.js +7 -9
- package/dist/css/base.css +1 -1
- package/package.json +1 -1
- package/src/bin/setContent.ts +4 -3
- package/src/bin/setImages.ts +2 -5
- package/src/css/base.css +1 -1
- package/src/types/EntryConfig.ts +1 -1
package/dist/bin.js
CHANGED
|
@@ -520,7 +520,7 @@ var exec = (0, import_node_util.promisify)(import_node_child_process.exec);
|
|
|
520
520
|
async function setContent(ctx) {
|
|
521
521
|
let {
|
|
522
522
|
dir = "",
|
|
523
|
-
|
|
523
|
+
baseColor,
|
|
524
524
|
theme,
|
|
525
525
|
root,
|
|
526
526
|
contentDir = "",
|
|
@@ -537,8 +537,7 @@ async function setContent(ctx) {
|
|
|
537
537
|
let packageUrl = `https://unpkg.com/${packageName}@${packageVersion}`;
|
|
538
538
|
let rootAttrs = "";
|
|
539
539
|
if (theme) rootAttrs += ` data-theme="${escapeHTML(theme)}"`;
|
|
540
|
-
if (
|
|
541
|
-
rootAttrs += ` style="--color-scheme: ${escapeHTML(colorScheme)}"`;
|
|
540
|
+
if (baseColor) rootAttrs += ` style="--base-color: ${escapeHTML(baseColor)}"`;
|
|
542
541
|
let icon = getIcon(ctx);
|
|
543
542
|
let iconTag = icon.url ? `<link rel="icon"${icon.type ? ` type="${icon.type}"` : ""} href="${icon.url}">` : "";
|
|
544
543
|
if (redirect) {
|
|
@@ -586,6 +585,7 @@ ${counterContent}
|
|
|
586
585
|
<head>
|
|
587
586
|
<meta charset="utf-8">
|
|
588
587
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
588
|
+
<meta name="description" content="${escapedTitle}: ${escapeHTML(nav[i]?.title)}">
|
|
589
589
|
<title>${escapeHTML(nav[i]?.title)} | ${escapedTitle}</title>
|
|
590
590
|
<link rel="stylesheet" href="${packageUrl}/dist/css/base.css">
|
|
591
591
|
<link rel="stylesheet" href="${packageUrl}/dist/css/section.css">
|
|
@@ -639,6 +639,7 @@ ${counterContent}
|
|
|
639
639
|
<head>
|
|
640
640
|
<meta charset="utf-8">
|
|
641
641
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
642
|
+
<meta name="description" content="${escapedTitle}${packageDescription ? `: ${escapeHTML(packageDescription)}` : ""}">
|
|
642
643
|
<title>${escapedTitle}${packageDescription ? ` | ${escapeHTML(packageDescription)}` : ""}</title>
|
|
643
644
|
<link rel="stylesheet" href="${packageUrl}/dist/css/base.css">
|
|
644
645
|
<link rel="stylesheet" href="${packageUrl}/dist/css/index.css">
|
|
@@ -735,13 +736,10 @@ function getIconContent(baseColor = "gray") {
|
|
|
735
736
|
}
|
|
736
737
|
|
|
737
738
|
// src/bin/setImages.ts
|
|
738
|
-
async function setImages({ dir = "",
|
|
739
|
+
async function setImages({ dir = "", baseColor, favicon }) {
|
|
739
740
|
if (favicon) return;
|
|
740
|
-
await (0, import_promises5.writeFile)(
|
|
741
|
-
|
|
742
|
-
`${getIconContent(colorScheme)}
|
|
743
|
-
`
|
|
744
|
-
);
|
|
741
|
+
await (0, import_promises5.writeFile)((0, import_node_path4.join)(dir, "./favicon.svg"), `${getIconContent(baseColor)}
|
|
742
|
+
`);
|
|
745
743
|
}
|
|
746
744
|
|
|
747
745
|
// src/bin/createFiles.ts
|
package/dist/css/base.css
CHANGED
package/package.json
CHANGED
package/src/bin/setContent.ts
CHANGED
|
@@ -19,7 +19,7 @@ const exec = promisify(defaultExec);
|
|
|
19
19
|
export async function setContent(ctx: Context) {
|
|
20
20
|
let {
|
|
21
21
|
dir = "",
|
|
22
|
-
|
|
22
|
+
baseColor,
|
|
23
23
|
theme,
|
|
24
24
|
root,
|
|
25
25
|
contentDir = "",
|
|
@@ -45,8 +45,7 @@ export async function setContent(ctx: Context) {
|
|
|
45
45
|
|
|
46
46
|
if (theme) rootAttrs += ` data-theme="${escapeHTML(theme)}"`;
|
|
47
47
|
|
|
48
|
-
if (
|
|
49
|
-
rootAttrs += ` style="--color-scheme: ${escapeHTML(colorScheme)}"`;
|
|
48
|
+
if (baseColor) rootAttrs += ` style="--base-color: ${escapeHTML(baseColor)}"`;
|
|
50
49
|
|
|
51
50
|
let icon = getIcon(ctx);
|
|
52
51
|
let iconTag = icon.url
|
|
@@ -106,6 +105,7 @@ ${counterContent}
|
|
|
106
105
|
<head>
|
|
107
106
|
<meta charset="utf-8">
|
|
108
107
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
108
|
+
<meta name="description" content="${escapedTitle}: ${escapeHTML(nav[i]?.title)}">
|
|
109
109
|
<title>${escapeHTML(nav[i]?.title)} | ${escapedTitle}</title>
|
|
110
110
|
<link rel="stylesheet" href="${packageUrl}/dist/css/base.css">
|
|
111
111
|
<link rel="stylesheet" href="${packageUrl}/dist/css/section.css">
|
|
@@ -163,6 +163,7 @@ ${counterContent}
|
|
|
163
163
|
<head>
|
|
164
164
|
<meta charset="utf-8">
|
|
165
165
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
166
|
+
<meta name="description" content="${escapedTitle}${packageDescription ? `: ${escapeHTML(packageDescription)}` : ""}">
|
|
166
167
|
<title>${escapedTitle}${packageDescription ? ` | ${escapeHTML(packageDescription)}` : ""}</title>
|
|
167
168
|
<link rel="stylesheet" href="${packageUrl}/dist/css/base.css">
|
|
168
169
|
<link rel="stylesheet" href="${packageUrl}/dist/css/index.css">
|
package/src/bin/setImages.ts
CHANGED
|
@@ -3,11 +3,8 @@ import { join } from "node:path";
|
|
|
3
3
|
import type { Context } from "../types/Context";
|
|
4
4
|
import { getIconContent } from "../utils/getIconContent";
|
|
5
5
|
|
|
6
|
-
export async function setImages({ dir = "",
|
|
6
|
+
export async function setImages({ dir = "", baseColor, favicon }: Context) {
|
|
7
7
|
if (favicon) return;
|
|
8
8
|
|
|
9
|
-
await writeFile(
|
|
10
|
-
join(dir, "./favicon.svg"),
|
|
11
|
-
`${getIconContent(colorScheme)}\n`,
|
|
12
|
-
);
|
|
9
|
+
await writeFile(join(dir, "./favicon.svg"), `${getIconContent(baseColor)}\n`);
|
|
13
10
|
}
|
package/src/css/base.css
CHANGED