@wenyan-md/core 2.0.0 → 2.0.1
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/core.js +310 -148
- package/dist/types/core/index.d.ts +6 -3
- package/dist/types/core/parser/cssParser.d.ts +1 -1
- package/dist/types/core/platform/medium.d.ts +4 -0
- package/dist/types/core/platform/toutiao.d.ts +4 -0
- package/dist/types/core/platform/zhihu.d.ts +1 -0
- package/dist/types/core/renderer/macStyleRender.d.ts +0 -2
- package/dist/types/core/theme/macStyleRegistry.d.ts +7 -0
- package/dist/types/core/utils.d.ts +18 -0
- package/package.json +3 -3
- package/dist/types/core/types.d.ts +0 -10
- /package/dist/types/core/{hlThemeRegistry.d.ts → theme/hlThemeRegistry.d.ts} +0 -0
- /package/dist/types/core/{themeRegistry.d.ts → theme/themeRegistry.d.ts} +0 -0
package/dist/core.js
CHANGED
|
@@ -69,6 +69,37 @@ function replaceCSSVariables(css) {
|
|
|
69
69
|
});
|
|
70
70
|
return modifiedCSS.replace(/:root\s*\{[^}]*\}/g, "");
|
|
71
71
|
}
|
|
72
|
+
async function resolveCssContent(directCss, id, finder, fallbackFinder, errorMessage) {
|
|
73
|
+
if (directCss) {
|
|
74
|
+
return replaceCSSVariables(directCss);
|
|
75
|
+
}
|
|
76
|
+
let theme = finder(id);
|
|
77
|
+
if (!theme) {
|
|
78
|
+
theme = fallbackFinder(id);
|
|
79
|
+
}
|
|
80
|
+
if (!theme) {
|
|
81
|
+
throw new Error(errorMessage);
|
|
82
|
+
}
|
|
83
|
+
const rawCss = await theme.getCss();
|
|
84
|
+
return replaceCSSVariables(rawCss);
|
|
85
|
+
}
|
|
86
|
+
async function loadCssBySource(source) {
|
|
87
|
+
switch (source.type) {
|
|
88
|
+
case "inline":
|
|
89
|
+
return source.css;
|
|
90
|
+
case "asset":
|
|
91
|
+
return source.loader();
|
|
92
|
+
// case "file":
|
|
93
|
+
// return fs.readFile(source.path, "utf-8");
|
|
94
|
+
case "url": {
|
|
95
|
+
const res = await fetch(source.url);
|
|
96
|
+
if (!res.ok) throw new Error(`Failed to load CSS from ${source.url}`);
|
|
97
|
+
return res.text();
|
|
98
|
+
}
|
|
99
|
+
default:
|
|
100
|
+
throw new Error("Unknown source type");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
72
103
|
const __vite_glob_0_0$1 = "pre{background:#282c34}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#abb2bf;background:#282c34}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}";
|
|
73
104
|
const __vite_glob_0_1$1 = "pre{background:#fafafa}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383a42;background:#fafafa}.hljs-comment,.hljs-quote{color:#a0a1a7;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e45649}.hljs-literal{color:#0184bb}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#50a14f}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#4078f2}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#c18401}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}";
|
|
74
105
|
const __vite_glob_0_2$1 = "pre{background:#282936}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e9e9f4;background:#282936}.hljs ::selection,.hljs::selection{background-color:#4d4f68;color:#e9e9f4}.hljs-comment{color:#626483}.hljs-tag{color:#62d6e8}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#e9e9f4}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ea51b2}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#b45bcf}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#00f769}.hljs-strong{font-weight:700;color:#00f769}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#ebff87}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#a1efe4}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#62d6e8}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b45bcf}.hljs-emphasis{color:#b45bcf;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#00f769}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}\n";
|
|
@@ -78,15 +109,15 @@ const __vite_glob_0_5$1 = "pre{background:#272822}pre code.hljs{display:block;ov
|
|
|
78
109
|
const __vite_glob_0_6$1 = "pre{background:#002b36}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#93a1a1;background:#002b36}.hljs ::selection,.hljs::selection{background-color:#586e75;color:#93a1a1}.hljs-comment{color:#657b83}.hljs-tag{color:#839496}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#93a1a1}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#dc322f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#cb4b16}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#b58900}.hljs-strong{font-weight:700;color:#b58900}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#859900}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#2aa198}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#268bd2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#6c71c4}.hljs-emphasis{color:#6c71c4;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#d33682}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}\n";
|
|
79
110
|
const __vite_glob_0_7$1 = "pre{background:#fdf6e3}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#586e75;background:#fdf6e3}.hljs ::selection,.hljs::selection{background-color:#93a1a1;color:#586e75}.hljs-comment{color:#839496}.hljs-tag{color:#657b83}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#586e75}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#dc322f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#cb4b16}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#b58900}.hljs-strong{font-weight:700;color:#b58900}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#859900}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#2aa198}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#268bd2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#6c71c4}.hljs-emphasis{color:#6c71c4;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#d33682}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}\n";
|
|
80
111
|
const __vite_glob_0_8$1 = "pre{background:#fff}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.xml .hljs-meta{color:silver}.hljs-comment,.hljs-quote{color:#007400}.hljs-attribute,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#aa0d91}.hljs-template-variable,.hljs-variable{color:#3f6e74}.hljs-code,.hljs-meta .hljs-string,.hljs-string{color:#c41a16}.hljs-link,.hljs-regexp{color:#0e0eff}.hljs-bullet,.hljs-number,.hljs-symbol,.hljs-title{color:#1c00cf}.hljs-meta,.hljs-section{color:#643820}.hljs-built_in,.hljs-class .hljs-title,.hljs-params,.hljs-title.class_,.hljs-type{color:#5c2699}.hljs-attr{color:#836c28}.hljs-subst{color:#000}.hljs-formula{background-color:#eee;font-style:italic}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-selector-class,.hljs-selector-id{color:#9b703f}.hljs-doctag,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic}";
|
|
81
|
-
const registry$
|
|
112
|
+
const registry$2 = /* @__PURE__ */ new Map();
|
|
82
113
|
function registerHlTheme(theme) {
|
|
83
|
-
registry$
|
|
114
|
+
registry$2.set(theme.id, theme);
|
|
84
115
|
}
|
|
85
116
|
function getHlTheme(id) {
|
|
86
|
-
return registry$
|
|
117
|
+
return registry$2.get(id);
|
|
87
118
|
}
|
|
88
119
|
function getAllHlThemes() {
|
|
89
|
-
return [...registry$
|
|
120
|
+
return [...registry$2.values()];
|
|
90
121
|
}
|
|
91
122
|
const hlThemeIds = [
|
|
92
123
|
"atom-one-dark",
|
|
@@ -100,19 +131,19 @@ const hlThemeIds = [
|
|
|
100
131
|
"xcode"
|
|
101
132
|
];
|
|
102
133
|
const cssModules$1 = /* @__PURE__ */ Object.assign({
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
134
|
+
"/src/assets/highlight/styles/atom-one-dark.min.css": __vite_glob_0_0$1,
|
|
135
|
+
"/src/assets/highlight/styles/atom-one-light.min.css": __vite_glob_0_1$1,
|
|
136
|
+
"/src/assets/highlight/styles/dracula.min.css": __vite_glob_0_2$1,
|
|
137
|
+
"/src/assets/highlight/styles/github-dark.min.css": __vite_glob_0_3$1,
|
|
138
|
+
"/src/assets/highlight/styles/github.min.css": __vite_glob_0_4$1,
|
|
139
|
+
"/src/assets/highlight/styles/monokai.min.css": __vite_glob_0_5$1,
|
|
140
|
+
"/src/assets/highlight/styles/solarized-dark.min.css": __vite_glob_0_6$1,
|
|
141
|
+
"/src/assets/highlight/styles/solarized-light.min.css": __vite_glob_0_7$1,
|
|
142
|
+
"/src/assets/highlight/styles/xcode.min.css": __vite_glob_0_8$1
|
|
112
143
|
});
|
|
113
144
|
function registerBuiltInHlThemes() {
|
|
114
145
|
for (const id of hlThemeIds) {
|
|
115
|
-
const path =
|
|
146
|
+
const path = `/src/assets/highlight/styles/${id}.min.css`;
|
|
116
147
|
const loader = cssModules$1[path];
|
|
117
148
|
if (!loader) continue;
|
|
118
149
|
registerHlTheme(
|
|
@@ -124,23 +155,7 @@ function registerBuiltInHlThemes() {
|
|
|
124
155
|
}
|
|
125
156
|
}
|
|
126
157
|
function createTheme$1(id, source) {
|
|
127
|
-
return {
|
|
128
|
-
id,
|
|
129
|
-
async getCss() {
|
|
130
|
-
switch (source.type) {
|
|
131
|
-
case "inline":
|
|
132
|
-
return source.css;
|
|
133
|
-
case "asset":
|
|
134
|
-
return source.loader();
|
|
135
|
-
// case "file":
|
|
136
|
-
// return fs.readFile(source.path, "utf-8");
|
|
137
|
-
case "url":
|
|
138
|
-
const res = await fetch(source.url);
|
|
139
|
-
if (!res.ok) throw new Error(`Failed to load theme CSS`);
|
|
140
|
-
return res.text();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
};
|
|
158
|
+
return { id, getCss: () => loadCssBySource(source) };
|
|
144
159
|
}
|
|
145
160
|
function addFootnotes(element, listStyle = false) {
|
|
146
161
|
const footnotes = [];
|
|
@@ -209,31 +224,37 @@ function createCssModifier(updates) {
|
|
|
209
224
|
const ast = csstree.parse(customCss, parseOptions);
|
|
210
225
|
csstree.walk(ast, {
|
|
211
226
|
visit: "Rule",
|
|
212
|
-
leave(node
|
|
227
|
+
leave(node) {
|
|
213
228
|
if (node.prelude?.type !== "SelectorList") return;
|
|
214
229
|
const selectors = node.prelude.children.toArray().map((sel) => csstree.generate(sel));
|
|
215
230
|
if (selectors.length > 0) {
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
231
|
+
const mergedUpdates = /* @__PURE__ */ new Map();
|
|
232
|
+
selectors.forEach((sel) => {
|
|
233
|
+
const updateList = updates[sel];
|
|
234
|
+
if (updateList) {
|
|
235
|
+
updateList.forEach((update) => {
|
|
236
|
+
mergedUpdates.set(update.property, update);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
if (mergedUpdates.size === 0) return;
|
|
241
|
+
for (const { property, value, append } of mergedUpdates.values()) {
|
|
220
242
|
if (value) {
|
|
221
243
|
let found = false;
|
|
222
244
|
csstree.walk(node.block, (decl) => {
|
|
223
245
|
if (decl.type === "Declaration" && decl.property === property) {
|
|
224
|
-
decl.value = csstree.parse(value, { context: "value" });
|
|
225
246
|
found = true;
|
|
226
247
|
}
|
|
227
248
|
});
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
);
|
|
249
|
+
const shouldAppend = append === true || append === false && !found;
|
|
250
|
+
if (shouldAppend && value) {
|
|
251
|
+
const newItem = node.block.children.createItem({
|
|
252
|
+
type: "Declaration",
|
|
253
|
+
property,
|
|
254
|
+
value: csstree.parse(value, { context: "value" }),
|
|
255
|
+
important: false
|
|
256
|
+
});
|
|
257
|
+
node.block.children.prepend(newItem);
|
|
237
258
|
}
|
|
238
259
|
}
|
|
239
260
|
}
|
|
@@ -272,7 +293,7 @@ function createCssApplier(css) {
|
|
|
272
293
|
function renderHighlightTheme(wenyanElement, highlightCss) {
|
|
273
294
|
createCssApplier(highlightCss)(wenyanElement);
|
|
274
295
|
}
|
|
275
|
-
const
|
|
296
|
+
const macStyleCssRaw = `#wenyan pre::before {
|
|
276
297
|
display: block;
|
|
277
298
|
content: "";
|
|
278
299
|
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="45" height="12" viewBox="0 0 450 130"><ellipse cx="65" cy="65" rx="50" ry="52" stroke="rgb(220,60,54)" stroke-width="2" fill="rgb(237,108,96)"/><ellipse cx="225" cy="65" rx="50" ry="52" stroke="rgb(218,151,33)" stroke-width="2" fill="rgb(247,193,81)"/><ellipse cx="385" cy="65" rx="50" ry="52" stroke="rgb(27,161,37)" stroke-width="2" fill="rgb(100,200,86)"/></svg>');
|
|
@@ -280,6 +301,19 @@ const macStyleCss = `#wenyan pre::before {
|
|
|
280
301
|
width: 100%;
|
|
281
302
|
height: 16px;
|
|
282
303
|
}`;
|
|
304
|
+
const registry$1 = /* @__PURE__ */ new Map();
|
|
305
|
+
function registerMacStyle(macStyle) {
|
|
306
|
+
registry$1.set("macStyle", macStyle);
|
|
307
|
+
}
|
|
308
|
+
function getMacStyle() {
|
|
309
|
+
return registry$1.get("macStyle");
|
|
310
|
+
}
|
|
311
|
+
function registerBuiltInMacStyle() {
|
|
312
|
+
registerMacStyle({ getCss: () => macStyleCssRaw });
|
|
313
|
+
}
|
|
314
|
+
function getMacStyleCss() {
|
|
315
|
+
return getMacStyle()?.getCss() ?? "";
|
|
316
|
+
}
|
|
283
317
|
function applyPseudoElements(element, themeCss) {
|
|
284
318
|
const ast = csstree.parse(themeCss, parseOptions);
|
|
285
319
|
const rules = extractPseudoRules(ast);
|
|
@@ -296,9 +330,9 @@ function applyPseudoElements(element, themeCss) {
|
|
|
296
330
|
});
|
|
297
331
|
});
|
|
298
332
|
}
|
|
299
|
-
function buildPseudoElement(originalResults,
|
|
333
|
+
function buildPseudoElement(originalResults, document) {
|
|
300
334
|
const beforeResults = new Map(originalResults);
|
|
301
|
-
const section =
|
|
335
|
+
const section = document.createElement("section");
|
|
302
336
|
const content = beforeResults.get("content");
|
|
303
337
|
if (content) {
|
|
304
338
|
section.textContent = content.replace(/['"]/g, "");
|
|
@@ -316,7 +350,7 @@ function buildPseudoElement(originalResults, document2) {
|
|
|
316
350
|
const decodedString = atob(base64SvgMatch[1]);
|
|
317
351
|
section.innerHTML = decodedString;
|
|
318
352
|
} else if (httpMatch) {
|
|
319
|
-
const img =
|
|
353
|
+
const img = document.createElement("img");
|
|
320
354
|
img.src = httpMatch[1];
|
|
321
355
|
img.setAttribute("style", "vertical-align: top;");
|
|
322
356
|
section.appendChild(img);
|
|
@@ -363,6 +397,7 @@ function extractDeclarations(ruleNode, result) {
|
|
|
363
397
|
});
|
|
364
398
|
}
|
|
365
399
|
function renderMacStyle(wenyanElement) {
|
|
400
|
+
const macStyleCss = getMacStyleCss();
|
|
366
401
|
applyPseudoElements(wenyanElement, macStyleCss);
|
|
367
402
|
}
|
|
368
403
|
function createMarkedClient() {
|
|
@@ -539,7 +574,7 @@ function wechatPostRender(element) {
|
|
|
539
574
|
});
|
|
540
575
|
const listElements = element.querySelectorAll("li");
|
|
541
576
|
listElements.forEach((li) => {
|
|
542
|
-
const doc = element.ownerDocument
|
|
577
|
+
const doc = element.ownerDocument;
|
|
543
578
|
const section = doc.createElement("section");
|
|
544
579
|
while (li.firstChild) {
|
|
545
580
|
section.appendChild(li.firstChild);
|
|
@@ -547,32 +582,17 @@ function wechatPostRender(element) {
|
|
|
547
582
|
li.appendChild(section);
|
|
548
583
|
});
|
|
549
584
|
}
|
|
550
|
-
const themeModifier = createCssModifier({
|
|
551
|
-
"#wenyan pre code": [
|
|
552
|
-
{
|
|
553
|
-
property: "font-family",
|
|
554
|
-
value: monospace,
|
|
555
|
-
append: true
|
|
556
|
-
}
|
|
557
|
-
],
|
|
558
|
-
"#wenyan pre": [
|
|
559
|
-
{
|
|
560
|
-
property: "font-size",
|
|
561
|
-
value: "12px",
|
|
562
|
-
append: true
|
|
563
|
-
}
|
|
564
|
-
]
|
|
565
|
-
});
|
|
585
|
+
const themeModifier = createCssModifier({});
|
|
566
586
|
function renderTheme(wenyanElement, themeCss) {
|
|
567
587
|
const modifiedCss = themeModifier(themeCss);
|
|
568
588
|
createCssApplier(modifiedCss)(wenyanElement);
|
|
569
589
|
}
|
|
570
|
-
const __vite_glob_0_0 = "/**\n * 欢迎使用自定义主题功能,使用教程:\n * https://babyno.top/posts/2024/11/wenyan-supports-customized-themes/\n */\n/* 全局属性 */\n#wenyan {\n
|
|
571
|
-
const __vite_glob_0_1 = "#wenyan {\n
|
|
572
|
-
const __vite_glob_0_2 = "/*\n * Typora Theme - Lapis / Author - YiNN\n * https://github.com/YiNNx/typora-theme-lapis\n */\n\n:root {\n --text-color: #40464f;\n --primary-color: #4870ac;\n --bg-color: #ffffff;\n --marker-color: #a2b6d4;\n --source-color: #a8a8a9;\n --header-span-color: var(--primary-color);\n --block-bg-color: #f6f8fa;\n}\n#wenyan {\n color: var(--text-color);\n
|
|
573
|
-
const __vite_glob_0_3 = '/*\n * Typora Theme - Maize / Author - BEATREE\n * https://github.com/BEATREE/typora-maize-theme\n */\n\n:root {\n --bg-color: #fafafa;\n --text-color: #333333;\n --primary-color: #428bca;\n}\n#wenyan {\n
|
|
574
|
-
const __vite_glob_0_4 =
|
|
575
|
-
const __vite_glob_0_5 = '/*\n * Typora Theme - Orange Heart / Author - evgo2017\n * https://github.com/evgo2017/typora-theme-orange-heart\n */\n\n#wenyan {\n
|
|
590
|
+
const __vite_glob_0_0 = "/**\n * 欢迎使用自定义主题功能,使用教程:\n * https://babyno.top/posts/2024/11/wenyan-supports-customized-themes/\n */\n/* 全局属性 */\n#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n/* 全局子元素属性 */\n/* 支持分组 */\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6,\n#wenyan p {\n margin: 1em 0;\n}\n/* 段落 */\n#wenyan p {\n}\n/* 加粗 */\n#wenyan p strong {\n}\n/* 斜体 */\n#wenyan p em {\n}\n/* 一级标题 */\n#wenyan h1 {\n text-align: center;\n text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n font-size: 1.5em;\n}\n/* 标题文字 */\n#wenyan h1 span {\n}\n/* 标题前缀,h1-h6都支持前缀 */\n#wenyan h1::before {\n}\n/* 标题后缀,h1-h6都支持后缀 */\n#wenyan h1::after {\n}\n/* 二级标题 */\n#wenyan h2 {\n text-align: center;\n font-size: 1.2em;\n border-bottom: 1px solid #f7f7f7;\n font-weight: bold;\n}\n/* 三-六级标题 */\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n font-size: 1em;\n font-weight: bold;\n}\n/* 列表 */\n#wenyan ul,\n#wenyan ol {\n padding-left: 1.2em;\n}\n/* 列表元素 */\n#wenyan li {\n margin-left: 1.2em;\n}\n/* 图片 */\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n/* 表格 */\n#wenyan table {\n border-collapse: collapse;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n overflow: auto;\n display: table;\n word-wrap: break-word;\n word-break: break-all;\n}\n/* 表格单元格 */\n#wenyan table td,\n#wenyan table th {\n font-size: 0.75em;\n padding: 9px 12px;\n line-height: 22px;\n color: #222;\n border: 1px solid #d8d8d8;\n vertical-align: top;\n}\n/* 表格表头 */\n#wenyan table th {\n font-weight: bold;\n background-color: #f0f0f0;\n}\n/* 表格斑马条纹效果 */\n#wenyan table tr:nth-child(2n) {\n background-color: #f8f8f8;\n}\n/* 引用块 */\n#wenyan blockquote {\n background: #afb8c133;\n border-left: 0.5em solid #ccc;\n margin: 1.5em 0;\n padding: 0.5em 10px;\n font-style: italic;\n font-size: 0.9em;\n}\n/* 引用块前缀 */\n#wenyan blockquote::before {\n}\n/* 引用块后缀 */\n#wenyan blockquote::after {\n}\n/* 行内代码 */\n#wenyan p code {\n color: #ff502c;\n padding: 4px 6px;\n font-size: 0.78em;\n}\n/* 代码块外围 */\n#wenyan pre {\n border-radius: 5px;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;\n font-size: 12px;\n}\n/* 代码块 */\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n/* 分割线 */\n#wenyan hr {\n border: none;\n border-top: 1px solid #ddd;\n margin-top: 2em;\n margin-bottom: 2em;\n}\n/* 链接 */\n#wenyan a {\n word-wrap: break-word;\n color: #0069c2;\n}\n/* 原始链接旁脚注上标 */\n#wenyan .footnote {\n color: #0069c2;\n}\n/* 脚注行 */\n#wenyan #footnotes p {\n display: flex;\n margin: 0;\n font-size: 0.9em;\n}\n/* 脚注行内编号 */\n#wenyan .footnote-num {\n display: inline;\n width: 10%;\n}\n/* 脚注行内文字 */\n#wenyan .footnote-txt {\n display: inline;\n width: 90%;\n word-wrap: break-word;\n word-break: break-all;\n}\n";
|
|
591
|
+
const __vite_glob_0_1 = "#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan * {\n box-sizing: border-box;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6,\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n line-height: 1.5;\n margin-top: 35px;\n margin-bottom: 10px;\n padding-bottom: 5px;\n}\n#wenyan h1 {\n font-size: 24px;\n line-height: 38px;\n margin-bottom: 5px;\n}\n#wenyan h2 {\n font-size: 22px;\n line-height: 34px;\n padding-bottom: 12px;\n border-bottom: 1px solid #ececec;\n}\n#wenyan h3 {\n font-size: 20px;\n line-height: 28px;\n}\n#wenyan ul,\n#wenyan ol {\n padding-left: 1.2em;\n}\n#wenyan li {\n margin-left: 1.2em;\n}\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n#wenyan table {\n display: inline-block !important;\n font-size: 12px;\n width: auto;\n max-width: 100%;\n overflow: auto;\n border: 1px solid #f6f6f6;\n}\n#wenyan thead {\n background: #f6f6f6;\n color: #000;\n text-align: left;\n}\n#wenyan table td,\n#wenyan table th {\n padding: 12px 7px;\n line-height: 24px;\n}\n#wenyan blockquote {\n color: #666;\n padding: 1px 23px;\n margin: 22px 0;\n border-left: 4px solid #cbcbcb;\n background-color: #f8f8f8;\n font-size: 0.95em;\n}\n#wenyan p code {\n background: #fff5f5;\n color: #ff502c;\n padding: 4px 6px;\n font-size: 0.78em;\n}\n#wenyan pre {\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n color: #333;\n background: #f8f8f8;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n background: #f8f8f8;\n}\n#wenyan hr {\n border: none;\n border-top: 1px solid #ddd;\n margin-top: 32px;\n margin-bottom: 32px;\n}\n/* 链接 */\n#wenyan a {\n word-wrap: break-word;\n color: #0069c2;\n}\n/* 脚注 */\n#wenyan #footnotes ul {\n font-size: 0.9em;\n margin: 0;\n padding-left: 1.2em;\n}\n#wenyan #footnotes li {\n margin: 0 0 0 1.2em;\n overflow-wrap: break-word;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan .footnote {\n color: #0069c2;\n}\n";
|
|
592
|
+
const __vite_glob_0_2 = "/*\n * Typora Theme - Lapis / Author - YiNN\n * https://github.com/YiNNx/typora-theme-lapis\n */\n\n:root {\n --text-color: #40464f;\n --primary-color: #4870ac;\n --bg-color: #ffffff;\n --marker-color: #a2b6d4;\n --source-color: #a8a8a9;\n --header-span-color: var(--primary-color);\n --block-bg-color: #f6f8fa;\n}\n#wenyan {\n color: var(--text-color);\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan strong {\n color: var(--primary-color);\n}\n#wenyan a {\n word-wrap: break-word;\n color: var(--primary-color);\n}\n#wenyan p {\n color: var(--text-color);\n}\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n font-weight: normal;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n padding: 0px;\n color: var(--primary-color);\n margin: 1.2em 0 1em;\n}\n#wenyan h1 {\n text-align: center;\n}\n#wenyan h2 {\n padding: 1px 12.5px;\n border-radius: 4px;\n display: inline-block;\n}\n#wenyan h2,\n#wenyan h2 code {\n background-color: var(--header-span-color);\n}\n#wenyan h2,\n#wenyan h2 a,\n#wenyan h2 code,\n#wenyan h2 strong {\n color: var(--bg-color);\n}\n#wenyan h1 {\n font-size: 1.5em;\n}\n#wenyan h2 {\n font-size: 1.3em;\n}\n#wenyan h3 {\n font-size: 1.3em;\n}\n#wenyan h4 {\n font-size: 1.2em;\n}\n#wenyan h5 {\n font-size: 1.2em;\n}\n#wenyan h6 {\n font-size: 1.2em;\n}\n#wenyan ul {\n list-style-type: disc;\n}\n#wenyan em {\n padding: 0 3px 0 0;\n}\n#wenyan ul ul {\n list-style-type: square;\n}\n#wenyan ol {\n list-style-type: decimal;\n}\n#wenyan blockquote {\n display: block;\n font-size: 0.9em;\n border-left: 3px solid var(--primary-color);\n padding: 0.5em 1em;\n margin: 0;\n background: var(--block-bg-color);\n}\n#wenyan p code {\n color: var(--primary-color);\n font-size: 0.9em;\n font-weight: normal;\n word-wrap: break-word;\n padding: 2px 4px 2px;\n border-radius: 3px;\n margin: 2px;\n background-color: var(--block-bg-color);\n word-break: break-all;\n}\n#wenyan img {\n max-width: 100%;\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n#wenyan table {\n display: table;\n text-align: justify;\n overflow-x: auto;\n border-collapse: collapse;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n overflow: auto;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table th,\n#wenyan table td {\n border: 1px solid #d9dfe4;\n padding: 9px 12px;\n font-size: 0.75em;\n line-height: 22px;\n vertical-align: top;\n}\n#wenyan table th {\n text-align: center;\n font-weight: bold;\n color: var(--primary-color);\n background: #f7f7f7;\n}\n#wenyan hr {\n margin-top: 20px;\n margin-bottom: 20px;\n border: 0;\n border-top: 2px solid #eef2f5;\n border-radius: 2px;\n}\n#wenyan pre {\n border-radius: 5px;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n#wenyan .footnote {\n color: var(--primary-color);\n}\n#wenyan #footnotes p {\n display: flex;\n margin: 0;\n font-size: 0.9em;\n}\n#wenyan .footnote-num {\n display: inline;\n width: 10%;\n}\n#wenyan .footnote-txt {\n display: inline;\n width: 90%;\n word-wrap: break-word;\n word-break: break-all;\n}\n";
|
|
593
|
+
const __vite_glob_0_3 = '/*\n * Typora Theme - Maize / Author - BEATREE\n * https://github.com/BEATREE/typora-maize-theme\n */\n\n:root {\n --bg-color: #fafafa;\n --text-color: #333333;\n --primary-color: #428bca;\n}\n#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n margin: 1.2em 0 1em;\n padding: 0px;\n font-weight: bold;\n}\n#wenyan h1 {\n font-size: 1.5em;\n}\n#wenyan h2::before {\n content: "";\n width: 20px;\n height: 30px;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIj4KICAgIDxnPgogICAgICAgIDxwYXRoIGQ9Im0zMy40NTIgNjIuMTQyUzY2LjA2MyAxNC45MzcgOTAuNDU2IDEwLjI4M2wxLjQyOSAxLjcxNFM3Mi41MzIgMjkuNTgyIDU4LjEzMyA0OC41ODNDNDMuMDg0IDY4LjQ0MiAzNi4wNTggODkuOTQ3IDMxLjg4IDg5LjcxNWMtNS42ODEtLjQxLTEyLjQyOS0zNy43MTYtMjMuMjg3LTMzLjI4Ny0yLjI4Ni0uNTcxIDMuOTEyLTkuNjE0IDEyLjU3Mi03LjU3MiA1LjQzIDEuMjgxIDEyLjI4NyAxMy4yODYgMTIuMjg3IDEzLjI4NnoiIGZpbGw9IiNmZmIxMWIiIC8+CiAgICA8L2c+Cjwvc3ZnPg==);\n background-repeat: no-repeat;\n background-size: 20px 20px;\n margin-right: 4px;\n background-position-y: 10px;\n}\n#wenyan h2 {\n font-size: 1.3em;\n display: flex;\n align-items: top;\n}\n#wenyan h2 span {\n font-weight: bold;\n color: #333;\n padding: 3px 10px 1px;\n}\n#wenyan h3 {\n font-size: 1.3em;\n}\n#wenyan h4 {\n font-size: 1.2em;\n}\n#wenyan h5 {\n font-size: 1.2em;\n}\n#wenyan h6 {\n font-size: 1.2em;\n}\n#wenyan ul,\n#wenyan ol {\n margin-top: 8px;\n margin-bottom: 8px;\n padding-left: 40px;\n color: black;\n}\n#wenyan ul {\n list-style-type: disc;\n}\n#wenyan ul ul {\n list-style-type: square;\n}\n#wenyan ol {\n list-style-type: decimal;\n}\n#wenyan strong {\n color: #e49123;\n font-weight: bold;\n}\n#wenyan blockquote {\n margin: 0;\n padding: 10px 10px 10px 20px;\n font-size: 0.9em;\n background: #fff9f9;\n border-left: 3px solid #ffb11b;\n color: #6a737d;\n overflow: auto;\n}\n#wenyan a {\n word-wrap: break-word;\n text-decoration: none;\n font-weight: bold;\n color: #e49123;\n border-bottom: 1px solid #e49123;\n}\n#wenyan hr {\n height: 1px;\n padding: 0;\n border: none;\n text-align: center;\n background-image: linear-gradient(to right, rgba(231, 93, 109, 0.3), rgba(255, 159, 150, 0.75), rgba(255, 216, 181, 0.3));\n}\n#wenyan p code,\n#wenyan span code,\n#wenyan li code {\n word-wrap: break-word;\n padding: 2px 4px;\n border-radius: 4px;\n margin: 0 2px;\n word-break: break-all;\n color: rgb(235, 76, 55);\n background-color: #f0f0f0;\n font-size: .8em;\n}\n#wenyan img {\n max-width: 100%;\n display: block;\n margin: 0 auto;\n border-radius: 5px;\n box-shadow: 0px 4px 12px #84a1a8;\n border: 0px;\n}\n#wenyan table {\n border-collapse: collapse;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n overflow: auto;\n display: table;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table td,\n#wenyan table th {\n font-size: 0.75em;\n padding: 9px 12px;\n line-height: 22px;\n color: #222;\n border: 1px solid rgb(255, 216, 181);\n vertical-align: top;\n}\n#wenyan table th {\n font-weight: bold;\n color: #ffb11b;\n background: #fff9f9;\n}\n#wenyan table tr:nth-child(2n) {\n background: #fff9f9;\n}\n#wenyan pre {\n border-radius: 5px;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n#wenyan .footnote {\n font-weight: bold;\n color: #e49123;\n}\n#wenyan #footnotes p {\n display: flex;\n margin: 0;\n font-size: 0.9em;\n}\n#wenyan .footnote-num {\n display: inline;\n width: 10%;\n}\n#wenyan .footnote-txt {\n display: inline;\n width: 90%;\n word-wrap: break-word;\n word-break: break-all;\n}\n';
|
|
594
|
+
const __vite_glob_0_4 = "#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan * {\n box-sizing: border-box;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n margin: 1em 0;\n}\n#wenyan h1 {\n font-size: 2em;\n font-weight: 700;\n}\n#wenyan h2,\n#wenyan h3 {\n font-size: 1.3em;\n font-weight: 700;\n}\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n font-size: 1.2em;\n font-weight: 700;\n}\n#wenyan p {\n letter-spacing: -0.003em;\n margin: 1em 0;\n}\n#wenyan ul,\n#wenyan ol {\n padding-left: 1.2em;\n}\n#wenyan li {\n margin-left: 1.2em;\n}\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n#wenyan table {\n border-collapse: collapse;\n font-size: 15px;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n width: 100%;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table th {\n background: #ebeced;\n color: #191b1f;\n font-weight: 500;\n}\n#wenyan table td,\n#wenyan table th {\n border: 1px solid #c4c7ce;\n height: 24px;\n line-height: 24px;\n padding: 3px 12px;\n}\n#wenyan blockquote {\n letter-spacing: -0.003em;\n border-left: 3px solid rgba(0, 0, 0, 0.84);\n padding-left: 20px;\n margin: 0 0 20px 0;\n}\n#wenyan p code {\n padding: 4px 6px;\n font-size: 0.78em;\n border-radius: 3px;\n background-color: #f2f2f2;\n}\n#wenyan pre {\n line-height: 2;\n margin: 1em 0.5em;\n padding: 1em;\n background: #f9f9f9;\n border-radius: 4px;\n border: 1px solid #e5e5e5;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n background: #f9f9f9;\n}\n#wenyan hr {\n border: none;\n border-top: 1px solid #c4c7ce;\n margin: 2em auto;\n max-width: 100%;\n width: 240px;\n}\n/* 链接 */\n#wenyan a {\n word-wrap: break-word;\n color: #000000;\n}\n/* 脚注 */\n#wenyan #footnotes ul {\n font-size: 0.9em;\n margin: 0;\n padding-left: 1.2em;\n}\n#wenyan #footnotes li {\n margin: 0 0 0 1.2em;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan .footnote {\n color: #000000;\n}\n";
|
|
595
|
+
const __vite_glob_0_5 = '/*\n * Typora Theme - Orange Heart / Author - evgo2017\n * https://github.com/evgo2017/typora-theme-orange-heart\n */\n\n#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n margin: 1.2em 0 1em;\n padding: 0px;\n font-weight: bold;\n}\n#wenyan h1 {\n font-size: 1.5em;\n}\n#wenyan h2 {\n font-size: 1.3em;\n border-bottom: 2px solid rgb(239, 112, 96);\n display: flex;\n}\n#wenyan h2 span {\n display: inline-block;\n font-weight: bold;\n background: rgb(239, 112, 96);\n color: #ffffff;\n padding: 3px 10px 1px;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n margin-right: 3px;\n}\n#wenyan h2::after {\n content: "";\n border-bottom: 36px solid #efebe9;\n border-right: 20px solid transparent;\n align-self: flex-end;\n height: 0;\n}\n#wenyan h3 {\n font-size: 1.3em;\n}\n#wenyan h4 {\n font-size: 1.2em;\n}\n#wenyan h5 {\n font-size: 1.1em;\n}\n#wenyan h6 {\n font-size: 1em;\n}\n#wenyan ul,\n#wenyan ol {\n margin-top: 8px;\n margin-bottom: 8px;\n padding-left: 25px;\n color: black;\n}\n#wenyan ul {\n list-style-type: disc;\n}\n#wenyan ul ul {\n list-style-type: square;\n}\n#wenyan ol {\n list-style-type: decimal;\n}\n#wenyan blockquote {\n margin: 0;\n display: block;\n font-size: 0.9em;\n overflow: auto;\n border-left: 3px solid rgb(239, 112, 96);\n color: #6a737d;\n padding: 10px 10px 10px 20px;\n margin-bottom: 20px;\n margin-top: 20px;\n background: #fff9f9;\n}\n#wenyan a {\n text-decoration: none;\n word-wrap: break-word;\n font-weight: bold;\n color: rgb(239, 112, 96);\n border-bottom: 1px solid rgb(239, 112, 96);\n}\n#wenyan p code,\n#wenyan li code {\n font-size: 0.9em;\n word-wrap: break-word;\n padding: 2px 4px;\n border-radius: 4px;\n margin: 0 2px;\n color: rgb(239, 112, 96);\n background-color: rgba(27, 31, 35, 0.05);\n word-break: break-all;\n}\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n#wenyan span img {\n max-width: 100%;\n display: inline-block;\n border-right: 0px;\n border-left: 0px;\n}\n#wenyan table {\n border-collapse: collapse;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n overflow: auto;\n display: table;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table td,\n#wenyan table th {\n font-size: 0.75em;\n padding: 9px 12px;\n line-height: 22px;\n color: #222;\n border: 1px solid rgb(239, 112, 96);\n vertical-align: top;\n}\n#wenyan table th {\n font-weight: bold;\n background-color: #fff9f9;\n color: rgb(239, 112, 96);\n}\n#wenyan span code,\n#wenyan li code {\n color: rgb(239, 112, 96);\n}\n#wenyan pre {\n border-radius: 5px;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n margin: .5em;\n padding: 0;\n}\n#wenyan .footnote {\n color: rgb(239, 112, 96);\n}\n#wenyan #footnotes p {\n display: flex;\n margin: 0;\n font-size: 0.9em;\n}\n#wenyan .footnote-num {\n display: inline;\n width: 10%;\n}\n#wenyan .footnote-txt {\n display: inline;\n width: 90%;\n word-wrap: break-word;\n word-break: break-all;\n}\n';
|
|
576
596
|
const __vite_glob_0_6 = `/*
|
|
577
597
|
* Typora Theme - Phycat / Author - sumruler
|
|
578
598
|
* https://github.com/sumruler/typora-theme-phycat
|
|
@@ -589,11 +609,7 @@ const __vite_glob_0_6 = `/*
|
|
|
589
609
|
--h6-r-graphic: url("data:image/svg+xml;utf8,<svg fill='rgba(74, 200, 141, 0.5)' height='24' viewBox='0 0 32 32' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M4.571 25.143c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM4.571 18.286c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM4.571 11.429c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM11.429 18.286c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM11.429 25.143c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM11.429 16c1.257 0 2.286-1.029 2.286-2.286s-1.029-2.286-2.286-2.286-2.286 1.029-2.286 2.286 1.029 2.286 2.286 2.286z'/></svg>")
|
|
590
610
|
no-repeat center;
|
|
591
611
|
|
|
592
|
-
/* 是否开启网格背景?1 是;0 否 */
|
|
593
|
-
--bg-grid: 0;
|
|
594
|
-
|
|
595
612
|
/* 主题颜色 */
|
|
596
|
-
|
|
597
613
|
--head-title-color: #3db8bf;
|
|
598
614
|
/* 标题主色 */
|
|
599
615
|
--head-title-h2-color: #fff;
|
|
@@ -618,32 +634,18 @@ const __vite_glob_0_6 = `/*
|
|
|
618
634
|
}
|
|
619
635
|
#wenyan {
|
|
620
636
|
font-size: 14px;
|
|
621
|
-
font-family: var(--sans-serif-font);
|
|
622
637
|
margin: 0 auto;
|
|
623
|
-
padding: 15px;
|
|
624
638
|
line-height: 1.75;
|
|
625
|
-
color: #000;
|
|
626
639
|
letter-spacing: 1.1px;
|
|
627
640
|
word-break: break-word;
|
|
628
641
|
word-wrap: break-word;
|
|
629
642
|
text-align: left;
|
|
630
|
-
background-image: linear-gradient(
|
|
631
|
-
90deg,
|
|
632
|
-
rgba(50, 0, 0, 0.05) calc(3% * var(--bg-grid)),
|
|
633
|
-
rgba(0, 0, 0, 0) calc(3% * var(--bg-grid))
|
|
634
|
-
),
|
|
635
|
-
linear-gradient(
|
|
636
|
-
360deg,
|
|
637
|
-
rgba(50, 0, 0, 0.05) calc(3% * var(--bg-grid)),
|
|
638
|
-
rgba(0, 0, 0, 0) calc(3% * var(--bg-grid))
|
|
639
|
-
);
|
|
640
|
-
background-size: 20px 20px;
|
|
641
643
|
background-position: center center;
|
|
642
644
|
}
|
|
643
645
|
#wenyan p {
|
|
644
646
|
text-align: justify;
|
|
645
647
|
color: #333;
|
|
646
|
-
margin: 10px
|
|
648
|
+
margin: 10px 0;
|
|
647
649
|
word-spacing: 2px;
|
|
648
650
|
}
|
|
649
651
|
#wenyan h3::after,
|
|
@@ -784,9 +786,6 @@ h6 {
|
|
|
784
786
|
margin: 0px 6px;
|
|
785
787
|
word-spacing: 2px;
|
|
786
788
|
line-height: 2.5;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
#wenyan li {
|
|
790
789
|
position: relative;
|
|
791
790
|
}
|
|
792
791
|
#wenyan li > p {
|
|
@@ -843,7 +842,6 @@ h6 {
|
|
|
843
842
|
color: var(--element-color-linecode);
|
|
844
843
|
background: var(--element-color-linecode-background);
|
|
845
844
|
border-radius: 3px;
|
|
846
|
-
font-family: var(--monospace-font);
|
|
847
845
|
letter-spacing: 0.5px;
|
|
848
846
|
}
|
|
849
847
|
#wenyan li code {
|
|
@@ -855,9 +853,9 @@ h6 {
|
|
|
855
853
|
margin: 1em 0.5em;
|
|
856
854
|
padding: 0.5em;
|
|
857
855
|
box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;
|
|
856
|
+
font-size: 12px;
|
|
858
857
|
}
|
|
859
858
|
#wenyan pre code {
|
|
860
|
-
font-family: var(--monospace-font);
|
|
861
859
|
display: block;
|
|
862
860
|
overflow-x: auto;
|
|
863
861
|
margin: 0.5em;
|
|
@@ -908,11 +906,11 @@ h6 {
|
|
|
908
906
|
word-break: break-all;
|
|
909
907
|
}
|
|
910
908
|
`;
|
|
911
|
-
const __vite_glob_0_7 = '/*\n * Typora Theme - Pie / Author - kevinzhao2233\n * https://github.com/kevinzhao2233/typora-theme-pie\n */\n\n:root {\n --mid-1: #ffffff;\n --mid-7: #8c8c8c;\n --mid-9: #434343;\n --mid-10: #262626;\n --main-1: #fff2f0;\n --main-4: #f27f79;\n --main-5: #e6514e;\n --main-6: #da282a;\n}\n#wenyan {\n
|
|
912
|
-
const __vite_glob_0_8 = '/*\n * Typora Theme - Purple / Author - hliu202\n * https://github.com/hliu202/typora-purple-theme\n */\n\n:root {\n --title-color: #8064a9;\n --text-color: #444444;\n --link-color: #2aa899;\n --code-color: #745fb5;\n --shadow-color: #eee;\n --border-quote: rgba(116, 95, 181, 0.2);\n --border: #e7e7e7;\n --link-bottom: #bbb;\n --shadow: 3px 3px 10px var(--shadow-color);\n --inline-code-bg: #f4f2f9;\n --header-weight: normal;\n}\n#wenyan {\n
|
|
913
|
-
const __vite_glob_0_9 = '/*\n * Typora Theme - Rainbow / Author - thezbm\n * https://github.com/thezbm/typora-theme-rainbow\n */\n\n:root {\n --h-border-color: rgb(255, 191, 191);\n --h-bg-color: rgb(255, 232, 232);\n --table-border-color: rgb(255, 235, 211);\n --th-bg-color: rgb(255, 243, 228);\n --tr-bg-color: rgb(255, 249, 242);\n --code-bg-color: rgb(247, 247, 247);\n --block-shadow: 0.15em 0.15em 0.5em rgb(150, 150, 150);\n}\n#wenyan {\n
|
|
914
|
-
const __vite_glob_0_10 = '#wenyan {\n
|
|
915
|
-
const __vite_glob_0_11 = "#wenyan {\n
|
|
909
|
+
const __vite_glob_0_7 = '/*\n * Typora Theme - Pie / Author - kevinzhao2233\n * https://github.com/kevinzhao2233/typora-theme-pie\n */\n\n:root {\n --mid-1: #ffffff;\n --mid-7: #8c8c8c;\n --mid-9: #434343;\n --mid-10: #262626;\n --main-1: #fff2f0;\n --main-4: #f27f79;\n --main-5: #e6514e;\n --main-6: #da282a;\n}\n#wenyan {\n line-height: 1.75;\n color: var(--mid-10);\n letter-spacing: 0;\n font-size: 16px;\n}\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan p {\n word-spacing: 0.05rem;\n text-align: justify;\n}\n#wenyan a {\n word-wrap: break-word;\n color: var(--main-6);\n text-decoration: none;\n border-bottom: 1px solid var(--main-6);\n transition: border-bottom 0.2s;\n padding: 0 2px;\n font-weight: 500;\n text-decoration: none;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n position: relative;\n margin: 1.2em 0 1em;\n padding: 0px;\n font-weight: bold;\n cursor: text;\n}\n#wenyan h2 a,\n#wenyan h3 a {\n color: var(--mid-9);\n}\n#wenyan h1 {\n font-size: 1.5em;\n text-align: center;\n}\n#wenyan h1::after {\n display: block;\n width: 100px;\n height: 2px;\n margin: 0.2em auto 0;\n content: "";\n border-bottom: 2px dashed var(--main-6);\n}\n#wenyan h2 {\n padding-left: 6px;\n margin: 2em auto 1.4em;\n font-size: 1.3em;\n border-left: 6px solid var(--main-6);\n}\n#wenyan h3 {\n font-size: 1.2em;\n}\n#wenyan h3::before {\n display: inline-block;\n width: 6px;\n height: 6px;\n margin-right: 6px;\n margin-bottom: 0.18em;\n line-height: 1.43;\n vertical-align: middle;\n content: "";\n background-color: var(--main-5);\n border-radius: 50%;\n}\n#wenyan h4 {\n font-size: 1.2em;\n}\n#wenyan h4::before {\n display: inline-block;\n width: 6px;\n height: 2px;\n margin-right: 8px;\n margin-bottom: 0.18em;\n vertical-align: middle;\n content: "";\n background-color: var(--main-4);\n}\n#wenyan h5 {\n font-size: 1.2em;\n}\n#wenyan h6 {\n font-size: 1.2em;\n color: var(--mid-7);\n}\n#wenyan li > ol,\n#wenyan li > ul {\n margin: 0;\n}\n#wenyan hr {\n box-sizing: content-box;\n width: 100%;\n height: 1px;\n padding: 0;\n margin: 46px auto 64px;\n overflow: hidden;\n background-color: var(--main-4);\n border: 0;\n}\n#wenyan blockquote {\n position: relative;\n padding: 24px 16px 12px;\n margin: 24px 0 36px;\n font-size: 1em;\n font-style: normal;\n line-height: 1.6;\n color: var(--mid-7);\n text-indent: 0;\n border: none;\n border-left: 2px solid var(--main-6);\n}\n#wenyan blockquote blockquote {\n padding-right: 0;\n}\n#wenyan blockquote a {\n color: var(--mid-7);\n}\n#wenyan blockquote::before {\n position: absolute;\n top: 0;\n left: 12px;\n font-size: 2em;\n font-weight: 700;\n line-height: 1em;\n color: var(--main-6);\n content: "“";\n}\n#wenyan table {\n border-collapse: collapse;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n overflow: auto;\n display: table;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table td,\n#wenyan table th {\n font-size: 0.75em;\n padding: 9px 12px;\n line-height: 22px;\n vertical-align: top;\n border: 1px solid var(--main-4);\n}\n#wenyan table th {\n font-weight: bold;\n color: var(--main-6);\n background-color: var(--main-1);\n}\n#wenyan strong {\n padding: 0 1px;\n}\n#wenyan em {\n padding: 0 5px 0 2px;\n}\n#wenyan p code {\n padding: 2px 4px 1px;\n margin: 0 2px;\n font-size: 0.92rem;\n color: var(--main-5);\n background-color: var(--main-1);\n border-radius: 3px;\n}\n#wenyan p code {\n vertical-align: 0.5px;\n}\n#wenyan .footnote {\n color: var(--main-5);\n background-color: var(--main-1);\n}\n#wenyan img {\n max-width: 100%;\n display: block;\n margin: 0 auto;\n border-radius: 4px;\n}\n#wenyan pre {\n border-radius: 5px;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n#wenyan .footnote {\n color: rgb(239, 112, 96);\n}\n#wenyan #footnotes p {\n display: flex;\n margin: 0;\n font-size: 0.9em;\n}\n#wenyan .footnote-num {\n display: inline;\n width: 10%;\n}\n#wenyan .footnote-txt {\n display: inline;\n width: 90%;\n word-wrap: break-word;\n word-break: break-all;\n}\n';
|
|
910
|
+
const __vite_glob_0_8 = '/*\n * Typora Theme - Purple / Author - hliu202\n * https://github.com/hliu202/typora-purple-theme\n */\n\n:root {\n --title-color: #8064a9;\n --text-color: #444444;\n --link-color: #2aa899;\n --code-color: #745fb5;\n --shadow-color: #eee;\n --border-quote: rgba(116, 95, 181, 0.2);\n --border: #e7e7e7;\n --link-bottom: #bbb;\n --shadow: 3px 3px 10px var(--shadow-color);\n --inline-code-bg: #f4f2f9;\n --header-weight: normal;\n}\n#wenyan {\n color: var(--text-color);\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan a {\n word-wrap: break-word;\n border-bottom: 1px solid var(--link-bottom);\n color: var(--link-color);\n text-decoration: none;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n margin: 1.2em 0 1em;\n padding: 0px;\n font-weight: var(--header-weight);\n color: var(--title-color);\n}\n#wenyan h1 {\n text-align: center;\n}\n#wenyan h1::after {\n content: "";\n display: block;\n margin: 0.2em auto 0;\n width: 6em;\n height: 2px;\n border-bottom: 2px solid var(--title-color);\n}\n#wenyan h2 {\n padding-left: 0.4em;\n border-left: 0.4em solid var(--title-color);\n border-bottom: 1px solid var(--title-color);\n}\n#wenyan h1 {\n font-size: 1.5em;\n}\n#wenyan h2 {\n font-size: 1.3em;\n}\n#wenyan h3 {\n font-size: 1.2em;\n}\n#wenyan h4 {\n font-size: 1.2em;\n}\n#wenyan h5 {\n font-size: 1.2em;\n}\n#wenyan h6 {\n font-size: 1.2em;\n}\n#wenyan p,\n#wenyan ul,\n#wenyan ol {\n margin: 1em 0.8em;\n}\n#wenyan hr {\n margin: 1.5em auto;\n border-top: 1px solid var(--border);\n}\n#wenyan li > ol,\n#wenyan li > ul {\n margin: 0 0;\n}\n#wenyan ul,\n#wenyan ol {\n padding-left: 2em;\n}\n#wenyan ol li,\n#wenyan ul li {\n padding-left: 0.1em;\n}\n#wenyan blockquote {\n margin: 0;\n border-left: 0.3em solid var(--border-quote);\n padding-left: 1em;\n}\n#wenyan table {\n border-collapse: collapse;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n overflow: auto;\n display: table;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table td,\n#wenyan table th {\n font-size: 0.75em;\n padding: 9px 12px;\n line-height: 22px;\n color: #222;\n border: 1px solid var(--border-quote);\n vertical-align: top;\n}\n#wenyan table th {\n font-weight: bold;\n color: var(--title-color);\n background-color: var(--inline-code-bg);\n}\n#wenyan strong {\n padding: 0 2px;\n font-weight: bold;\n}\n#wenyan p code {\n padding: 2px 4px;\n border-radius: 0.3em;\n font-size: 0.9em;\n color: var(--code-color);\n background-color: var(--inline-code-bg);\n margin: 0 2px;\n}\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n#wenyan pre {\n border-radius: 5px;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n#wenyan .footnote {\n color: var(--code-color);\n background-color: var(--inline-code-bg);\n}\n#wenyan #footnotes p {\n display: flex;\n margin: 0;\n font-size: 0.9em;\n}\n#wenyan .footnote-num {\n display: inline;\n width: 10%;\n}\n#wenyan .footnote-txt {\n display: inline;\n width: 90%;\n word-wrap: break-word;\n word-break: break-all;\n}\n';
|
|
911
|
+
const __vite_glob_0_9 = '/*\n * Typora Theme - Rainbow / Author - thezbm\n * https://github.com/thezbm/typora-theme-rainbow\n */\n\n:root {\n --h-border-color: rgb(255, 191, 191);\n --h-bg-color: rgb(255, 232, 232);\n --table-border-color: rgb(255, 235, 211);\n --th-bg-color: rgb(255, 243, 228);\n --tr-bg-color: rgb(255, 249, 242);\n --code-bg-color: rgb(247, 247, 247);\n --block-shadow: 0.15em 0.15em 0.5em rgb(150, 150, 150);\n}\n#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n margin: 1.2em 0 1em;\n padding: 0px;\n font-weight: bold;\n}\n#wenyan h1 {\n font-size: 1.5em;\n text-align: center;\n text-shadow: 0.15em 0.15em 0.3em rgb(187, 187, 187);\n}\n#wenyan h2 {\n font-size: 1.3em;\n background-color: var(--h-bg-color);\n padding-left: 1em;\n padding-right: 1em;\n border-left: 0.5em solid var(--h-border-color);\n border-radius: 0.4em;\n display: inline-block;\n}\n#wenyan h3 {\n font-size: 1.3em;\n text-decoration: underline double var(--h-border-color);\n -webkit-text-decoration: underline double var(--h-border-color);\n text-decoration-thickness: 0.15em;\n}\n#wenyan h4 {\n font-size: 1.2em;\n text-decoration: underline dotted var(--h-border-color);\n -webkit-text-decoration: underline dotted var(--h-border-color);\n text-decoration-thickness: 0.2em;\n}\n#wenyan table {\n border-collapse: collapse;\n border: 0.25em solid var(--table-border-color);\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n overflow: auto;\n display: table;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table th {\n background-color: var(--th-bg-color);\n}\n#wenyan table th,\n#wenyan table td {\n font-size: 0.75em;\n text-align: center;\n border: 0.13em dashed var(--table-border-color);\n padding: 0.5em;\n padding: 9px 12px;\n line-height: 22px;\n vertical-align: top;\n}\n#wenyan table tr:nth-child(even) {\n background-color: var(--tr-bg-color);\n}\n#wenyan blockquote {\n font-size: 0.9em;\n margin: 0 1em;\n color: rgb(102, 102, 102);\n border-left: 0.25em solid rgb(169, 202, 255);\n padding: 0.5em 1em 0.6em 1em;\n}\n#wenyan blockquote::before {\n display: block;\n height: 2em;\n width: 1.5em;\n content: "🌈";\n font-size: 1.2em;\n}\n#wenyan blockquote p {\n margin: 0;\n}\n#wenyan hr {\n margin-top: 2em;\n margin-bottom: 2em;\n background-color: rgb(226, 226, 226);\n height: 0.13em;\n border: 0;\n}\n#wenyan pre {\n line-height: 2;\n padding: .5em;\n border-radius: 0.4em;\n box-shadow: var(--block-shadow);\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n#wenyan p code {\n margin-left: 0.25em;\n margin-right: 0.25em;\n padding: 0.05em 0.3em;\n background-color: var(--code-bg-color);\n border-radius: 0.4em;\n box-shadow: 0.13em 0.13em 0.26em rgb(197, 197, 197);\n font-size: 0.9em;\n}\n#wenyan a {\n word-wrap: break-word;\n color: rgb(31, 117, 255);\n}\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n border-radius: 5px;\n box-shadow: var(--block-shadow);\n}\n#wenyan .footnote {\n color: rgb(31, 117, 255);\n}\n#wenyan #footnotes p {\n display: flex;\n margin: 0;\n font-size: 0.9em;\n}\n#wenyan .footnote-num {\n display: inline;\n width: 10%;\n}\n#wenyan .footnote-txt {\n display: inline;\n width: 90%;\n word-wrap: break-word;\n word-break: break-all;\n}\n';
|
|
912
|
+
const __vite_glob_0_10 = '#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan * {\n box-sizing: border-box;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6,\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n font-size: 17px;\n line-height: 30px;\n margin-top: 20px;\n margin-bottom: 12px;\n position: relative;\n}\n#wenyan h1:before,\n#wenyan h2:before,\n#wenyan h3:before,\n#wenyan h4:before,\n#wenyan h5:before,\n#wenyan h6:before {\n content: "";\n display: inline-block;\n vertical-align: 1px;\n width: 10px;\n height: 26px;\n margin-right: 6px;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyNiIgdmlld0JveD0iMCAwIDEwIDI2IiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJNOS41IDYuNTY2NTlMNC40OTk5NCAxOS40MzI2TDAgMTkuNDMyNkw1LjAwMDA2IDYuNTY2NTlMOS41IDYuNTY2NTlaIiBmaWxsPSIjRkY0MDNBIi8+Cjwvc3ZnPgo=);\n background-repeat: no-repeat;\n background-size: cover;\n background-position-y: 8px;\n}\n#wenyan ul,\n#wenyan ol {\n padding-left: 1.2em;\n}\n#wenyan li {\n margin-left: 1.2em;\n}\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n#wenyan table {\n margin-left: auto;\n margin-right: auto;\n border-collapse: collapse;\n table-layout: fixed;\n overflow: auto;\n border-spacing: 0;\n font-size: 1em;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table td,\n#wenyan table th {\n height: 40px;\n padding: 9px 12px;\n line-height: 22px;\n color: #222;\n min-width: 88px;\n border: 1px solid #d8d8d8;\n vertical-align: top;\n}\n#wenyan blockquote {\n margin: 0;\n margin-bottom: 20px;\n padding: 0 16px;\n position: relative;\n color: #999;\n text-align: justify;\n}\n#wenyan blockquote:before {\n content: " ";\n left: 0;\n position: absolute;\n width: 2px;\n height: 100%;\n background: #f2f2f2;\n}\n#wenyan p code {\n color: #1e6bb8;\n}\n/* 代码块 */\n#wenyan pre {\n border-radius: 3px;\n border: 1px solid #e8e8e8;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n#wenyan hr {\n width: 100%;\n height: 1px;\n background-color: #e8e8e8;\n border: none;\n margin: 20px 0;\n}\n/* 链接 */\n#wenyan a {\n word-wrap: break-word;\n color: #0069c2;\n}\n/* 脚注 */\n#wenyan #footnotes ul {\n font-size: 0.9em;\n margin: 0;\n padding-left: 1.2em;\n}\n#wenyan #footnotes li {\n margin: 0 0 0 1.2em;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan .footnote {\n color: #0069c2;\n}\n';
|
|
913
|
+
const __vite_glob_0_11 = "#wenyan {\n line-height: 1.75;\n font-size: 16px;\n}\n#wenyan * {\n box-sizing: border-box;\n}\n#wenyan h1,\n#wenyan h2,\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6,\n#wenyan p {\n margin: 1em 0;\n}\n#wenyan h1,\n#wenyan h2 {\n clear: left;\n font-size: 1.2em;\n font-weight: 600;\n line-height: 1.5;\n margin-bottom: 1.16667em;\n margin-top: 2.33333em;\n}\n#wenyan h3,\n#wenyan h4,\n#wenyan h5,\n#wenyan h6 {\n clear: left;\n font-size: 1.1em;\n font-weight: 600;\n line-height: 1.5;\n margin-bottom: 1.27273em;\n margin-top: 1.90909em;\n}\n#wenyan ul,\n#wenyan ol {\n padding-left: 1.2em;\n}\n#wenyan li {\n margin-left: 1.2em;\n}\n#wenyan img {\n max-width: 100%;\n height: auto;\n margin: 0 auto;\n display: block;\n}\n#wenyan table {\n border-collapse: collapse;\n font-size: 15px;\n margin: 1.4em auto;\n max-width: 100%;\n table-layout: fixed;\n text-align: left;\n width: 100%;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan table th {\n background: #ebeced;\n color: #191b1f;\n font-weight: 500;\n}\n#wenyan table td,\n#wenyan table th {\n border: 1px solid #c4c7ce;\n height: 24px;\n line-height: 24px;\n padding: 3px 12px;\n}\n#wenyan blockquote {\n border-left: 3px solid #c4c7ce;\n margin: 1.5em 0;\n padding: 0 0 1em 1em;\n color: #535861;\n}\n#wenyan code {\n margin: 0px 2px;\n padding: 3px 4px;\n border-radius: 3px;\n background-color: rgb(246, 246, 246);\n}\n#wenyan pre {\n word-wrap: normal;\n background: #f8f8fa;\n border-radius: 4px;\n line-height: 2;\n margin: 1em 0.5em;\n padding: .5em;\n white-space: pre;\n word-break: normal;\n font-size: 12px;\n}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n}\n#wenyan hr {\n border: none;\n border-top: 1px solid #c4c7ce;\n margin: 2em auto;\n max-width: 100%;\n width: 240px;\n}\n/* 链接 */\n#wenyan a {\n word-wrap: break-word;\n color: #0069c2;\n}\n/* 脚注 */\n#wenyan #footnotes ul {\n font-size: 0.9em;\n margin: 0;\n padding-left: 1.2em;\n}\n#wenyan #footnotes li {\n margin: 0 0 0 1.2em;\n word-wrap: break-word;\n word-break: break-all;\n}\n#wenyan .footnote {\n color: #0069c2;\n}\n";
|
|
916
914
|
const registry = /* @__PURE__ */ new Map();
|
|
917
915
|
function registerTheme(theme) {
|
|
918
916
|
registry.set(theme.meta.id, theme);
|
|
@@ -990,18 +988,18 @@ const otherBuiltInThemeMetas = otherThemeIds.map((id) => ({
|
|
|
990
988
|
author: ""
|
|
991
989
|
}));
|
|
992
990
|
const cssModules = /* @__PURE__ */ Object.assign({
|
|
993
|
-
"
|
|
994
|
-
"
|
|
995
|
-
"
|
|
996
|
-
"
|
|
997
|
-
"
|
|
998
|
-
"
|
|
999
|
-
"
|
|
1000
|
-
"
|
|
1001
|
-
"
|
|
1002
|
-
"
|
|
1003
|
-
"
|
|
1004
|
-
"
|
|
991
|
+
"/src/assets/themes/default.css": __vite_glob_0_0,
|
|
992
|
+
"/src/assets/themes/juejin_default.css": __vite_glob_0_1,
|
|
993
|
+
"/src/assets/themes/lapis.css": __vite_glob_0_2,
|
|
994
|
+
"/src/assets/themes/maize.css": __vite_glob_0_3,
|
|
995
|
+
"/src/assets/themes/medium_default.css": __vite_glob_0_4,
|
|
996
|
+
"/src/assets/themes/orangeheart.css": __vite_glob_0_5,
|
|
997
|
+
"/src/assets/themes/phycat.css": __vite_glob_0_6,
|
|
998
|
+
"/src/assets/themes/pie.css": __vite_glob_0_7,
|
|
999
|
+
"/src/assets/themes/purple.css": __vite_glob_0_8,
|
|
1000
|
+
"/src/assets/themes/rainbow.css": __vite_glob_0_9,
|
|
1001
|
+
"/src/assets/themes/toutiao_default.css": __vite_glob_0_10,
|
|
1002
|
+
"/src/assets/themes/zhihu_default.css": __vite_glob_0_11
|
|
1005
1003
|
});
|
|
1006
1004
|
function registerAllBuiltInThemes() {
|
|
1007
1005
|
registerBuiltInThemes(gzhBuiltInThemeMetas);
|
|
@@ -1009,7 +1007,7 @@ function registerAllBuiltInThemes() {
|
|
|
1009
1007
|
}
|
|
1010
1008
|
function registerBuiltInThemes(themeMetas) {
|
|
1011
1009
|
for (const meta of themeMetas) {
|
|
1012
|
-
const path =
|
|
1010
|
+
const path = `/src/assets/themes/${meta.id}.css`;
|
|
1013
1011
|
const loader = cssModules[path];
|
|
1014
1012
|
if (!loader) continue;
|
|
1015
1013
|
registerTheme(
|
|
@@ -1021,33 +1019,169 @@ function registerBuiltInThemes(themeMetas) {
|
|
|
1021
1019
|
}
|
|
1022
1020
|
}
|
|
1023
1021
|
function createTheme(meta, source) {
|
|
1024
|
-
return {
|
|
1025
|
-
meta,
|
|
1026
|
-
async getCss() {
|
|
1027
|
-
switch (source.type) {
|
|
1028
|
-
case "inline":
|
|
1029
|
-
return source.css;
|
|
1030
|
-
case "asset":
|
|
1031
|
-
return source.loader();
|
|
1032
|
-
// case "file":
|
|
1033
|
-
// return fs.readFile(source.path, "utf-8");
|
|
1034
|
-
case "url":
|
|
1035
|
-
const res = await fetch(source.url);
|
|
1036
|
-
if (!res.ok) throw new Error(`Failed to load theme CSS`);
|
|
1037
|
-
return res.text();
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
};
|
|
1022
|
+
return { meta, getCss: () => loadCssBySource(source) };
|
|
1041
1023
|
}
|
|
1042
1024
|
function getAllGzhThemes() {
|
|
1043
1025
|
return getAllThemes().filter((theme) => gzhBuiltInThemeMetas.some((meta) => meta.id === theme.meta.id));
|
|
1044
1026
|
}
|
|
1027
|
+
function getContentForMedium(wenyanElement) {
|
|
1028
|
+
processBlockquotes(wenyanElement);
|
|
1029
|
+
processCodeBlocks(wenyanElement);
|
|
1030
|
+
processTables(wenyanElement);
|
|
1031
|
+
const nestedUls = wenyanElement.querySelectorAll("ul ul");
|
|
1032
|
+
nestedUls.forEach((ul) => transformUl(ul));
|
|
1033
|
+
processMath(wenyanElement);
|
|
1034
|
+
return wenyanElement.outerHTML;
|
|
1035
|
+
}
|
|
1036
|
+
function processBlockquotes(root) {
|
|
1037
|
+
const paragraphs = root.querySelectorAll("blockquote p");
|
|
1038
|
+
const doc = root.ownerDocument;
|
|
1039
|
+
paragraphs.forEach((p) => {
|
|
1040
|
+
const span = doc.createElement("span");
|
|
1041
|
+
span.textContent = (p.textContent || "") + "\n\n";
|
|
1042
|
+
p.replaceWith(span);
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
function processCodeBlocks(root) {
|
|
1046
|
+
const preElements = root.querySelectorAll("pre");
|
|
1047
|
+
preElements.forEach((pre) => {
|
|
1048
|
+
pre.setAttribute("data-code-block-lang", "none");
|
|
1049
|
+
pre.setAttribute("data-code-block-mode", "2");
|
|
1050
|
+
const code = pre.querySelector("code");
|
|
1051
|
+
if (code) {
|
|
1052
|
+
let language = "";
|
|
1053
|
+
code.classList.forEach((cls) => {
|
|
1054
|
+
if (cls.startsWith("language-")) {
|
|
1055
|
+
language = cls.replace("language-", "");
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
if (language) {
|
|
1059
|
+
pre.setAttribute("data-code-block-lang", language);
|
|
1060
|
+
}
|
|
1061
|
+
const rawCode = code.textContent || "";
|
|
1062
|
+
code.textContent = rawCode.trim();
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
function processTables(root) {
|
|
1067
|
+
const tables = root.querySelectorAll("table");
|
|
1068
|
+
const doc = root.ownerDocument;
|
|
1069
|
+
tables.forEach((t) => {
|
|
1070
|
+
const pre = doc.createElement("pre");
|
|
1071
|
+
const code = doc.createElement("code");
|
|
1072
|
+
code.textContent = tableToAsciiArt(t);
|
|
1073
|
+
pre.appendChild(code);
|
|
1074
|
+
pre.setAttribute("data-code-block-lang", "none");
|
|
1075
|
+
pre.setAttribute("data-code-block-mode", "2");
|
|
1076
|
+
t.replaceWith(pre);
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
function processMath(root) {
|
|
1080
|
+
const mathElements = root.querySelectorAll("mjx-container");
|
|
1081
|
+
mathElements.forEach((element) => {
|
|
1082
|
+
const math = element.getAttribute("math");
|
|
1083
|
+
const parent = element.parentElement;
|
|
1084
|
+
const doc = element.ownerDocument;
|
|
1085
|
+
if (parent && math) {
|
|
1086
|
+
element.remove();
|
|
1087
|
+
const span = doc.createElement("span");
|
|
1088
|
+
span.textContent = math;
|
|
1089
|
+
parent.appendChild(span);
|
|
1090
|
+
}
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
function transformUl(ulElement) {
|
|
1094
|
+
const nestedUls = ulElement.querySelectorAll("ul");
|
|
1095
|
+
nestedUls.forEach((nestedUl) => transformUl(nestedUl));
|
|
1096
|
+
const children = Array.from(ulElement.children);
|
|
1097
|
+
const replaceString = children.map((item) => {
|
|
1098
|
+
return item.outerHTML.replace(/^<li[^>]*>/i, "<br>\n- ").replace(/<\/li>$/i, "");
|
|
1099
|
+
}).join(" ");
|
|
1100
|
+
ulElement.outerHTML = replaceString;
|
|
1101
|
+
}
|
|
1102
|
+
function tableToAsciiArt(table) {
|
|
1103
|
+
const rowsElements = Array.from(table.querySelectorAll("tr"));
|
|
1104
|
+
const rows = rowsElements.map(
|
|
1105
|
+
(tr) => Array.from(tr.querySelectorAll("th, td")).map((td) => td.innerText.trim())
|
|
1106
|
+
);
|
|
1107
|
+
if (rows.length === 0) return "";
|
|
1108
|
+
const columnWidths = rows[0].map(
|
|
1109
|
+
(_, colIndex) => Math.max(...rows.map((row) => getStringWidth(row[colIndex] || "")))
|
|
1110
|
+
);
|
|
1111
|
+
const horizontalLine = "+" + columnWidths.map((width) => "-".repeat(width + 2)).join("+") + "+\n";
|
|
1112
|
+
const formattedRows = rows.map(
|
|
1113
|
+
(row) => "| " + row.map((cell, i) => {
|
|
1114
|
+
const padding = columnWidths[i] - getStringWidth(cell);
|
|
1115
|
+
return cell + " ".repeat(Math.max(0, padding));
|
|
1116
|
+
}).join(" | ") + " |\n"
|
|
1117
|
+
);
|
|
1118
|
+
let asciiTable = horizontalLine;
|
|
1119
|
+
if (formattedRows.length > 0) {
|
|
1120
|
+
asciiTable += formattedRows[0];
|
|
1121
|
+
asciiTable += horizontalLine;
|
|
1122
|
+
}
|
|
1123
|
+
if (formattedRows.length > 1) {
|
|
1124
|
+
asciiTable += formattedRows.slice(1).join("");
|
|
1125
|
+
asciiTable += horizontalLine;
|
|
1126
|
+
}
|
|
1127
|
+
return asciiTable;
|
|
1128
|
+
}
|
|
1129
|
+
function getStringWidth(str) {
|
|
1130
|
+
let width = 0;
|
|
1131
|
+
for (let i = 0; i < str.length; i++) {
|
|
1132
|
+
width += str.charCodeAt(i) > 255 ? 2 : 1;
|
|
1133
|
+
}
|
|
1134
|
+
return width;
|
|
1135
|
+
}
|
|
1136
|
+
function getContentForZhihu(wenyanElement) {
|
|
1137
|
+
const elements = wenyanElement.querySelectorAll("mjx-container");
|
|
1138
|
+
const doc = wenyanElement.ownerDocument;
|
|
1139
|
+
elements.forEach((element) => {
|
|
1140
|
+
const math = element.getAttribute("math");
|
|
1141
|
+
if (!math) return;
|
|
1142
|
+
const img = doc.createElement("img");
|
|
1143
|
+
img.alt = math;
|
|
1144
|
+
img.dataset.eeimg = "true";
|
|
1145
|
+
img.style.cssText = "margin: 0 auto; width: auto; max-width: 100%; display: block;";
|
|
1146
|
+
element.replaceWith(img);
|
|
1147
|
+
});
|
|
1148
|
+
return wenyanElement.outerHTML;
|
|
1149
|
+
}
|
|
1150
|
+
function getContentForToutiao(wenyanElement) {
|
|
1151
|
+
const containers = wenyanElement.querySelectorAll("mjx-container");
|
|
1152
|
+
const doc = wenyanElement.ownerDocument;
|
|
1153
|
+
containers.forEach((container) => {
|
|
1154
|
+
const svg = container.querySelector("svg");
|
|
1155
|
+
if (!svg) {
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
1158
|
+
const img = doc.createElement("img");
|
|
1159
|
+
if (!svg.hasAttribute("xmlns")) {
|
|
1160
|
+
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
1161
|
+
}
|
|
1162
|
+
const encodedSVG = encodeURIComponent(svg.outerHTML);
|
|
1163
|
+
img.src = `data:image/svg+xml,${encodedSVG}`;
|
|
1164
|
+
const style = svg.getAttribute("style");
|
|
1165
|
+
if (style) {
|
|
1166
|
+
img.setAttribute("style", style);
|
|
1167
|
+
} else {
|
|
1168
|
+
img.style.verticalAlign = "middle";
|
|
1169
|
+
}
|
|
1170
|
+
const ariaLabel = container.getAttribute("aria-label") || container.getAttribute("title");
|
|
1171
|
+
if (ariaLabel) {
|
|
1172
|
+
img.alt = ariaLabel;
|
|
1173
|
+
}
|
|
1174
|
+
container.replaceWith(img);
|
|
1175
|
+
});
|
|
1176
|
+
return wenyanElement.outerHTML;
|
|
1177
|
+
}
|
|
1045
1178
|
async function createWenyanCore(options = {}) {
|
|
1046
1179
|
const { isConvertMathJax = true, isWechat = true } = options;
|
|
1047
1180
|
const markedClient = createMarkedClient();
|
|
1048
1181
|
const mathJaxParser = createMathJaxParser();
|
|
1049
1182
|
registerAllBuiltInThemes();
|
|
1050
1183
|
registerBuiltInHlThemes();
|
|
1184
|
+
registerBuiltInMacStyle();
|
|
1051
1185
|
return {
|
|
1052
1186
|
async handleFrontMatter(markdown) {
|
|
1053
1187
|
return await handleFrontMatter(markdown);
|
|
@@ -1086,8 +1220,9 @@ async function createWenyanCore(options = {}) {
|
|
|
1086
1220
|
`代码主题不存在: ${hlThemeId}`
|
|
1087
1221
|
)
|
|
1088
1222
|
]);
|
|
1223
|
+
const modifiedCss = createCssModifier(DEFAULT_CSS_UPDATES)(resolvedThemeCss);
|
|
1089
1224
|
return this.applyStylesWithResolvedCss(wenyanElement, {
|
|
1090
|
-
themeCss:
|
|
1225
|
+
themeCss: modifiedCss,
|
|
1091
1226
|
hlThemeCss: resolvedHlThemeCss,
|
|
1092
1227
|
isMacStyle,
|
|
1093
1228
|
isAddFootnote
|
|
@@ -1120,33 +1255,60 @@ async function createWenyanCore(options = {}) {
|
|
|
1120
1255
|
}
|
|
1121
1256
|
};
|
|
1122
1257
|
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1258
|
+
const DEFAULT_CSS_UPDATES = {
|
|
1259
|
+
"#wenyan": [
|
|
1260
|
+
{
|
|
1261
|
+
property: "font-family",
|
|
1262
|
+
value: sansSerif,
|
|
1263
|
+
append: false
|
|
1264
|
+
}
|
|
1265
|
+
],
|
|
1266
|
+
"#wenyan pre": [
|
|
1267
|
+
{
|
|
1268
|
+
property: "font-size",
|
|
1269
|
+
value: "12px",
|
|
1270
|
+
append: false
|
|
1271
|
+
}
|
|
1272
|
+
],
|
|
1273
|
+
"#wenyan pre code": [
|
|
1274
|
+
{
|
|
1275
|
+
property: "font-family",
|
|
1276
|
+
value: monospace,
|
|
1277
|
+
append: false
|
|
1278
|
+
}
|
|
1279
|
+
],
|
|
1280
|
+
"#wenyan p code": [
|
|
1281
|
+
{
|
|
1282
|
+
property: "font-family",
|
|
1283
|
+
value: monospace,
|
|
1284
|
+
append: false
|
|
1285
|
+
}
|
|
1286
|
+
],
|
|
1287
|
+
"#wenyan li code": [
|
|
1288
|
+
{
|
|
1289
|
+
property: "font-family",
|
|
1290
|
+
value: monospace,
|
|
1291
|
+
append: false
|
|
1292
|
+
}
|
|
1293
|
+
]
|
|
1294
|
+
};
|
|
1137
1295
|
export {
|
|
1138
1296
|
createCssModifier,
|
|
1139
1297
|
createWenyanCore,
|
|
1140
1298
|
getAllGzhThemes,
|
|
1141
1299
|
getAllHlThemes,
|
|
1142
1300
|
getAllThemes,
|
|
1301
|
+
getContentForMedium,
|
|
1302
|
+
getContentForToutiao,
|
|
1303
|
+
getContentForZhihu,
|
|
1143
1304
|
getHlTheme,
|
|
1305
|
+
getMacStyleCss,
|
|
1144
1306
|
getTheme,
|
|
1145
|
-
macStyleCss,
|
|
1146
1307
|
monospace,
|
|
1147
1308
|
registerAllBuiltInThemes,
|
|
1148
1309
|
registerBuiltInHlThemes,
|
|
1149
1310
|
registerHlTheme,
|
|
1311
|
+
registerMacStyle,
|
|
1150
1312
|
registerTheme,
|
|
1151
1313
|
sansSerif,
|
|
1152
1314
|
serif
|
|
@@ -22,8 +22,11 @@ export declare function createWenyanCore(options?: WenyanOptions): Promise<{
|
|
|
22
22
|
isAddFootnote: boolean;
|
|
23
23
|
}): Promise<string>;
|
|
24
24
|
}>;
|
|
25
|
-
export * from "./themeRegistry.js";
|
|
26
|
-
export * from "./hlThemeRegistry.js";
|
|
25
|
+
export * from "./theme/themeRegistry.js";
|
|
26
|
+
export * from "./theme/hlThemeRegistry.js";
|
|
27
27
|
export { serif, sansSerif, monospace } from "./utils.js";
|
|
28
28
|
export { createCssModifier } from "./parser/cssParser.js";
|
|
29
|
-
export {
|
|
29
|
+
export { getMacStyleCss, registerMacStyle } from "./theme/macStyleRegistry.js";
|
|
30
|
+
export * from "./platform/medium.js";
|
|
31
|
+
export * from "./platform/zhihu.js";
|
|
32
|
+
export * from "./platform/toutiao.js";
|
|
@@ -4,7 +4,7 @@ type CssUpdate = {
|
|
|
4
4
|
value?: string;
|
|
5
5
|
append?: boolean;
|
|
6
6
|
};
|
|
7
|
-
type CssUpdateMap = Record<string, CssUpdate[]>;
|
|
7
|
+
export type CssUpdateMap = Record<string, CssUpdate[]>;
|
|
8
8
|
export declare const parseOptions: csstree.ParseOptions;
|
|
9
9
|
export declare function createCssModifier(updates: CssUpdateMap): (customCss: string) => string;
|
|
10
10
|
export declare function createCssApplier(css: string): (element: HTMLElement) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getContentForZhihu(wenyanElement: HTMLElement): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MacStyle {
|
|
2
|
+
getCss(): string;
|
|
3
|
+
}
|
|
4
|
+
export declare function registerMacStyle(macStyle: MacStyle): void;
|
|
5
|
+
export declare function getMacStyle(): MacStyle | undefined;
|
|
6
|
+
export declare function registerBuiltInMacStyle(): void;
|
|
7
|
+
export declare function getMacStyleCss(): string;
|
|
@@ -4,3 +4,21 @@ export declare const monospace = "Menlo, Monaco, Consolas, 'Liberation Mono', 'R
|
|
|
4
4
|
export declare function normalizeCssLoader(loaderOrContent: any): () => Promise<string>;
|
|
5
5
|
export declare function stringToMap(str: string): Map<string, string>;
|
|
6
6
|
export declare function replaceCSSVariables(css: string): string;
|
|
7
|
+
export declare function resolveCssContent<T extends {
|
|
8
|
+
getCss: () => Promise<string>;
|
|
9
|
+
}>(directCss: string | undefined, // 直接传入的 CSS
|
|
10
|
+
id: string, // ID
|
|
11
|
+
finder: (id: string) => T | undefined, // 精确查找函数 (getTheme)
|
|
12
|
+
fallbackFinder: (id: string) => T | undefined, // 模糊查找函数 (find in array)
|
|
13
|
+
errorMessage: string): Promise<string>;
|
|
14
|
+
export type CssSource = {
|
|
15
|
+
type: "inline";
|
|
16
|
+
css: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: "asset";
|
|
19
|
+
loader: () => Promise<string>;
|
|
20
|
+
} | {
|
|
21
|
+
type: "url";
|
|
22
|
+
url: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function loadCssBySource(source: CssSource): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenyan-md/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Core library for Wenyan markdown rendering & publishing",
|
|
5
5
|
"author": "Lei <caol64@gmail.com> (https://github.com/caol64)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"scripts": {
|
|
77
77
|
"dev": "vite build --watch",
|
|
78
78
|
"check": "tsc --noEmit",
|
|
79
|
-
"build": "vite build && tsc",
|
|
79
|
+
"build": "pnpm check && vite build && tsc",
|
|
80
80
|
"build:browser": "vite build --config vite.config.browser.ts",
|
|
81
81
|
"build:styles": "vite build --config vite.config.styles.ts",
|
|
82
82
|
"build:math": "vite build --config vite.config.math.ts",
|
|
83
83
|
"build:all": "pnpm build && pnpm build:styles && pnpm build:math && pnpm build:browser",
|
|
84
84
|
"test": "pnpm build && vitest",
|
|
85
|
-
"test:wrapper": "
|
|
85
|
+
"test:wrapper": "vitest run test/wrapper.test.ts",
|
|
86
86
|
"test:publish": "vitest run test/publish.test.ts",
|
|
87
87
|
"test:realPublish": "vitest run test/realPublish.test.ts",
|
|
88
88
|
"test:runtimeEnv": "vitest run test/runtimeEnv.test.ts"
|
|
File without changes
|
|
File without changes
|