@t8/docsgen 0.4.0 → 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 +6 -1
- package/dist/css/section.css +32 -10
- package/package.json +1 -1
- package/src/bin/content/getSectionContent.ts +2 -1
- package/src/css/section.css +32 -10
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];
|
package/dist/css/section.css
CHANGED
|
@@ -15,10 +15,23 @@ header {
|
|
|
15
15
|
padding-bottom: 0.5em;
|
|
16
16
|
}
|
|
17
17
|
header h1 {
|
|
18
|
-
font-size: 1.
|
|
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,10 +100,26 @@ aside > .header .installation code {
|
|
|
87
100
|
margin: 0;
|
|
88
101
|
}
|
|
89
102
|
aside h1 {
|
|
90
|
-
font-size: 1.
|
|
103
|
+
font-size: 1.3rem;
|
|
91
104
|
font-weight: 900;
|
|
105
|
+
color: var(--aux-emphatic-color);
|
|
92
106
|
margin: 0;
|
|
93
107
|
}
|
|
108
|
+
aside h1 > a,
|
|
109
|
+
aside h1 > a:link,
|
|
110
|
+
aside h1 > a:hover,
|
|
111
|
+
aside h1 > a:visited,
|
|
112
|
+
aside h1 > a:active {
|
|
113
|
+
--color: var(--aux-emphatic-color);
|
|
114
|
+
text-decoration: underline;
|
|
115
|
+
border-bottom: none;
|
|
116
|
+
}
|
|
117
|
+
aside h1 sup {
|
|
118
|
+
font-size: 0.5em;
|
|
119
|
+
}
|
|
120
|
+
aside nav {
|
|
121
|
+
font-size: 0.8rem;
|
|
122
|
+
}
|
|
94
123
|
aside section {
|
|
95
124
|
width: 100%;
|
|
96
125
|
max-width: 16em;
|
|
@@ -227,14 +256,6 @@ main h1 {
|
|
|
227
256
|
h1 .sep {
|
|
228
257
|
margin: 0 0.1em;
|
|
229
258
|
}
|
|
230
|
-
h1 a,
|
|
231
|
-
h1 a:link,
|
|
232
|
-
h1 a:hover,
|
|
233
|
-
h1 a:visited,
|
|
234
|
-
h1 a:active {
|
|
235
|
-
color: inherit;
|
|
236
|
-
text-decoration: none;
|
|
237
|
-
}
|
|
238
259
|
@media (max-width: 840px) {
|
|
239
260
|
main h1 {
|
|
240
261
|
margin-top: 0;
|
|
@@ -244,6 +265,7 @@ main h1 + h2 {
|
|
|
244
265
|
margin-top: 0.5rem;
|
|
245
266
|
}
|
|
246
267
|
main h2 {
|
|
268
|
+
font-weight: 900;
|
|
247
269
|
border-bottom: var(--sep-line);
|
|
248
270
|
padding-bottom: 0.1em;
|
|
249
271
|
}
|
package/package.json
CHANGED
|
@@ -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);
|
package/src/css/section.css
CHANGED
|
@@ -15,10 +15,23 @@ header {
|
|
|
15
15
|
padding-bottom: 0.5em;
|
|
16
16
|
}
|
|
17
17
|
header h1 {
|
|
18
|
-
font-size: 1.
|
|
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,10 +100,26 @@ aside > .header .installation code {
|
|
|
87
100
|
margin: 0;
|
|
88
101
|
}
|
|
89
102
|
aside h1 {
|
|
90
|
-
font-size: 1.
|
|
103
|
+
font-size: 1.3rem;
|
|
91
104
|
font-weight: 900;
|
|
105
|
+
color: var(--aux-emphatic-color);
|
|
92
106
|
margin: 0;
|
|
93
107
|
}
|
|
108
|
+
aside h1 > a,
|
|
109
|
+
aside h1 > a:link,
|
|
110
|
+
aside h1 > a:hover,
|
|
111
|
+
aside h1 > a:visited,
|
|
112
|
+
aside h1 > a:active {
|
|
113
|
+
--color: var(--aux-emphatic-color);
|
|
114
|
+
text-decoration: underline;
|
|
115
|
+
border-bottom: none;
|
|
116
|
+
}
|
|
117
|
+
aside h1 sup {
|
|
118
|
+
font-size: 0.5em;
|
|
119
|
+
}
|
|
120
|
+
aside nav {
|
|
121
|
+
font-size: 0.8rem;
|
|
122
|
+
}
|
|
94
123
|
aside section {
|
|
95
124
|
width: 100%;
|
|
96
125
|
max-width: 16em;
|
|
@@ -227,14 +256,6 @@ main h1 {
|
|
|
227
256
|
h1 .sep {
|
|
228
257
|
margin: 0 0.1em;
|
|
229
258
|
}
|
|
230
|
-
h1 a,
|
|
231
|
-
h1 a:link,
|
|
232
|
-
h1 a:hover,
|
|
233
|
-
h1 a:visited,
|
|
234
|
-
h1 a:active {
|
|
235
|
-
color: inherit;
|
|
236
|
-
text-decoration: none;
|
|
237
|
-
}
|
|
238
259
|
@media (max-width: 840px) {
|
|
239
260
|
main h1 {
|
|
240
261
|
margin-top: 0;
|
|
@@ -244,6 +265,7 @@ main h1 + h2 {
|
|
|
244
265
|
margin-top: 0.5rem;
|
|
245
266
|
}
|
|
246
267
|
main h2 {
|
|
268
|
+
font-weight: 900;
|
|
247
269
|
border-bottom: var(--sep-line);
|
|
248
270
|
padding-bottom: 0.1em;
|
|
249
271
|
}
|