@t8/docsgen 0.1.68 → 0.1.70
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 +23 -1
- package/dist/css/base.css +0 -3
- package/dist/css/index.css +6 -10
- package/dist/css/section.css +3 -0
- package/package.json +1 -1
- package/src/bin/getParsedContent.ts +22 -0
- package/src/bin/setContent.ts +11 -2
- package/src/css/base.css +0 -3
- package/src/css/index.css +6 -10
- package/src/css/section.css +3 -0
package/dist/bin.js
CHANGED
|
@@ -531,6 +531,7 @@ async function getParsedContent(ctx) {
|
|
|
531
531
|
let badges = [];
|
|
532
532
|
let title = "";
|
|
533
533
|
let description = [];
|
|
534
|
+
let descriptionNote = [];
|
|
534
535
|
let intro = [];
|
|
535
536
|
let features = [];
|
|
536
537
|
let note = [];
|
|
@@ -583,10 +584,21 @@ async function getParsedContent(ctx) {
|
|
|
583
584
|
description = [];
|
|
584
585
|
}
|
|
585
586
|
if (intro.at(-1) === "<hr>") intro.pop();
|
|
587
|
+
if (intro.length === 1) {
|
|
588
|
+
descriptionNote = intro;
|
|
589
|
+
intro = [];
|
|
590
|
+
}
|
|
591
|
+
for (let i = 0; i < intro.length; i++) {
|
|
592
|
+
if (intro[i].includes("<br>") && intro[i].startsWith("<p>") && intro[i].endsWith("</p>")) {
|
|
593
|
+
let s = intro[i].slice(3, -4).split("<br>").join('</span><br><span class="li">');
|
|
594
|
+
intro[i] = `<p><span class="li">${s}</span></p>`;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
586
597
|
return {
|
|
587
598
|
badges: postprocessBadges(joinLines(badges)),
|
|
588
599
|
title,
|
|
589
600
|
description: joinLines(description),
|
|
601
|
+
descriptionNote: joinLines(descriptionNote),
|
|
590
602
|
intro: joinLines(intro),
|
|
591
603
|
features: joinLines(features),
|
|
592
604
|
note: joinLines(note),
|
|
@@ -678,7 +690,16 @@ ${getInjectedContent(ctx, "redirect", "body")}
|
|
|
678
690
|
);
|
|
679
691
|
return;
|
|
680
692
|
}
|
|
681
|
-
let {
|
|
693
|
+
let {
|
|
694
|
+
badges,
|
|
695
|
+
description,
|
|
696
|
+
descriptionNote,
|
|
697
|
+
intro,
|
|
698
|
+
features,
|
|
699
|
+
installation,
|
|
700
|
+
sections,
|
|
701
|
+
nav
|
|
702
|
+
} = await getParsedContent(ctx);
|
|
682
703
|
let navContent = await getNav(ctx, nav);
|
|
683
704
|
let dirs = [contentDir];
|
|
684
705
|
await Promise.all(
|
|
@@ -772,6 +793,7 @@ ${getInjectedContent(ctx, "section", "body")}
|
|
|
772
793
|
<h1>${getTitle(ctx, { cover: true })}</h1>
|
|
773
794
|
<div class="description">
|
|
774
795
|
${description || (escapedPackageDescription ? `<p><em>${escapedPackageDescription}</em><p>` : "")}
|
|
796
|
+
${descriptionNote}
|
|
775
797
|
</div>
|
|
776
798
|
<p class="actions">
|
|
777
799
|
<a href="${root}start" class="primary button">Docs</a>
|
package/dist/css/base.css
CHANGED
package/dist/css/index.css
CHANGED
|
@@ -171,15 +171,15 @@ section.intro .section-content {
|
|
|
171
171
|
}
|
|
172
172
|
section .section-content {
|
|
173
173
|
max-width: auto;
|
|
174
|
-
padding:
|
|
174
|
+
padding: 1rem 1.35rem;
|
|
175
175
|
}
|
|
176
176
|
section.intro-title .section-content {
|
|
177
|
-
min-height:
|
|
178
|
-
padding-top:
|
|
179
|
-
padding-bottom: 1.
|
|
177
|
+
min-height: 60vh;
|
|
178
|
+
padding-top: 2rem;
|
|
179
|
+
padding-bottom: 1.5rem;
|
|
180
180
|
}
|
|
181
181
|
section.intro-title:last-child .section-content {
|
|
182
|
-
padding-bottom: 2.
|
|
182
|
+
padding-bottom: 2.5rem;
|
|
183
183
|
}
|
|
184
184
|
section.intro {
|
|
185
185
|
flex: auto;
|
|
@@ -187,7 +187,7 @@ section.intro .section-content {
|
|
|
187
187
|
align-items: center;
|
|
188
188
|
}
|
|
189
189
|
section.intro .section-content {
|
|
190
|
-
padding-top: 0.
|
|
190
|
+
padding-top: 0.5rem;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
.features {
|
|
@@ -220,10 +220,6 @@ section.intro .section-content {
|
|
|
220
220
|
border-top: 0.15em solid var(--line-color);
|
|
221
221
|
}
|
|
222
222
|
@media (max-width: 840px) {
|
|
223
|
-
.features {
|
|
224
|
-
padding: 0 0.5em;
|
|
225
|
-
margin: 0;
|
|
226
|
-
}
|
|
227
223
|
.features h2 {
|
|
228
224
|
text-align: center;
|
|
229
225
|
}
|
package/dist/css/section.css
CHANGED
package/package.json
CHANGED
|
@@ -132,6 +132,7 @@ export async function getParsedContent(ctx: Context) {
|
|
|
132
132
|
let badges: string[] = [];
|
|
133
133
|
let title = "";
|
|
134
134
|
let description: string[] = [];
|
|
135
|
+
let descriptionNote: string[] = [];
|
|
135
136
|
let intro: string[] = [];
|
|
136
137
|
let features: string[] = [];
|
|
137
138
|
let note: string[] = [];
|
|
@@ -203,10 +204,31 @@ export async function getParsedContent(ctx: Context) {
|
|
|
203
204
|
|
|
204
205
|
if (intro.at(-1) === "<hr>") intro.pop();
|
|
205
206
|
|
|
207
|
+
if (intro.length === 1) {
|
|
208
|
+
descriptionNote = intro;
|
|
209
|
+
intro = [];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
for (let i = 0; i < intro.length; i++) {
|
|
213
|
+
if (
|
|
214
|
+
intro[i].includes("<br>") &&
|
|
215
|
+
intro[i].startsWith("<p>") &&
|
|
216
|
+
intro[i].endsWith("</p>")
|
|
217
|
+
) {
|
|
218
|
+
let s = intro[i]
|
|
219
|
+
.slice(3, -4)
|
|
220
|
+
.split("<br>")
|
|
221
|
+
.join('</span><br><span class="li">');
|
|
222
|
+
|
|
223
|
+
intro[i] = `<p><span class="li">${s}</span></p>`;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
206
227
|
return {
|
|
207
228
|
badges: postprocessBadges(joinLines(badges)),
|
|
208
229
|
title,
|
|
209
230
|
description: joinLines(description),
|
|
231
|
+
descriptionNote: joinLines(descriptionNote),
|
|
210
232
|
intro: joinLines(intro),
|
|
211
233
|
features: joinLines(features),
|
|
212
234
|
note: joinLines(note),
|
package/src/bin/setContent.ts
CHANGED
|
@@ -89,8 +89,16 @@ ${getInjectedContent(ctx, "redirect", "body")}
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
let {
|
|
93
|
-
|
|
92
|
+
let {
|
|
93
|
+
badges,
|
|
94
|
+
description,
|
|
95
|
+
descriptionNote,
|
|
96
|
+
intro,
|
|
97
|
+
features,
|
|
98
|
+
installation,
|
|
99
|
+
sections,
|
|
100
|
+
nav,
|
|
101
|
+
} = await getParsedContent(ctx);
|
|
94
102
|
|
|
95
103
|
let navContent = await getNav(ctx, nav);
|
|
96
104
|
let dirs = [contentDir];
|
|
@@ -192,6 +200,7 @@ ${getInjectedContent(ctx, "section", "body")}
|
|
|
192
200
|
<h1>${getTitle(ctx, { cover: true })}</h1>
|
|
193
201
|
<div class="description">
|
|
194
202
|
${description || (escapedPackageDescription ? `<p><em>${escapedPackageDescription}</em><p>` : "")}
|
|
203
|
+
${descriptionNote}
|
|
195
204
|
</div>
|
|
196
205
|
<p class="actions">
|
|
197
206
|
<a href="${root}start" class="primary button">Docs</a>
|
package/src/css/base.css
CHANGED
package/src/css/index.css
CHANGED
|
@@ -171,15 +171,15 @@ section.intro .section-content {
|
|
|
171
171
|
}
|
|
172
172
|
section .section-content {
|
|
173
173
|
max-width: auto;
|
|
174
|
-
padding:
|
|
174
|
+
padding: 1rem 1.35rem;
|
|
175
175
|
}
|
|
176
176
|
section.intro-title .section-content {
|
|
177
|
-
min-height:
|
|
178
|
-
padding-top:
|
|
179
|
-
padding-bottom: 1.
|
|
177
|
+
min-height: 60vh;
|
|
178
|
+
padding-top: 2rem;
|
|
179
|
+
padding-bottom: 1.5rem;
|
|
180
180
|
}
|
|
181
181
|
section.intro-title:last-child .section-content {
|
|
182
|
-
padding-bottom: 2.
|
|
182
|
+
padding-bottom: 2.5rem;
|
|
183
183
|
}
|
|
184
184
|
section.intro {
|
|
185
185
|
flex: auto;
|
|
@@ -187,7 +187,7 @@ section.intro .section-content {
|
|
|
187
187
|
align-items: center;
|
|
188
188
|
}
|
|
189
189
|
section.intro .section-content {
|
|
190
|
-
padding-top: 0.
|
|
190
|
+
padding-top: 0.5rem;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
.features {
|
|
@@ -220,10 +220,6 @@ section.intro .section-content {
|
|
|
220
220
|
border-top: 0.15em solid var(--line-color);
|
|
221
221
|
}
|
|
222
222
|
@media (max-width: 840px) {
|
|
223
|
-
.features {
|
|
224
|
-
padding: 0 0.5em;
|
|
225
|
-
margin: 0;
|
|
226
|
-
}
|
|
227
223
|
.features h2 {
|
|
228
224
|
text-align: center;
|
|
229
225
|
}
|