@t8/docsgen 0.2.14 → 0.2.15
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 +0 -3
- package/package.json +1 -1
- package/src/bin/getNav.ts +12 -10
- package/src/css/section.css +0 -3
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
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
|
}
|