@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 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
- colorScheme,
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 (colorScheme)
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 = "", colorScheme, favicon }) {
739
+ async function setImages({ dir = "", baseColor, favicon }) {
739
740
  if (favicon) return;
740
- await (0, import_promises5.writeFile)(
741
- (0, import_node_path4.join)(dir, "./favicon.svg"),
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
@@ -2,7 +2,7 @@
2
2
  color-scheme: light dark;
3
3
 
4
4
  --b0: light-dark(white, #1a1a1a);
5
- --b1: var(--color-scheme, gray);
5
+ --b1: var(--base-color, gray);
6
6
  --link-color: light-dark(royalblue, deepskyblue);
7
7
  --button-color: light-dark(royalblue, royalblue);
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/docsgen",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "",
5
5
  "main": "dist/bin.js",
6
6
  "bin": {
@@ -19,7 +19,7 @@ const exec = promisify(defaultExec);
19
19
  export async function setContent(ctx: Context) {
20
20
  let {
21
21
  dir = "",
22
- colorScheme,
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 (colorScheme)
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">
@@ -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 = "", colorScheme, favicon }: Context) {
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
@@ -2,7 +2,7 @@
2
2
  color-scheme: light dark;
3
3
 
4
4
  --b0: light-dark(white, #1a1a1a);
5
- --b1: var(--color-scheme, gray);
5
+ --b1: var(--base-color, gray);
6
6
  --link-color: light-dark(royalblue, deepskyblue);
7
7
  --button-color: light-dark(royalblue, royalblue);
8
8
 
@@ -4,7 +4,7 @@ export type EntryConfig = {
4
4
  id?: string;
5
5
  source?: string;
6
6
  dir?: string;
7
- colorScheme?: string;
7
+ baseColor?: string;
8
8
  theme?: Theme;
9
9
  name?: string;
10
10
  title?: string;