@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 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 { badges, description, intro, features, installation, sections, nav } = await getParsedContent(ctx);
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
@@ -167,9 +167,6 @@ footer {
167
167
  main {
168
168
  box-sizing: border-box;
169
169
  }
170
- main h2:first-child {
171
- margin-top: 0;
172
- }
173
170
  main ul {
174
171
  padding: 0;
175
172
  padding-inline-start: 1.5em;
@@ -171,15 +171,15 @@ section.intro .section-content {
171
171
  }
172
172
  section .section-content {
173
173
  max-width: auto;
174
- padding: var(--content-padding-y) var(--content-padding-x);
174
+ padding: 1rem 1.35rem;
175
175
  }
176
176
  section.intro-title .section-content {
177
- min-height: auto;
178
- padding-top: 2em;
179
- padding-bottom: 1.5em;
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.5em;
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.5em;
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
  }
@@ -142,6 +142,9 @@ main h2 {
142
142
  border-bottom: var(--hr-border);
143
143
  padding-bottom: 0.1em;
144
144
  }
145
+ main h2:first-child {
146
+ margin-top: 0;
147
+ }
145
148
 
146
149
  .pagenav {
147
150
  --icon-width: 1.25em;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/docsgen",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "",
5
5
  "main": "dist/bin.js",
6
6
  "bin": {
@@ -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),
@@ -89,8 +89,16 @@ ${getInjectedContent(ctx, "redirect", "body")}
89
89
  return;
90
90
  }
91
91
 
92
- let { badges, description, intro, features, installation, sections, nav } =
93
- await getParsedContent(ctx);
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
@@ -167,9 +167,6 @@ footer {
167
167
  main {
168
168
  box-sizing: border-box;
169
169
  }
170
- main h2:first-child {
171
- margin-top: 0;
172
- }
173
170
  main ul {
174
171
  padding: 0;
175
172
  padding-inline-start: 1.5em;
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: var(--content-padding-y) var(--content-padding-x);
174
+ padding: 1rem 1.35rem;
175
175
  }
176
176
  section.intro-title .section-content {
177
- min-height: auto;
178
- padding-top: 2em;
179
- padding-bottom: 1.5em;
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.5em;
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.5em;
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
  }
@@ -142,6 +142,9 @@ main h2 {
142
142
  border-bottom: var(--hr-border);
143
143
  padding-bottom: 0.1em;
144
144
  }
145
+ main h2:first-child {
146
+ margin-top: 0;
147
+ }
145
148
 
146
149
  .pagenav {
147
150
  --icon-width: 1.25em;