@t8/docsgen 0.4.1 → 0.4.2

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
@@ -810,10 +810,15 @@ ${navContent}
810
810
  </nav>`;
811
811
  }
812
812
 
813
+ // src/bin/content/tweakTypography.ts
814
+ function tweakTypography(s = "") {
815
+ return s.replace(/\b(for|in|on|at|to|with|a|an|the|its)\s+/gi, "$1\xA0").replace(/\b(React)\s+(apps?)\b/gi, "$1\xA0$2");
816
+ }
817
+
813
818
  // src/bin/content/getSectionContent.ts
814
819
  async function getSectionContent(ctx, index) {
815
820
  let { root, contentDir = "" } = ctx;
816
- let escapedPackageDescription = escapeHTML(ctx.description);
821
+ let escapedPackageDescription = escapeHTML(tweakTypography(ctx.description));
817
822
  let cssRoot = await getCSSRoot(ctx, "content");
818
823
  let { sections, nav } = await getParsedContent(ctx);
819
824
  let content = sections[index];
@@ -15,10 +15,23 @@ header {
15
15
  padding-bottom: 0.5em;
16
16
  }
17
17
  header h1 {
18
- font-size: 1.25em;
18
+ font-size: 1.3rem;
19
19
  font-weight: 900;
20
+ color: var(--aux-emphatic-color);
20
21
  margin: 0;
21
22
  }
23
+ header h1 > a,
24
+ header h1 > a:link,
25
+ header h1 > a:hover,
26
+ header h1 > a:visited,
27
+ header h1 > a:active {
28
+ --color: var(--aux-emphatic-color);
29
+ text-decoration: underline;
30
+ border-bottom: none;
31
+ }
32
+ header h1 sup {
33
+ font-size: 0.5em;
34
+ }
22
35
  header .description {
23
36
  font-size: 0.8em;
24
37
  margin-top: 0.15em;
@@ -87,8 +100,9 @@ aside > .header .installation code {
87
100
  margin: 0;
88
101
  }
89
102
  aside h1 {
90
- font-size: 1.35em;
103
+ font-size: 1.3rem;
91
104
  font-weight: 900;
105
+ color: var(--aux-emphatic-color);
92
106
  margin: 0;
93
107
  }
94
108
  aside h1 > a,
@@ -96,7 +110,7 @@ aside h1 > a:link,
96
110
  aside h1 > a:hover,
97
111
  aside h1 > a:visited,
98
112
  aside h1 > a:active {
99
- --color: var(--aux-color);
113
+ --color: var(--aux-emphatic-color);
100
114
  text-decoration: underline;
101
115
  border-bottom: none;
102
116
  }
@@ -251,6 +265,7 @@ main h1 + h2 {
251
265
  margin-top: 0.5rem;
252
266
  }
253
267
  main h2 {
268
+ font-weight: 900;
254
269
  border-bottom: var(--sep-line);
255
270
  padding-bottom: 0.1em;
256
271
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/docsgen",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "",
5
5
  "main": "dist/bin.js",
6
6
  "type": "module",
@@ -14,10 +14,11 @@ import { getMainTitle } from "./getMainTitle.ts";
14
14
  import { getNav } from "./getNav.ts";
15
15
  import { getPlainTitle } from "./getPlainTitle.ts";
16
16
  import { toFileContent } from "./toFileContent.ts";
17
+ import { tweakTypography } from "./tweakTypography.ts";
17
18
 
18
19
  export async function getSectionContent(ctx: Context, index: number) {
19
20
  let { root, contentDir = "" } = ctx;
20
- let escapedPackageDescription = escapeHTML(ctx.description);
21
+ let escapedPackageDescription = escapeHTML(tweakTypography(ctx.description));
21
22
 
22
23
  let cssRoot = await getCSSRoot(ctx, "content");
23
24
  let { sections, nav } = await getParsedContent(ctx);
@@ -15,10 +15,23 @@ header {
15
15
  padding-bottom: 0.5em;
16
16
  }
17
17
  header h1 {
18
- font-size: 1.25em;
18
+ font-size: 1.3rem;
19
19
  font-weight: 900;
20
+ color: var(--aux-emphatic-color);
20
21
  margin: 0;
21
22
  }
23
+ header h1 > a,
24
+ header h1 > a:link,
25
+ header h1 > a:hover,
26
+ header h1 > a:visited,
27
+ header h1 > a:active {
28
+ --color: var(--aux-emphatic-color);
29
+ text-decoration: underline;
30
+ border-bottom: none;
31
+ }
32
+ header h1 sup {
33
+ font-size: 0.5em;
34
+ }
22
35
  header .description {
23
36
  font-size: 0.8em;
24
37
  margin-top: 0.15em;
@@ -87,8 +100,9 @@ aside > .header .installation code {
87
100
  margin: 0;
88
101
  }
89
102
  aside h1 {
90
- font-size: 1.35em;
103
+ font-size: 1.3rem;
91
104
  font-weight: 900;
105
+ color: var(--aux-emphatic-color);
92
106
  margin: 0;
93
107
  }
94
108
  aside h1 > a,
@@ -96,7 +110,7 @@ aside h1 > a:link,
96
110
  aside h1 > a:hover,
97
111
  aside h1 > a:visited,
98
112
  aside h1 > a:active {
99
- --color: var(--aux-color);
113
+ --color: var(--aux-emphatic-color);
100
114
  text-decoration: underline;
101
115
  border-bottom: none;
102
116
  }
@@ -251,6 +265,7 @@ main h1 + h2 {
251
265
  margin-top: 0.5rem;
252
266
  }
253
267
  main h2 {
268
+ font-weight: 900;
254
269
  border-bottom: var(--sep-line);
255
270
  padding-bottom: 0.1em;
256
271
  }