@t8/docsgen 0.1.3 → 0.1.4

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
@@ -269,19 +269,22 @@ async function getNav(ctx, navItems) {
269
269
  }
270
270
  }
271
271
  if (!s && !navContent) return "";
272
- let repoLink = getRepoLink(ctx);
273
272
  s = s.trim() ? `<section><ul>${s}
274
273
  </ul></section>` : "";
275
- s = `${s}
274
+ let repoLink = getRepoLink(ctx);
275
+ let refContent = "";
276
+ if (repoLink || backstory)
277
+ refContent = `
276
278
  <section class="ref">
277
279
  <ul>
278
- <li>${repoLink}</li>
280
+ ${repoLink ? `<li>${repoLink}</li>` : ""}
279
281
  ${backstory ? `<li><a href="${backstory}">Backstory</a></li>` : ""}
280
282
  </ul>
281
283
  </section>
282
- ${navContent}`;
284
+ `;
283
285
  return `<nav>
284
- ${s}
286
+ ${s}${refContent}
287
+ ${navContent}
285
288
  </nav>`;
286
289
  }
287
290
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/docsgen",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "main": "dist/bin.js",
6
6
  "bin": {
package/src/bin/getNav.ts CHANGED
@@ -48,17 +48,20 @@ export async function getNav(ctx: Context, navItems: NavItem[]) {
48
48
 
49
49
  if (!s && !navContent) return "";
50
50
 
51
+ s = s.trim() ? `<section><ul>${s}\n</ul></section>` : "";
52
+
51
53
  let repoLink = getRepoLink(ctx);
54
+ let refContent = "";
52
55
 
53
- s = s.trim() ? `<section><ul>${s}\n</ul></section>` : "";
54
- s = `${s}
56
+ if (repoLink || backstory)
57
+ refContent = `
55
58
  <section class="ref">
56
59
  <ul>
57
- <li>${repoLink}</li>
60
+ ${repoLink ? `<li>${repoLink}</li>` : ""}
58
61
  ${backstory ? `<li><a href="${backstory}">Backstory</a></li>` : ""}
59
62
  </ul>
60
63
  </section>
61
- ${navContent}`;
64
+ `;
62
65
 
63
- return `<nav>\n${s}\n</nav>`;
66
+ return `<nav>\n${s}${refContent}\n${navContent}\n</nav>`;
64
67
  }