@t8/docsgen 0.2.9 → 0.2.10
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 +5 -1
- package/package.json +1 -1
- package/src/bin/setContent.ts +11 -1
package/dist/bin.js
CHANGED
|
@@ -688,6 +688,9 @@ function getDefaultCodeStyleContent(cssRoot) {
|
|
|
688
688
|
<script>hljs.highlightAll()</script>
|
|
689
689
|
`.trim();
|
|
690
690
|
}
|
|
691
|
+
function tweakTypography(s = "") {
|
|
692
|
+
return s.replace(/\b(for|in|on|at|with|a|an|the)\s+/gi, "$1\xA0");
|
|
693
|
+
}
|
|
691
694
|
async function setContent(ctx) {
|
|
692
695
|
let {
|
|
693
696
|
dir = "",
|
|
@@ -768,6 +771,7 @@ ${getInjectedContent(ctx, "redirect", "body")}
|
|
|
768
771
|
sections,
|
|
769
772
|
nav
|
|
770
773
|
} = await getParsedContent(ctx);
|
|
774
|
+
let descriptionContent = tweakTypography(description) || (escapedPackageDescription ? `<p><em>${tweakTypography(escapedPackageDescription)}</em><p>` : "");
|
|
771
775
|
let navContent = await getNav(ctx, nav);
|
|
772
776
|
let dirs = [contentDir];
|
|
773
777
|
await Promise.all(
|
|
@@ -857,7 +861,7 @@ ${getInjectedContent(ctx, "section", "body")}
|
|
|
857
861
|
<div class="section-content">
|
|
858
862
|
<h1>${getTitle(ctx, { cover: true })}</h1>
|
|
859
863
|
<div class="description">
|
|
860
|
-
${
|
|
864
|
+
${descriptionContent}
|
|
861
865
|
${descriptionNote}
|
|
862
866
|
</div>
|
|
863
867
|
<p class="actions">
|
package/package.json
CHANGED
package/src/bin/setContent.ts
CHANGED
|
@@ -27,6 +27,10 @@ function getDefaultCodeStyleContent(cssRoot: string) {
|
|
|
27
27
|
`.trim();
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function tweakTypography(s = "") {
|
|
31
|
+
return s.replace(/\b(for|in|on|at|with|a|an|the)\s+/gi, "$1\xa0");
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
export async function setContent(ctx: Context) {
|
|
31
35
|
let {
|
|
32
36
|
dir = "",
|
|
@@ -129,6 +133,12 @@ ${getInjectedContent(ctx, "redirect", "body")}
|
|
|
129
133
|
nav,
|
|
130
134
|
} = await getParsedContent(ctx);
|
|
131
135
|
|
|
136
|
+
let descriptionContent =
|
|
137
|
+
tweakTypography(description) ||
|
|
138
|
+
(escapedPackageDescription
|
|
139
|
+
? `<p><em>${tweakTypography(escapedPackageDescription)}</em><p>`
|
|
140
|
+
: "");
|
|
141
|
+
|
|
132
142
|
let navContent = await getNav(ctx, nav);
|
|
133
143
|
let dirs = [contentDir];
|
|
134
144
|
|
|
@@ -226,7 +236,7 @@ ${getInjectedContent(ctx, "section", "body")}
|
|
|
226
236
|
<div class="section-content">
|
|
227
237
|
<h1>${getTitle(ctx, { cover: true })}</h1>
|
|
228
238
|
<div class="description">
|
|
229
|
-
${
|
|
239
|
+
${descriptionContent}
|
|
230
240
|
${descriptionNote}
|
|
231
241
|
</div>
|
|
232
242
|
<p class="actions">
|