@t8/docsgen 0.4.3 → 0.4.5
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 +1 -20
- package/dist/css/section.css +0 -2
- package/package.json +1 -1
- package/src/bin/content/getSectionContent.ts +4 -6
- package/src/css/section.css +0 -2
package/dist/bin.js
CHANGED
|
@@ -431,22 +431,6 @@ function getRepoLink({ repo }, className) {
|
|
|
431
431
|
return `<a href="${repo}"${className ? ` class="${className}"` : ""} target="_blank">${caption}</a>`;
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
// src/bin/getRepoMetadata.ts
|
|
435
|
-
async function getRepoMetadata({
|
|
436
|
-
repo
|
|
437
|
-
}) {
|
|
438
|
-
if (repo?.startsWith("https://github.com/")) {
|
|
439
|
-
try {
|
|
440
|
-
let repoMetadata = await fetchContent(
|
|
441
|
-
repo.replace("https://github.com/", "https://api.github.com/repos/")
|
|
442
|
-
);
|
|
443
|
-
return JSON.parse(repoMetadata);
|
|
444
|
-
} catch {
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return {};
|
|
448
|
-
}
|
|
449
|
-
|
|
450
434
|
// src/bin/parsing/getParsedContent.ts
|
|
451
435
|
import { JSDOM as JSDOM2 } from "jsdom";
|
|
452
436
|
import Markdown from "markdown-it";
|
|
@@ -840,10 +824,7 @@ function tweakTypography(s = "") {
|
|
|
840
824
|
// src/bin/content/getSectionContent.ts
|
|
841
825
|
async function getSectionContent(ctx, index) {
|
|
842
826
|
let { root, contentDir = "" } = ctx;
|
|
843
|
-
let
|
|
844
|
-
let descriptionContent = escapeHTML(
|
|
845
|
-
tweakTypography(repoDescription || ctx.description)
|
|
846
|
-
);
|
|
827
|
+
let descriptionContent = escapeHTML(tweakTypography(ctx.description));
|
|
847
828
|
let cssRoot = await getCSSRoot(ctx, "content");
|
|
848
829
|
let { sections, nav } = await getParsedContent(ctx);
|
|
849
830
|
let content = sections[index];
|
package/dist/css/section.css
CHANGED
|
@@ -25,7 +25,6 @@ header h1 > a:link,
|
|
|
25
25
|
header h1 > a:hover,
|
|
26
26
|
header h1 > a:visited,
|
|
27
27
|
header h1 > a:active {
|
|
28
|
-
--color: var(--aux-emphatic-color);
|
|
29
28
|
text-decoration: underline;
|
|
30
29
|
border-bottom: none;
|
|
31
30
|
}
|
|
@@ -112,7 +111,6 @@ aside h1 > a:link,
|
|
|
112
111
|
aside h1 > a:hover,
|
|
113
112
|
aside h1 > a:visited,
|
|
114
113
|
aside h1 > a:active {
|
|
115
|
-
--color: var(--aux-emphatic-color);
|
|
116
114
|
text-decoration: underline;
|
|
117
115
|
border-bottom: none;
|
|
118
116
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import type { Context } from "../../types/Context.ts";
|
|
|
2
2
|
import { escapeHTML } from "../../utils/escapeHTML.ts";
|
|
3
3
|
import { escapeRegExp } from "../../utils/escapeRegExp.ts";
|
|
4
4
|
import { getRepoLink } from "../getRepoLink.ts";
|
|
5
|
-
import { getRepoMetadata } from "../getRepoMetadata.ts";
|
|
5
|
+
// import { getRepoMetadata } from "../getRepoMetadata.ts";
|
|
6
6
|
import { getParsedContent } from "../parsing/getParsedContent.ts";
|
|
7
7
|
import { stripHTML } from "../stripHTML.ts";
|
|
8
8
|
import { getCounterContent } from "./getCounterContent.ts";
|
|
@@ -19,11 +19,9 @@ import { tweakTypography } from "./tweakTypography.ts";
|
|
|
19
19
|
|
|
20
20
|
export async function getSectionContent(ctx: Context, index: number) {
|
|
21
21
|
let { root, contentDir = "" } = ctx;
|
|
22
|
-
let repoDescription =
|
|
23
|
-
|
|
24
|
-
let descriptionContent = escapeHTML(
|
|
25
|
-
tweakTypography(repoDescription || ctx.description),
|
|
26
|
-
);
|
|
22
|
+
// let repoDescription =
|
|
23
|
+
// index === 0 ? (await getRepoMetadata(ctx)).description : "";
|
|
24
|
+
let descriptionContent = escapeHTML(tweakTypography(ctx.description));
|
|
27
25
|
|
|
28
26
|
let cssRoot = await getCSSRoot(ctx, "content");
|
|
29
27
|
let { sections, nav } = await getParsedContent(ctx);
|
package/src/css/section.css
CHANGED
|
@@ -25,7 +25,6 @@ header h1 > a:link,
|
|
|
25
25
|
header h1 > a:hover,
|
|
26
26
|
header h1 > a:visited,
|
|
27
27
|
header h1 > a:active {
|
|
28
|
-
--color: var(--aux-emphatic-color);
|
|
29
28
|
text-decoration: underline;
|
|
30
29
|
border-bottom: none;
|
|
31
30
|
}
|
|
@@ -112,7 +111,6 @@ aside h1 > a:link,
|
|
|
112
111
|
aside h1 > a:hover,
|
|
113
112
|
aside h1 > a:visited,
|
|
114
113
|
aside h1 > a:active {
|
|
115
|
-
--color: var(--aux-emphatic-color);
|
|
116
114
|
text-decoration: underline;
|
|
117
115
|
border-bottom: none;
|
|
118
116
|
}
|