@t8/docsgen 0.2.14 → 0.2.16
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 +16 -11
- package/dist/css/section.css +4 -4
- package/package.json +1 -1
- package/src/bin/getNav.ts +12 -10
- package/src/css/section.css +4 -4
package/dist/bin.js
CHANGED
|
@@ -405,21 +405,26 @@ async function getNav(ctx, navItems) {
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
if ((!s || navItemCount < 2) && !navContent) return "";
|
|
408
|
-
s = s.trim()
|
|
409
|
-
|
|
408
|
+
s = s.trim();
|
|
409
|
+
s = s ? `<p class="title">Contents</p>
|
|
410
|
+
<ul>${s}
|
|
411
|
+
</ul>
|
|
412
|
+
` : "";
|
|
410
413
|
let repoLink = getRepoLink(ctx);
|
|
411
|
-
let refContent = "";
|
|
412
414
|
if (repoLink || backstory)
|
|
413
|
-
|
|
414
|
-
<
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
</section>
|
|
415
|
+
s += `
|
|
416
|
+
<p class="title">Resources</p>
|
|
417
|
+
<ul>
|
|
418
|
+
${repoLink ? `<li>${repoLink}</li>` : ""}
|
|
419
|
+
${backstory ? `<li><a href="${backstory}">Backstory</a></li>` : ""}
|
|
420
|
+
</ul>
|
|
420
421
|
`;
|
|
422
|
+
s = s.trim();
|
|
423
|
+
s = s ? `<section>
|
|
424
|
+
${s}
|
|
425
|
+
</section>` : "";
|
|
421
426
|
return `<nav class="b1">
|
|
422
|
-
${s}
|
|
427
|
+
${s}
|
|
423
428
|
${navContent}
|
|
424
429
|
</nav>`;
|
|
425
430
|
}
|
package/dist/css/section.css
CHANGED
|
@@ -47,9 +47,6 @@ footer {
|
|
|
47
47
|
.body > nav section + section {
|
|
48
48
|
border-top: 0.05rem solid;
|
|
49
49
|
}
|
|
50
|
-
.body > nav section.related {
|
|
51
|
-
border-top: 0.15rem double;
|
|
52
|
-
}
|
|
53
50
|
.body > nav h2,
|
|
54
51
|
.body > nav p.title {
|
|
55
52
|
font-size: 0.7rem;
|
|
@@ -93,6 +90,9 @@ footer {
|
|
|
93
90
|
.body > nav li + li {
|
|
94
91
|
margin-top: 0.65em;
|
|
95
92
|
}
|
|
93
|
+
.body > nav li > strong {
|
|
94
|
+
color: color(from var(--c1) srgb r g b / 0.75);
|
|
95
|
+
}
|
|
96
96
|
@media (max-width: 840px) {
|
|
97
97
|
.body > nav {
|
|
98
98
|
width: 100%;
|
|
@@ -203,7 +203,7 @@ main h2:first-child {
|
|
|
203
203
|
display: flex;
|
|
204
204
|
justify-content: space-between;
|
|
205
205
|
gap: 1em;
|
|
206
|
-
border-top: 0.
|
|
206
|
+
border-top: 0.05rem solid;
|
|
207
207
|
padding: 0.6em 0.75em 0.75em;
|
|
208
208
|
margin: 1.5em 0 0;
|
|
209
209
|
}
|
package/package.json
CHANGED
package/src/bin/getNav.ts
CHANGED
|
@@ -64,20 +64,22 @@ export async function getNav(ctx: Context, navItems: NavItem[]) {
|
|
|
64
64
|
|
|
65
65
|
if ((!s || navItemCount < 2) && !navContent) return "";
|
|
66
66
|
|
|
67
|
-
s = s.trim()
|
|
67
|
+
s = s.trim();
|
|
68
|
+
s = s ? `<p class="title">Contents</p>\n<ul>${s}\n</ul>\n` : "";
|
|
68
69
|
|
|
69
70
|
let repoLink = getRepoLink(ctx);
|
|
70
|
-
let refContent = "";
|
|
71
71
|
|
|
72
72
|
if (repoLink || backstory)
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</section>
|
|
73
|
+
s += `
|
|
74
|
+
<p class="title">Resources</p>
|
|
75
|
+
<ul>
|
|
76
|
+
${repoLink ? `<li>${repoLink}</li>` : ""}
|
|
77
|
+
${backstory ? `<li><a href="${backstory}">Backstory</a></li>` : ""}
|
|
78
|
+
</ul>
|
|
80
79
|
`;
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
s = s.trim();
|
|
82
|
+
s = s ? `<section>\n${s}\n</section>` : "";
|
|
83
|
+
|
|
84
|
+
return `<nav class="b1">\n${s}\n${navContent}\n</nav>`;
|
|
83
85
|
}
|
package/src/css/section.css
CHANGED
|
@@ -47,9 +47,6 @@ footer {
|
|
|
47
47
|
.body > nav section + section {
|
|
48
48
|
border-top: 0.05rem solid;
|
|
49
49
|
}
|
|
50
|
-
.body > nav section.related {
|
|
51
|
-
border-top: 0.15rem double;
|
|
52
|
-
}
|
|
53
50
|
.body > nav h2,
|
|
54
51
|
.body > nav p.title {
|
|
55
52
|
font-size: 0.7rem;
|
|
@@ -93,6 +90,9 @@ footer {
|
|
|
93
90
|
.body > nav li + li {
|
|
94
91
|
margin-top: 0.65em;
|
|
95
92
|
}
|
|
93
|
+
.body > nav li > strong {
|
|
94
|
+
color: color(from var(--c1) srgb r g b / 0.75);
|
|
95
|
+
}
|
|
96
96
|
@media (max-width: 840px) {
|
|
97
97
|
.body > nav {
|
|
98
98
|
width: 100%;
|
|
@@ -203,7 +203,7 @@ main h2:first-child {
|
|
|
203
203
|
display: flex;
|
|
204
204
|
justify-content: space-between;
|
|
205
205
|
gap: 1em;
|
|
206
|
-
border-top: 0.
|
|
206
|
+
border-top: 0.05rem solid;
|
|
207
207
|
padding: 0.6em 0.75em 0.75em;
|
|
208
208
|
margin: 1.5em 0 0;
|
|
209
209
|
}
|