@wenyan-md/core 1.0.13 → 1.0.14
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/atom-one-dark.min-Du_gemwz.js +4 -0
- package/dist/atom-one-light.min-BameqVOr.js +4 -0
- package/dist/browser/wenyan-core.js +51 -51
- package/dist/core.js +430 -278
- package/dist/default-CE6XHgHa.js +4 -0
- package/dist/dracula.min-DhYK88zj.js +4 -0
- package/dist/github-dark.min-rUG1U3df.js +4 -0
- package/dist/github.min-DEfTaph9.js +4 -0
- package/dist/hltheme.js +29 -22
- package/dist/juejin_default-B6AI_viJ.js +4 -0
- package/dist/lapis-BpjqywsV.js +4 -0
- package/dist/maize-BqG2l24H.js +4 -0
- package/dist/math/wenyan-math.js +9 -40
- package/dist/medium_default-DtspuXEE.js +4 -0
- package/dist/monokai.min-BszscX_9.js +4 -0
- package/dist/orangeheart-CWqZ_gXQ.js +4 -0
- package/dist/{phycat-CATVZm-R.js → phycat-BNJAZy4V.js} +2 -2
- package/dist/pie-CVpIzs7v.js +4 -0
- package/dist/publish.js +137 -346
- package/dist/purple-ObLhqJQS.js +4 -0
- package/dist/rainbow-C5PT3WBL.js +4 -0
- package/dist/solarized-dark.min-mpQq1Jcj.js +4 -0
- package/dist/solarized-light.min-C5Ersr9g.js +4 -0
- package/dist/theme.js +40 -33
- package/dist/toutiao_default-BQ7BN6_-.js +4 -0
- package/dist/types/core.d.ts +17 -0
- package/dist/wrapper.js +15 -10
- package/dist/xcode.min-DWdHLdoo.js +4 -0
- package/dist/zhihu_default-DUBy_Cqy.js +4 -0
- package/package.json +4 -2
- package/dist/atom-one-dark.min-hABhDLRj.js +0 -4
- package/dist/atom-one-light.min-CwiVhPEv.js +0 -4
- package/dist/default-D-dyLptq.js +0 -184
- package/dist/dracula.min-OeyC4Nkp.js +0 -11
- package/dist/github-dark.min-DOlD5Ewr.js +0 -13
- package/dist/github.min-BZ2GvPsn.js +0 -14
- package/dist/juejin_default-13x4lhT9.js +0 -134
- package/dist/lapis-BUlsdDG6.js +0 -194
- package/dist/maize-DFW0x6O3.js +0 -194
- package/dist/medium_default-Zyy9RBMn.js +0 -135
- package/dist/monokai.min-CH2iHqHz.js +0 -4
- package/dist/orangeheart-Da7uQj8U.js +0 -184
- package/dist/pie-Q9UMu3CB.js +0 -240
- package/dist/purple-Da1-Vfos.js +0 -183
- package/dist/rainbow-Bv0kNhYA.js +0 -168
- package/dist/solarized-dark.min-BxbYljx4.js +0 -11
- package/dist/solarized-light.min-Bb25xgOC.js +0 -11
- package/dist/toutiao_default-CLGOaI2x.js +0 -145
- package/dist/xcode.min-CG-lWQgl.js +0 -4
- package/dist/zhihu_default-Cz8bIkGO.js +0 -133
package/dist/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const themeMeta = [
|
|
2
2
|
{
|
|
3
3
|
id: "default",
|
|
4
4
|
name: "Default",
|
|
@@ -55,53 +55,60 @@ const i = [
|
|
|
55
55
|
appName: "物理猫-薄荷",
|
|
56
56
|
author: "sumruler"
|
|
57
57
|
}
|
|
58
|
-
]
|
|
59
|
-
|
|
60
|
-
"./themes/
|
|
61
|
-
"./themes/
|
|
62
|
-
"./themes/
|
|
63
|
-
"./themes/
|
|
64
|
-
"./themes/
|
|
65
|
-
"./themes/
|
|
66
|
-
"./themes/
|
|
67
|
-
"./themes/
|
|
68
|
-
"./themes/
|
|
69
|
-
"./themes/
|
|
70
|
-
"./themes/
|
|
58
|
+
];
|
|
59
|
+
const themeCssModules = /* @__PURE__ */ Object.assign({
|
|
60
|
+
"./themes/default.css": () => import("./default-CE6XHgHa.js").then((m) => m["default"]),
|
|
61
|
+
"./themes/juejin_default.css": () => import("./juejin_default-B6AI_viJ.js").then((m) => m["default"]),
|
|
62
|
+
"./themes/lapis.css": () => import("./lapis-BpjqywsV.js").then((m) => m["default"]),
|
|
63
|
+
"./themes/maize.css": () => import("./maize-BqG2l24H.js").then((m) => m["default"]),
|
|
64
|
+
"./themes/medium_default.css": () => import("./medium_default-DtspuXEE.js").then((m) => m["default"]),
|
|
65
|
+
"./themes/orangeheart.css": () => import("./orangeheart-CWqZ_gXQ.js").then((m) => m["default"]),
|
|
66
|
+
"./themes/phycat.css": () => import("./phycat-BNJAZy4V.js").then((m) => m["default"]),
|
|
67
|
+
"./themes/pie.css": () => import("./pie-CVpIzs7v.js").then((m) => m["default"]),
|
|
68
|
+
"./themes/purple.css": () => import("./purple-ObLhqJQS.js").then((m) => m["default"]),
|
|
69
|
+
"./themes/rainbow.css": () => import("./rainbow-C5PT3WBL.js").then((m) => m["default"]),
|
|
70
|
+
"./themes/toutiao_default.css": () => import("./toutiao_default-BQ7BN6_-.js").then((m) => m["default"]),
|
|
71
|
+
"./themes/zhihu_default.css": () => import("./zhihu_default-DUBy_Cqy.js").then((m) => m["default"])
|
|
71
72
|
});
|
|
72
|
-
function
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
function createTheme(meta) {
|
|
74
|
+
const cssPath = `./themes/${meta.id}.css`;
|
|
75
|
+
const cssModuleLoader = themeCssModules[cssPath];
|
|
76
|
+
if (!cssModuleLoader) {
|
|
77
|
+
console.warn(`[Themes] CSS file not found for theme: ${meta.id}`);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
...meta,
|
|
82
|
+
getCss: cssModuleLoader
|
|
83
|
+
};
|
|
78
84
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
85
|
+
const themes = Object.fromEntries(
|
|
86
|
+
themeMeta.map((meta) => createTheme(meta)).filter((t) => t !== null).map((t) => [t.id, t])
|
|
81
87
|
);
|
|
82
|
-
function
|
|
83
|
-
return Object.values(
|
|
88
|
+
function getAllThemes() {
|
|
89
|
+
return Object.values(themes);
|
|
84
90
|
}
|
|
85
|
-
const
|
|
91
|
+
const otherThemeIds = [
|
|
86
92
|
"juejin_default",
|
|
87
93
|
"medium_default",
|
|
88
94
|
"toutiao_default",
|
|
89
95
|
"zhihu_default"
|
|
90
|
-
]
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
];
|
|
97
|
+
const otherThemes = Object.fromEntries(
|
|
98
|
+
otherThemeIds.map((id) => [
|
|
99
|
+
id,
|
|
93
100
|
{
|
|
94
|
-
id
|
|
101
|
+
id,
|
|
95
102
|
name: "",
|
|
96
103
|
description: "",
|
|
97
104
|
appName: "",
|
|
98
105
|
author: "",
|
|
99
|
-
getCss:
|
|
106
|
+
getCss: themeCssModules[`./themes/${id}.css`]
|
|
100
107
|
}
|
|
101
108
|
])
|
|
102
109
|
);
|
|
103
110
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
getAllThemes,
|
|
112
|
+
otherThemes,
|
|
113
|
+
themes
|
|
107
114
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const toutiao_default = '#wenyan {\n font-family: var(--sans-serif-font);\n line-height: 1.75;\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#wenyan pre {\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 font-family: var(--monospace-font);\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}\n#wenyan pre code {\n font-family: var(--monospace-font);\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';
|
|
2
|
+
export {
|
|
3
|
+
toutiao_default as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FrontMatterResult {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
cover?: string;
|
|
5
|
+
body: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function handleFrontMatter(markdown: string): Promise<FrontMatterResult>;
|
|
9
|
+
export function configureMarked(): Promise<void>;
|
|
10
|
+
export function renderMarkdown(content: string): Promise<string>;
|
|
11
|
+
export function getContentForGzhBuiltinTheme(
|
|
12
|
+
wenyanElement: HTMLElement,
|
|
13
|
+
themeId: string,
|
|
14
|
+
hlThemeId: string,
|
|
15
|
+
isMacStyle?: boolean,
|
|
16
|
+
isAddFootnote?: boolean
|
|
17
|
+
): Promise<string>;
|
package/dist/wrapper.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { JSDOM
|
|
2
|
-
import { configureMarked
|
|
3
|
-
async function
|
|
4
|
-
await
|
|
5
|
-
const
|
|
1
|
+
import { JSDOM } from "jsdom";
|
|
2
|
+
import { configureMarked, handleFrontMatter, renderMarkdown, getContentForGzhBuiltinTheme } from "./core.js";
|
|
3
|
+
async function getGzhContent(content, themeId, hlThemeId, isMacStyle = true, isAddFootnote = true) {
|
|
4
|
+
await configureMarked();
|
|
5
|
+
const preHandlerContent = await handleFrontMatter(content);
|
|
6
|
+
const html = await renderMarkdown(preHandlerContent.body);
|
|
7
|
+
const dom = new JSDOM(`<body><section id="wenyan">${html}</section></body>`);
|
|
8
|
+
const document = dom.window.document;
|
|
9
|
+
const wenyan = document.getElementById("wenyan");
|
|
10
|
+
const result = await getContentForGzhBuiltinTheme(wenyan, themeId, hlThemeId, isMacStyle, isAddFootnote);
|
|
6
11
|
return {
|
|
7
|
-
title:
|
|
8
|
-
cover:
|
|
9
|
-
content:
|
|
10
|
-
description:
|
|
12
|
+
title: preHandlerContent.title,
|
|
13
|
+
cover: preHandlerContent.cover,
|
|
14
|
+
content: result,
|
|
15
|
+
description: preHandlerContent.description
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
export {
|
|
14
|
-
|
|
19
|
+
getGzhContent
|
|
15
20
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const xcode_min = "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}";
|
|
2
|
+
export {
|
|
3
|
+
xcode_min as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const zhihu_default = "#wenyan {\n font-family: var(--sans-serif-font);\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#wenyan pre {\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 font-family: var(--monospace-font);\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}\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";
|
|
2
|
+
export {
|
|
3
|
+
zhihu_default as default
|
|
4
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenyan-md/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
30
|
"import": "./dist/core.js",
|
|
31
|
+
"types": "./dist/types/core.d.ts",
|
|
31
32
|
"browser": "./dist/browser/wenyan-core.js"
|
|
32
33
|
},
|
|
33
34
|
"./publish": {
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
|
59
60
|
"css-tree": "3.0.1",
|
|
61
|
+
"form-data-encoder": "^4.1.0",
|
|
60
62
|
"formdata-node": "^6.0.3",
|
|
61
63
|
"front-matter": "^4.0.2",
|
|
62
64
|
"highlight.js": "11.10.0",
|
|
@@ -67,7 +69,7 @@
|
|
|
67
69
|
},
|
|
68
70
|
"scripts": {
|
|
69
71
|
"dev": "vite build --watch",
|
|
70
|
-
"build": "vite build && tsc",
|
|
72
|
+
"build": "vite build && tsc && node -e \"const fs = require('fs'); fs.copyFileSync('src/main.d.ts', 'dist/types/core.d.ts');\"",
|
|
71
73
|
"build:browser": "vite build --config vite.config.browser.ts",
|
|
72
74
|
"build:styles": "vite build --config vite.config.styles.ts",
|
|
73
75
|
"build:math": "vite build --config vite.config.math.ts",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const l = "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}";
|
|
2
|
-
export {
|
|
3
|
-
l as default
|
|
4
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const l = "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}";
|
|
2
|
-
export {
|
|
3
|
-
l as default
|
|
4
|
-
};
|
package/dist/default-D-dyLptq.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
const n = `/**
|
|
2
|
-
* 欢迎使用自定义主题功能,使用教程:
|
|
3
|
-
* https://babyno.top/posts/2024/11/wenyan-supports-customized-themes/
|
|
4
|
-
*/
|
|
5
|
-
/* 全局属性 */
|
|
6
|
-
#wenyan {
|
|
7
|
-
font-family: var(--sans-serif-font);
|
|
8
|
-
line-height: 1.75;
|
|
9
|
-
font-size: 16px;
|
|
10
|
-
}
|
|
11
|
-
/* 全局子元素属性 */
|
|
12
|
-
/* 支持分组 */
|
|
13
|
-
#wenyan h1,
|
|
14
|
-
#wenyan h2,
|
|
15
|
-
#wenyan h3,
|
|
16
|
-
#wenyan h4,
|
|
17
|
-
#wenyan h5,
|
|
18
|
-
#wenyan h6,
|
|
19
|
-
#wenyan p,
|
|
20
|
-
#wenyan pre {
|
|
21
|
-
margin: 1em 0;
|
|
22
|
-
}
|
|
23
|
-
/* 段落 */
|
|
24
|
-
#wenyan p {
|
|
25
|
-
}
|
|
26
|
-
/* 加粗 */
|
|
27
|
-
#wenyan p strong {
|
|
28
|
-
}
|
|
29
|
-
/* 斜体 */
|
|
30
|
-
#wenyan p em {
|
|
31
|
-
}
|
|
32
|
-
/* 一级标题 */
|
|
33
|
-
#wenyan h1 {
|
|
34
|
-
text-align: center;
|
|
35
|
-
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
|
|
36
|
-
font-size: 1.5em;
|
|
37
|
-
}
|
|
38
|
-
/* 标题文字 */
|
|
39
|
-
#wenyan h1 span {
|
|
40
|
-
}
|
|
41
|
-
/* 标题前缀,h1-h6都支持前缀 */
|
|
42
|
-
#wenyan h1::before {
|
|
43
|
-
}
|
|
44
|
-
/* 标题后缀,h1-h6都支持后缀 */
|
|
45
|
-
#wenyan h1::after {
|
|
46
|
-
}
|
|
47
|
-
/* 二级标题 */
|
|
48
|
-
#wenyan h2 {
|
|
49
|
-
text-align: center;
|
|
50
|
-
font-size: 1.2em;
|
|
51
|
-
border-bottom: 1px solid #f7f7f7;
|
|
52
|
-
font-weight: bold;
|
|
53
|
-
}
|
|
54
|
-
/* 三-六级标题 */
|
|
55
|
-
#wenyan h3,
|
|
56
|
-
#wenyan h4,
|
|
57
|
-
#wenyan h5,
|
|
58
|
-
#wenyan h6 {
|
|
59
|
-
font-size: 1em;
|
|
60
|
-
font-weight: bold;
|
|
61
|
-
}
|
|
62
|
-
/* 列表 */
|
|
63
|
-
#wenyan ul,
|
|
64
|
-
#wenyan ol {
|
|
65
|
-
padding-left: 1.2em;
|
|
66
|
-
}
|
|
67
|
-
/* 列表元素 */
|
|
68
|
-
#wenyan li {
|
|
69
|
-
margin-left: 1.2em;
|
|
70
|
-
}
|
|
71
|
-
/* 图片 */
|
|
72
|
-
#wenyan img {
|
|
73
|
-
max-width: 100%;
|
|
74
|
-
height: auto;
|
|
75
|
-
margin: 0 auto;
|
|
76
|
-
display: block;
|
|
77
|
-
}
|
|
78
|
-
/* 表格 */
|
|
79
|
-
#wenyan table {
|
|
80
|
-
border-collapse: collapse;
|
|
81
|
-
margin: 1.4em auto;
|
|
82
|
-
max-width: 100%;
|
|
83
|
-
table-layout: fixed;
|
|
84
|
-
text-align: left;
|
|
85
|
-
overflow: auto;
|
|
86
|
-
display: table;
|
|
87
|
-
word-wrap: break-word;
|
|
88
|
-
word-break: break-all;
|
|
89
|
-
}
|
|
90
|
-
/* 表格单元格 */
|
|
91
|
-
#wenyan table td,
|
|
92
|
-
#wenyan table th {
|
|
93
|
-
font-size: 0.75em;
|
|
94
|
-
padding: 9px 12px;
|
|
95
|
-
line-height: 22px;
|
|
96
|
-
color: #222;
|
|
97
|
-
border: 1px solid #d8d8d8;
|
|
98
|
-
vertical-align: top;
|
|
99
|
-
}
|
|
100
|
-
/* 表格表头 */
|
|
101
|
-
#wenyan table th {
|
|
102
|
-
font-weight: bold;
|
|
103
|
-
background-color: #f0f0f0;
|
|
104
|
-
}
|
|
105
|
-
/* 表格斑马条纹效果 */
|
|
106
|
-
#wenyan table tr:nth-child(2n) {
|
|
107
|
-
background-color: #f8f8f8;
|
|
108
|
-
}
|
|
109
|
-
/* 引用块 */
|
|
110
|
-
#wenyan blockquote {
|
|
111
|
-
background: #afb8c133;
|
|
112
|
-
border-left: 0.5em solid #ccc;
|
|
113
|
-
margin: 1.5em 0;
|
|
114
|
-
padding: 0.5em 10px;
|
|
115
|
-
font-style: italic;
|
|
116
|
-
font-size: 0.9em;
|
|
117
|
-
}
|
|
118
|
-
/* 引用块前缀 */
|
|
119
|
-
#wenyan blockquote::before {
|
|
120
|
-
}
|
|
121
|
-
/* 引用块后缀 */
|
|
122
|
-
#wenyan blockquote::after {
|
|
123
|
-
}
|
|
124
|
-
/* 行内代码 */
|
|
125
|
-
#wenyan p code {
|
|
126
|
-
font-family: var(--monospace-font);
|
|
127
|
-
color: #ff502c;
|
|
128
|
-
padding: 4px 6px;
|
|
129
|
-
font-size: 0.78em;
|
|
130
|
-
}
|
|
131
|
-
/* 代码块外围 */
|
|
132
|
-
#wenyan pre {
|
|
133
|
-
border-radius: 5px;
|
|
134
|
-
line-height: 2;
|
|
135
|
-
margin: 1em 0.5em;
|
|
136
|
-
padding: .5em;
|
|
137
|
-
box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;
|
|
138
|
-
}
|
|
139
|
-
/* 代码块 */
|
|
140
|
-
#wenyan pre code {
|
|
141
|
-
font-family: var(--monospace-font);
|
|
142
|
-
display: block;
|
|
143
|
-
overflow-x: auto;
|
|
144
|
-
margin: .5em;
|
|
145
|
-
padding: 0;
|
|
146
|
-
}
|
|
147
|
-
/* 分割线 */
|
|
148
|
-
#wenyan hr {
|
|
149
|
-
border: none;
|
|
150
|
-
border-top: 1px solid #ddd;
|
|
151
|
-
margin-top: 2em;
|
|
152
|
-
margin-bottom: 2em;
|
|
153
|
-
}
|
|
154
|
-
/* 链接 */
|
|
155
|
-
#wenyan a {
|
|
156
|
-
word-wrap: break-word;
|
|
157
|
-
color: #0069c2;
|
|
158
|
-
}
|
|
159
|
-
/* 原始链接旁脚注上标 */
|
|
160
|
-
#wenyan .footnote {
|
|
161
|
-
color: #0069c2;
|
|
162
|
-
}
|
|
163
|
-
/* 脚注行 */
|
|
164
|
-
#wenyan #footnotes p {
|
|
165
|
-
display: flex;
|
|
166
|
-
margin: 0;
|
|
167
|
-
font-size: 0.9em;
|
|
168
|
-
}
|
|
169
|
-
/* 脚注行内编号 */
|
|
170
|
-
#wenyan .footnote-num {
|
|
171
|
-
display: inline;
|
|
172
|
-
width: 10%;
|
|
173
|
-
}
|
|
174
|
-
/* 脚注行内文字 */
|
|
175
|
-
#wenyan .footnote-txt {
|
|
176
|
-
display: inline;
|
|
177
|
-
width: 90%;
|
|
178
|
-
word-wrap: break-word;
|
|
179
|
-
word-break: break-all;
|
|
180
|
-
}
|
|
181
|
-
`;
|
|
182
|
-
export {
|
|
183
|
-
n as default
|
|
184
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const l = `pre{background:#282936}
|
|
2
|
-
/*!
|
|
3
|
-
Theme: Dracula
|
|
4
|
-
Author: Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula)
|
|
5
|
-
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
6
|
-
Maintainer: @highlightjs/core-team
|
|
7
|
-
Version: 2021.09.0
|
|
8
|
-
*/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}`;
|
|
9
|
-
export {
|
|
10
|
-
l as default
|
|
11
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const l = `pre{background:#0d1117}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
|
-
Theme: GitHub Dark
|
|
3
|
-
Description: Dark theme as seen on github.com
|
|
4
|
-
Author: github.com
|
|
5
|
-
Maintainer: @Hirse
|
|
6
|
-
Updated: 2021-05-15
|
|
7
|
-
|
|
8
|
-
Outdated base version: https://github.com/primer/github-syntax-dark
|
|
9
|
-
Current colors taken from GitHub's CSS
|
|
10
|
-
*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}`;
|
|
11
|
-
export {
|
|
12
|
-
l as default
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const l = `pre{background:#fff}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
|
-
Theme: GitHub
|
|
3
|
-
Description: Light theme as seen on github.com
|
|
4
|
-
Author: github.com
|
|
5
|
-
Maintainer: @Hirse
|
|
6
|
-
Updated: 2021-05-15
|
|
7
|
-
|
|
8
|
-
Outdated base version: https://github.com/primer/github-syntax-light
|
|
9
|
-
Current colors taken from GitHub's CSS
|
|
10
|
-
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}
|
|
11
|
-
`;
|
|
12
|
-
export {
|
|
13
|
-
l as default
|
|
14
|
-
};
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
const n = `#wenyan {
|
|
2
|
-
font-family: var(--sans-serif-font);
|
|
3
|
-
line-height: 1.75;
|
|
4
|
-
}
|
|
5
|
-
#wenyan * {
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
}
|
|
8
|
-
#wenyan h1,
|
|
9
|
-
#wenyan h2,
|
|
10
|
-
#wenyan h3,
|
|
11
|
-
#wenyan h4,
|
|
12
|
-
#wenyan h5,
|
|
13
|
-
#wenyan h6,
|
|
14
|
-
#wenyan p,
|
|
15
|
-
#wenyan pre {
|
|
16
|
-
margin: 1em 0;
|
|
17
|
-
}
|
|
18
|
-
#wenyan h1,
|
|
19
|
-
#wenyan h2,
|
|
20
|
-
#wenyan h3,
|
|
21
|
-
#wenyan h4,
|
|
22
|
-
#wenyan h5,
|
|
23
|
-
#wenyan h6 {
|
|
24
|
-
line-height: 1.5;
|
|
25
|
-
margin-top: 35px;
|
|
26
|
-
margin-bottom: 10px;
|
|
27
|
-
padding-bottom: 5px;
|
|
28
|
-
}
|
|
29
|
-
#wenyan h1 {
|
|
30
|
-
font-size: 24px;
|
|
31
|
-
line-height: 38px;
|
|
32
|
-
margin-bottom: 5px;
|
|
33
|
-
}
|
|
34
|
-
#wenyan h2 {
|
|
35
|
-
font-size: 22px;
|
|
36
|
-
line-height: 34px;
|
|
37
|
-
padding-bottom: 12px;
|
|
38
|
-
border-bottom: 1px solid #ececec;
|
|
39
|
-
}
|
|
40
|
-
#wenyan h3 {
|
|
41
|
-
font-size: 20px;
|
|
42
|
-
line-height: 28px;
|
|
43
|
-
}
|
|
44
|
-
#wenyan ul,
|
|
45
|
-
#wenyan ol {
|
|
46
|
-
padding-left: 1.2em;
|
|
47
|
-
}
|
|
48
|
-
#wenyan li {
|
|
49
|
-
margin-left: 1.2em;
|
|
50
|
-
}
|
|
51
|
-
#wenyan img {
|
|
52
|
-
max-width: 100%;
|
|
53
|
-
height: auto;
|
|
54
|
-
margin: 0 auto;
|
|
55
|
-
display: block;
|
|
56
|
-
}
|
|
57
|
-
#wenyan table {
|
|
58
|
-
display: inline-block !important;
|
|
59
|
-
font-size: 12px;
|
|
60
|
-
width: auto;
|
|
61
|
-
max-width: 100%;
|
|
62
|
-
overflow: auto;
|
|
63
|
-
border: 1px solid #f6f6f6;
|
|
64
|
-
}
|
|
65
|
-
#wenyan thead {
|
|
66
|
-
background: #f6f6f6;
|
|
67
|
-
color: #000;
|
|
68
|
-
text-align: left;
|
|
69
|
-
}
|
|
70
|
-
#wenyan table td,
|
|
71
|
-
#wenyan table th {
|
|
72
|
-
padding: 12px 7px;
|
|
73
|
-
line-height: 24px;
|
|
74
|
-
}
|
|
75
|
-
#wenyan blockquote {
|
|
76
|
-
color: #666;
|
|
77
|
-
padding: 1px 23px;
|
|
78
|
-
margin: 22px 0;
|
|
79
|
-
border-left: 4px solid #cbcbcb;
|
|
80
|
-
background-color: #f8f8f8;
|
|
81
|
-
font-size: 0.95em;
|
|
82
|
-
}
|
|
83
|
-
#wenyan p code {
|
|
84
|
-
font-family: var(--monospace-font);
|
|
85
|
-
background: #fff5f5;
|
|
86
|
-
color: #ff502c;
|
|
87
|
-
padding: 4px 6px;
|
|
88
|
-
font-size: 0.78em;
|
|
89
|
-
}
|
|
90
|
-
#wenyan pre {
|
|
91
|
-
line-height: 2;
|
|
92
|
-
margin: 1em 0.5em;
|
|
93
|
-
padding: .5em;
|
|
94
|
-
color: #333;
|
|
95
|
-
background: #f8f8f8;
|
|
96
|
-
}
|
|
97
|
-
#wenyan pre code {
|
|
98
|
-
font-family: var(--monospace-font);
|
|
99
|
-
display: block;
|
|
100
|
-
overflow-x: auto;
|
|
101
|
-
margin: .5em;
|
|
102
|
-
padding: 0;
|
|
103
|
-
background: #f8f8f8;
|
|
104
|
-
}
|
|
105
|
-
#wenyan hr {
|
|
106
|
-
border: none;
|
|
107
|
-
border-top: 1px solid #ddd;
|
|
108
|
-
margin-top: 32px;
|
|
109
|
-
margin-bottom: 32px;
|
|
110
|
-
}
|
|
111
|
-
/* 链接 */
|
|
112
|
-
#wenyan a {
|
|
113
|
-
word-wrap: break-word;
|
|
114
|
-
color: #0069c2;
|
|
115
|
-
}
|
|
116
|
-
/* 脚注 */
|
|
117
|
-
#wenyan #footnotes ul {
|
|
118
|
-
font-size: 0.9em;
|
|
119
|
-
margin: 0;
|
|
120
|
-
padding-left: 1.2em;
|
|
121
|
-
}
|
|
122
|
-
#wenyan #footnotes li {
|
|
123
|
-
margin: 0 0 0 1.2em;
|
|
124
|
-
overflow-wrap: break-word;
|
|
125
|
-
word-wrap: break-word;
|
|
126
|
-
word-break: break-all;
|
|
127
|
-
}
|
|
128
|
-
#wenyan .footnote {
|
|
129
|
-
color: #0069c2;
|
|
130
|
-
}
|
|
131
|
-
`;
|
|
132
|
-
export {
|
|
133
|
-
n as default
|
|
134
|
-
};
|