@t8/docsgen 0.2.15 → 0.2.17
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 +5 -4
- package/dist/css/section.css +4 -1
- package/package.json +1 -1
- package/src/bin/setContent.ts +2 -2
- package/src/bin/stripHTML.ts +4 -2
- package/src/css/section.css +4 -1
package/dist/bin.js
CHANGED
|
@@ -139,9 +139,10 @@ function getLocation(ctx, path, preferredLocation) {
|
|
|
139
139
|
|
|
140
140
|
// src/bin/stripHTML.ts
|
|
141
141
|
var import_jsdom = require("jsdom");
|
|
142
|
-
function stripHTML(content) {
|
|
142
|
+
function stripHTML(content, replaceNbsp = false) {
|
|
143
143
|
try {
|
|
144
|
-
|
|
144
|
+
let s = new import_jsdom.JSDOM(content).window.document.body.textContent;
|
|
145
|
+
return replaceNbsp ? s.replaceAll("\xA0", " ") : s;
|
|
145
146
|
} catch {
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -799,8 +800,8 @@ ${getInjectedContent(ctx, "redirect", "body")}
|
|
|
799
800
|
<head>
|
|
800
801
|
<meta charset="utf-8">
|
|
801
802
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
802
|
-
<meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title))}">
|
|
803
|
-
<title>${escapeHTML(stripHTML(nav[i]?.title))} | ${escapedTitle}</title>
|
|
803
|
+
<meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title, true))}">
|
|
804
|
+
<title>${escapeHTML(stripHTML(nav[i]?.title, true))} | ${escapedTitle}</title>
|
|
804
805
|
<link rel="stylesheet" href="${cssRoot.content}/base.css">
|
|
805
806
|
<link rel="stylesheet" href="${cssRoot.content}/section.css">
|
|
806
807
|
${iconTag}
|
package/dist/css/section.css
CHANGED
|
@@ -90,6 +90,9 @@ footer {
|
|
|
90
90
|
.body > nav li + li {
|
|
91
91
|
margin-top: 0.65em;
|
|
92
92
|
}
|
|
93
|
+
.body > nav li > strong {
|
|
94
|
+
color: color(from var(--c1) srgb r g b / 0.75);
|
|
95
|
+
}
|
|
93
96
|
@media (max-width: 840px) {
|
|
94
97
|
.body > nav {
|
|
95
98
|
width: 100%;
|
|
@@ -200,7 +203,7 @@ main h2:first-child {
|
|
|
200
203
|
display: flex;
|
|
201
204
|
justify-content: space-between;
|
|
202
205
|
gap: 1em;
|
|
203
|
-
border-top: 0.
|
|
206
|
+
border-top: 0.05rem solid;
|
|
204
207
|
padding: 0.6em 0.75em 0.75em;
|
|
205
208
|
margin: 1.5em 0 0;
|
|
206
209
|
}
|
package/package.json
CHANGED
package/src/bin/setContent.ts
CHANGED
|
@@ -166,8 +166,8 @@ ${getInjectedContent(ctx, "redirect", "body")}
|
|
|
166
166
|
<head>
|
|
167
167
|
<meta charset="utf-8">
|
|
168
168
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
169
|
-
<meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title))}">
|
|
170
|
-
<title>${escapeHTML(stripHTML(nav[i]?.title))} | ${escapedTitle}</title>
|
|
169
|
+
<meta name="description" content="${escapedTitle}: ${escapeHTML(stripHTML(nav[i]?.title, true))}">
|
|
170
|
+
<title>${escapeHTML(stripHTML(nav[i]?.title, true))} | ${escapedTitle}</title>
|
|
171
171
|
<link rel="stylesheet" href="${cssRoot.content}/base.css">
|
|
172
172
|
<link rel="stylesheet" href="${cssRoot.content}/section.css">
|
|
173
173
|
${iconTag}
|
package/src/bin/stripHTML.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { JSDOM } from "jsdom";
|
|
2
2
|
|
|
3
|
-
export function stripHTML(content: string) {
|
|
3
|
+
export function stripHTML(content: string, replaceNbsp = false) {
|
|
4
4
|
try {
|
|
5
|
-
|
|
5
|
+
let s = new JSDOM(content).window.document.body.textContent;
|
|
6
|
+
|
|
7
|
+
return replaceNbsp ? s.replaceAll("\xa0", " ") : s;
|
|
6
8
|
} catch {}
|
|
7
9
|
}
|
package/src/css/section.css
CHANGED
|
@@ -90,6 +90,9 @@ footer {
|
|
|
90
90
|
.body > nav li + li {
|
|
91
91
|
margin-top: 0.65em;
|
|
92
92
|
}
|
|
93
|
+
.body > nav li > strong {
|
|
94
|
+
color: color(from var(--c1) srgb r g b / 0.75);
|
|
95
|
+
}
|
|
93
96
|
@media (max-width: 840px) {
|
|
94
97
|
.body > nav {
|
|
95
98
|
width: 100%;
|
|
@@ -200,7 +203,7 @@ main h2:first-child {
|
|
|
200
203
|
display: flex;
|
|
201
204
|
justify-content: space-between;
|
|
202
205
|
gap: 1em;
|
|
203
|
-
border-top: 0.
|
|
206
|
+
border-top: 0.05rem solid;
|
|
204
207
|
padding: 0.6em 0.75em 0.75em;
|
|
205
208
|
margin: 1.5em 0 0;
|
|
206
209
|
}
|