@wenyan-md/core 1.0.4 → 1.0.6
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/browser/wenyan-core.js +2406 -0
- package/dist/core.js +203 -202
- package/dist/juejin_default-CnUAGV72.js +139 -0
- package/dist/medium_default-BXHGUKdY.js +135 -0
- package/dist/theme.js +61 -19
- package/dist/toutiao_default-DthFV93V.js +151 -0
- package/dist/types/theme.d.ts +3 -0
- package/dist/wrapper.js +4 -4
- package/dist/zhihu_default-7uVAZjKn.js +138 -0
- package/package.json +26 -11
- package/dist/types/index.d.ts +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const n = `:root {
|
|
2
|
+
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
3
|
+
"Noto Color Emoji";
|
|
4
|
+
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
5
|
+
}
|
|
6
|
+
#wenyan {
|
|
7
|
+
font-family: var(--sans-serif-font);
|
|
8
|
+
line-height: 1.75;
|
|
9
|
+
}
|
|
10
|
+
#wenyan * {
|
|
11
|
+
box-sizing: border-box;
|
|
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
|
+
#wenyan h1,
|
|
24
|
+
#wenyan h2,
|
|
25
|
+
#wenyan h3,
|
|
26
|
+
#wenyan h4,
|
|
27
|
+
#wenyan h5,
|
|
28
|
+
#wenyan h6 {
|
|
29
|
+
line-height: 1.5;
|
|
30
|
+
margin-top: 35px;
|
|
31
|
+
margin-bottom: 10px;
|
|
32
|
+
padding-bottom: 5px;
|
|
33
|
+
}
|
|
34
|
+
#wenyan h1 {
|
|
35
|
+
font-size: 24px;
|
|
36
|
+
line-height: 38px;
|
|
37
|
+
margin-bottom: 5px;
|
|
38
|
+
}
|
|
39
|
+
#wenyan h2 {
|
|
40
|
+
font-size: 22px;
|
|
41
|
+
line-height: 34px;
|
|
42
|
+
padding-bottom: 12px;
|
|
43
|
+
border-bottom: 1px solid #ececec;
|
|
44
|
+
}
|
|
45
|
+
#wenyan h3 {
|
|
46
|
+
font-size: 20px;
|
|
47
|
+
line-height: 28px;
|
|
48
|
+
}
|
|
49
|
+
#wenyan ul,
|
|
50
|
+
#wenyan ol {
|
|
51
|
+
padding-left: 1.2em;
|
|
52
|
+
}
|
|
53
|
+
#wenyan li {
|
|
54
|
+
margin-left: 1.2em;
|
|
55
|
+
}
|
|
56
|
+
#wenyan img {
|
|
57
|
+
max-width: 100%;
|
|
58
|
+
height: auto;
|
|
59
|
+
margin: 0 auto;
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
#wenyan table {
|
|
63
|
+
display: inline-block !important;
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
width: auto;
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
overflow: auto;
|
|
68
|
+
border: 1px solid #f6f6f6;
|
|
69
|
+
}
|
|
70
|
+
#wenyan thead {
|
|
71
|
+
background: #f6f6f6;
|
|
72
|
+
color: #000;
|
|
73
|
+
text-align: left;
|
|
74
|
+
}
|
|
75
|
+
#wenyan table td,
|
|
76
|
+
#wenyan table th {
|
|
77
|
+
padding: 12px 7px;
|
|
78
|
+
line-height: 24px;
|
|
79
|
+
}
|
|
80
|
+
#wenyan blockquote {
|
|
81
|
+
color: #666;
|
|
82
|
+
padding: 1px 23px;
|
|
83
|
+
margin: 22px 0;
|
|
84
|
+
border-left: 4px solid #cbcbcb;
|
|
85
|
+
background-color: #f8f8f8;
|
|
86
|
+
font-size: 0.95em;
|
|
87
|
+
}
|
|
88
|
+
#wenyan p code {
|
|
89
|
+
font-family: var(--monospace-font);
|
|
90
|
+
background: #fff5f5;
|
|
91
|
+
color: #ff502c;
|
|
92
|
+
padding: 4px 6px;
|
|
93
|
+
font-size: 0.78em;
|
|
94
|
+
}
|
|
95
|
+
#wenyan pre {
|
|
96
|
+
line-height: 2;
|
|
97
|
+
margin: 1em 0.5em;
|
|
98
|
+
padding: .5em;
|
|
99
|
+
color: #333;
|
|
100
|
+
background: #f8f8f8;
|
|
101
|
+
}
|
|
102
|
+
#wenyan pre code {
|
|
103
|
+
font-family: var(--monospace-font);
|
|
104
|
+
display: block;
|
|
105
|
+
overflow-x: auto;
|
|
106
|
+
margin: .5em;
|
|
107
|
+
padding: 0;
|
|
108
|
+
background: #f8f8f8;
|
|
109
|
+
}
|
|
110
|
+
#wenyan hr {
|
|
111
|
+
border: none;
|
|
112
|
+
border-top: 1px solid #ddd;
|
|
113
|
+
margin-top: 32px;
|
|
114
|
+
margin-bottom: 32px;
|
|
115
|
+
}
|
|
116
|
+
/* 链接 */
|
|
117
|
+
#wenyan a {
|
|
118
|
+
word-wrap: break-word;
|
|
119
|
+
color: #0069c2;
|
|
120
|
+
}
|
|
121
|
+
/* 脚注 */
|
|
122
|
+
#wenyan #footnotes ul {
|
|
123
|
+
font-size: 0.9em;
|
|
124
|
+
margin: 0;
|
|
125
|
+
padding-left: 1.2em;
|
|
126
|
+
}
|
|
127
|
+
#wenyan #footnotes li {
|
|
128
|
+
margin: 0 0 0 1.2em;
|
|
129
|
+
overflow-wrap: break-word;
|
|
130
|
+
word-wrap: break-word;
|
|
131
|
+
word-break: break-all;
|
|
132
|
+
}
|
|
133
|
+
#wenyan .footnote {
|
|
134
|
+
color: #0069c2;
|
|
135
|
+
}
|
|
136
|
+
`;
|
|
137
|
+
export {
|
|
138
|
+
n as default
|
|
139
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
const n = `:root {
|
|
2
|
+
--sans-serif-font: source-serif-pro, Georgia, Cambria, "Times New Roman", Times, serif;
|
|
3
|
+
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
4
|
+
}
|
|
5
|
+
#wenyan {
|
|
6
|
+
font-family: var(--sans-serif-font);
|
|
7
|
+
line-height: 1.75;
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
}
|
|
10
|
+
#wenyan * {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
#wenyan h1,
|
|
14
|
+
#wenyan h2,
|
|
15
|
+
#wenyan h3,
|
|
16
|
+
#wenyan h4,
|
|
17
|
+
#wenyan h5,
|
|
18
|
+
#wenyan h6 {
|
|
19
|
+
font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
20
|
+
margin: 1em 0;
|
|
21
|
+
}
|
|
22
|
+
#wenyan h1 {
|
|
23
|
+
font-size: 2em;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
}
|
|
26
|
+
#wenyan h2,
|
|
27
|
+
#wenyan h3 {
|
|
28
|
+
font-size: 1.3em;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
}
|
|
31
|
+
#wenyan h4,
|
|
32
|
+
#wenyan h5,
|
|
33
|
+
#wenyan h6 {
|
|
34
|
+
font-size: 1.2em;
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
}
|
|
37
|
+
#wenyan p {
|
|
38
|
+
letter-spacing: -0.003em;
|
|
39
|
+
margin: 1em 0;
|
|
40
|
+
}
|
|
41
|
+
#wenyan ul,
|
|
42
|
+
#wenyan ol {
|
|
43
|
+
padding-left: 1.2em;
|
|
44
|
+
}
|
|
45
|
+
#wenyan li {
|
|
46
|
+
margin-left: 1.2em;
|
|
47
|
+
}
|
|
48
|
+
#wenyan img {
|
|
49
|
+
max-width: 100%;
|
|
50
|
+
height: auto;
|
|
51
|
+
margin: 0 auto;
|
|
52
|
+
display: block;
|
|
53
|
+
}
|
|
54
|
+
#wenyan table {
|
|
55
|
+
border-collapse: collapse;
|
|
56
|
+
font-size: 15px;
|
|
57
|
+
margin: 1.4em auto;
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
table-layout: fixed;
|
|
60
|
+
text-align: left;
|
|
61
|
+
width: 100%;
|
|
62
|
+
word-wrap: break-word;
|
|
63
|
+
word-break: break-all;
|
|
64
|
+
}
|
|
65
|
+
#wenyan table th {
|
|
66
|
+
background: #ebeced;
|
|
67
|
+
color: #191b1f;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
}
|
|
70
|
+
#wenyan table td,
|
|
71
|
+
#wenyan table th {
|
|
72
|
+
border: 1px solid #c4c7ce;
|
|
73
|
+
height: 24px;
|
|
74
|
+
line-height: 24px;
|
|
75
|
+
padding: 3px 12px;
|
|
76
|
+
}
|
|
77
|
+
#wenyan blockquote {
|
|
78
|
+
letter-spacing: -0.003em;
|
|
79
|
+
border-left: 3px solid rgba(0, 0, 0, 0.84);
|
|
80
|
+
padding-left: 20px;
|
|
81
|
+
margin: 0 0 20px 0;
|
|
82
|
+
}
|
|
83
|
+
#wenyan p code {
|
|
84
|
+
padding: 4px 6px;
|
|
85
|
+
font-size: 0.78em;
|
|
86
|
+
border-radius: 3px;
|
|
87
|
+
font-family: var(--monospace-font);
|
|
88
|
+
background-color: #f2f2f2;
|
|
89
|
+
}
|
|
90
|
+
#wenyan pre {
|
|
91
|
+
line-height: 2;
|
|
92
|
+
margin: 1em 0.5em;
|
|
93
|
+
padding: 1em;
|
|
94
|
+
background: #f9f9f9;
|
|
95
|
+
border-radius: 4px;
|
|
96
|
+
border: 1px solid #e5e5e5;
|
|
97
|
+
}
|
|
98
|
+
#wenyan pre code {
|
|
99
|
+
display: block;
|
|
100
|
+
overflow-x: auto;
|
|
101
|
+
margin: .5em;
|
|
102
|
+
padding: 0;
|
|
103
|
+
font-family: var(--monospace-font);
|
|
104
|
+
background: #f9f9f9;
|
|
105
|
+
}
|
|
106
|
+
#wenyan hr {
|
|
107
|
+
border: none;
|
|
108
|
+
border-top: 1px solid #c4c7ce;
|
|
109
|
+
margin: 2em auto;
|
|
110
|
+
max-width: 100%;
|
|
111
|
+
width: 240px;
|
|
112
|
+
}
|
|
113
|
+
/* 链接 */
|
|
114
|
+
#wenyan a {
|
|
115
|
+
word-wrap: break-word;
|
|
116
|
+
color: #000000;
|
|
117
|
+
}
|
|
118
|
+
/* 脚注 */
|
|
119
|
+
#wenyan #footnotes ul {
|
|
120
|
+
font-size: 0.9em;
|
|
121
|
+
margin: 0;
|
|
122
|
+
padding-left: 1.2em;
|
|
123
|
+
}
|
|
124
|
+
#wenyan #footnotes li {
|
|
125
|
+
margin: 0 0 0 1.2em;
|
|
126
|
+
word-wrap: break-word;
|
|
127
|
+
word-break: break-all;
|
|
128
|
+
}
|
|
129
|
+
#wenyan .footnote {
|
|
130
|
+
color: #000000;
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
export {
|
|
134
|
+
n as default
|
|
135
|
+
};
|
package/dist/theme.js
CHANGED
|
@@ -1,65 +1,107 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = [
|
|
2
2
|
{
|
|
3
3
|
id: "default",
|
|
4
4
|
name: "Default",
|
|
5
|
-
description: "A clean, classic layout ideal for long-form reading."
|
|
5
|
+
description: "A clean, classic layout ideal for long-form reading.",
|
|
6
|
+
appName: "默认",
|
|
7
|
+
author: ""
|
|
6
8
|
},
|
|
7
9
|
{
|
|
8
10
|
id: "orangeheart",
|
|
9
11
|
name: "OrangeHeart",
|
|
10
|
-
description: "A vibrant and elegant theme in warm orange tones."
|
|
12
|
+
description: "A vibrant and elegant theme in warm orange tones.",
|
|
13
|
+
appName: "Orange Heart",
|
|
14
|
+
author: "evgo2017"
|
|
11
15
|
},
|
|
12
16
|
{
|
|
13
17
|
id: "rainbow",
|
|
14
18
|
name: "Rainbow",
|
|
15
|
-
description: "A colorful, lively theme with a clean layout."
|
|
19
|
+
description: "A colorful, lively theme with a clean layout.",
|
|
20
|
+
appName: "Rainbow",
|
|
21
|
+
author: "thezbm"
|
|
16
22
|
},
|
|
17
23
|
{
|
|
18
24
|
id: "lapis",
|
|
19
25
|
name: "Lapis",
|
|
20
|
-
description: "A minimal and refreshing theme in cool blue tones."
|
|
26
|
+
description: "A minimal and refreshing theme in cool blue tones.",
|
|
27
|
+
appName: "Lapis",
|
|
28
|
+
author: "YiNN"
|
|
21
29
|
},
|
|
22
30
|
{
|
|
23
31
|
id: "pie",
|
|
24
32
|
name: "Pie",
|
|
25
|
-
description: "Inspired by sspai.com and Misty — modern, sharp, and stylish."
|
|
33
|
+
description: "Inspired by sspai.com and Misty — modern, sharp, and stylish.",
|
|
34
|
+
appName: "Pie",
|
|
35
|
+
author: "kevinzhao2233"
|
|
26
36
|
},
|
|
27
37
|
{
|
|
28
38
|
id: "maize",
|
|
29
39
|
name: "Maize",
|
|
30
|
-
description: "A crisp, light theme with a soft maize palette."
|
|
40
|
+
description: "A crisp, light theme with a soft maize palette.",
|
|
41
|
+
appName: "Maize",
|
|
42
|
+
author: "BEATREE"
|
|
31
43
|
},
|
|
32
44
|
{
|
|
33
45
|
id: "purple",
|
|
34
46
|
name: "Purple",
|
|
35
|
-
description: "Clean and minimalist, with a subtle purple accent."
|
|
47
|
+
description: "Clean and minimalist, with a subtle purple accent.",
|
|
48
|
+
appName: "Purple",
|
|
49
|
+
author: "hliu202"
|
|
36
50
|
},
|
|
37
51
|
{
|
|
38
52
|
id: "phycat",
|
|
39
|
-
name: "
|
|
40
|
-
description: "物理猫-薄荷:a mint-green theme with clear structure and hierarchy."
|
|
53
|
+
name: "Phycat",
|
|
54
|
+
description: "物理猫-薄荷:a mint-green theme with clear structure and hierarchy.",
|
|
55
|
+
appName: "物理猫-薄荷",
|
|
56
|
+
author: "sumruler"
|
|
41
57
|
}
|
|
42
|
-
],
|
|
58
|
+
], a = /* @__PURE__ */ Object.assign({
|
|
43
59
|
"./themes/default.css": () => import("./default-D-dyLptq.js").then((e) => e.default),
|
|
60
|
+
"./themes/juejin_default.css": () => import("./juejin_default-CnUAGV72.js").then((e) => e.default),
|
|
44
61
|
"./themes/lapis.css": () => import("./lapis-dRySN5pK.js").then((e) => e.default),
|
|
45
62
|
"./themes/maize.css": () => import("./maize-DFW0x6O3.js").then((e) => e.default),
|
|
63
|
+
"./themes/medium_default.css": () => import("./medium_default-BXHGUKdY.js").then((e) => e.default),
|
|
46
64
|
"./themes/orangeheart.css": () => import("./orangeheart-Da7uQj8U.js").then((e) => e.default),
|
|
47
65
|
"./themes/phycat.css": () => import("./phycat-BGGT9oBk.js").then((e) => e.default),
|
|
48
66
|
"./themes/pie.css": () => import("./pie-DUYodGli.js").then((e) => e.default),
|
|
49
67
|
"./themes/purple.css": () => import("./purple-Da1-Vfos.js").then((e) => e.default),
|
|
50
|
-
"./themes/rainbow.css": () => import("./rainbow-BtrbZco6.js").then((e) => e.default)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
"./themes/rainbow.css": () => import("./rainbow-BtrbZco6.js").then((e) => e.default),
|
|
69
|
+
"./themes/toutiao_default.css": () => import("./toutiao_default-DthFV93V.js").then((e) => e.default),
|
|
70
|
+
"./themes/zhihu_default.css": () => import("./zhihu_default-7uVAZjKn.js").then((e) => e.default)
|
|
71
|
+
});
|
|
72
|
+
function n(e) {
|
|
73
|
+
const s = `./themes/${e.id}.css`, t = a[s];
|
|
74
|
+
return t ? {
|
|
55
75
|
...e,
|
|
56
76
|
getCss: t
|
|
57
|
-
} : console.warn(`[Themes] CSS file not found for theme: ${e.id}`);
|
|
77
|
+
} : (console.warn(`[Themes] CSS file not found for theme: ${e.id}`), null);
|
|
58
78
|
}
|
|
79
|
+
const r = Object.fromEntries(
|
|
80
|
+
i.map((e) => n(e)).filter((e) => e !== null).map((e) => [e.id, e])
|
|
81
|
+
);
|
|
59
82
|
function o() {
|
|
60
|
-
return Object.values(
|
|
83
|
+
return Object.values(r);
|
|
61
84
|
}
|
|
85
|
+
const m = [
|
|
86
|
+
"juejin_default",
|
|
87
|
+
"medium_default",
|
|
88
|
+
"toutiao_default",
|
|
89
|
+
"zhihu_default"
|
|
90
|
+
], h = Object.fromEntries(
|
|
91
|
+
m.map((e) => [
|
|
92
|
+
e,
|
|
93
|
+
{
|
|
94
|
+
id: e,
|
|
95
|
+
name: "",
|
|
96
|
+
description: "",
|
|
97
|
+
appName: "",
|
|
98
|
+
author: "",
|
|
99
|
+
getCss: a[`./themes/${e}.css`]
|
|
100
|
+
}
|
|
101
|
+
])
|
|
102
|
+
);
|
|
62
103
|
export {
|
|
63
104
|
o as getAllThemes,
|
|
64
|
-
|
|
105
|
+
h as otherThemes,
|
|
106
|
+
r as themes
|
|
65
107
|
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const n = `:root {
|
|
2
|
+
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
3
|
+
"Noto Color Emoji";
|
|
4
|
+
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
5
|
+
}
|
|
6
|
+
#wenyan {
|
|
7
|
+
font-family: var(--sans-serif-font);
|
|
8
|
+
line-height: 1.75;
|
|
9
|
+
}
|
|
10
|
+
#wenyan * {
|
|
11
|
+
box-sizing: border-box;
|
|
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
|
+
#wenyan h1,
|
|
24
|
+
#wenyan h2,
|
|
25
|
+
#wenyan h3,
|
|
26
|
+
#wenyan h4,
|
|
27
|
+
#wenyan h5,
|
|
28
|
+
#wenyan h6 {
|
|
29
|
+
font-size: 18px;
|
|
30
|
+
line-height: 30px;
|
|
31
|
+
margin-top: 20px;
|
|
32
|
+
margin-bottom: 12px;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
position: relative;
|
|
35
|
+
}
|
|
36
|
+
#wenyan h1:before,
|
|
37
|
+
#wenyan h2:before,
|
|
38
|
+
#wenyan h3:before,
|
|
39
|
+
#wenyan h4:before,
|
|
40
|
+
#wenyan h5:before,
|
|
41
|
+
#wenyan h6:before {
|
|
42
|
+
content: "";
|
|
43
|
+
display: inline-block;
|
|
44
|
+
vertical-align: 1px;
|
|
45
|
+
width: 16px;
|
|
46
|
+
height: 20px;
|
|
47
|
+
margin-right: 6px;
|
|
48
|
+
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT7kuInop5LlvaI8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZyBpZD0i5LiJ6KeS5b2iIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNNi4zNTc0OTI5Myw0LjQyOTE1NDg4IEwxMC41OTEzMDI1LDExLjQ4NTUwNDIgQzEwLjg3NTQ1MDcsMTEuOTU5MDg0NSAxMC43MjE4ODU2LDEyLjU3MzM0NDggMTAuMjQ4MzA1NCwxMi44NTc0OTI5IEMxMC4wOTI4OSwxMi45NTA3NDIyIDkuOTE1MDUzNTcsMTMgOS43MzM4MDk2MiwxMyBMMS4yNjYxOTAzOCwxMyBDMC43MTM5MDU2MjksMTMgMC4yNjYxOTAzNzksMTIuNTUyMjg0NyAwLjI2NjE5MDM3OSwxMiBDMC4yNjYxOTAzNzksMTEuODE4NzU2MSAwLjMxNTQ0ODIxMiwxMS42NDA5MTk2IDAuNDA4Njk3NDUzLDExLjQ4NTUwNDIgTDQuNjQyNTA3MDcsNC40MjkxNTQ4OCBDNC45MjY2NTUyMywzLjk1NTU3NDYxIDUuNTQwOTE1NDksMy44MDIwMDk1NSA2LjAxNDQ5NTc2LDQuMDg2MTU3NzEgQzYuMTU1MjQ1MzYsNC4xNzA2MDc0NyA2LjI3MzA0MzE2LDQuMjg4NDA1MjcgNi4zNTc0OTI5Myw0LjQyOTE1NDg4IFoiIGZpbGw9IiNGRjVFNUUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUuNTAwMDAwLCA4LjAwMDAwMCkgcm90YXRlKC0yNzAuMDAwMDAwKSB0cmFuc2xhdGUoLTUuNTAwMDAwLCAtOC4wMDAwMDApICI+PC9wYXRoPgogICAgPC9nPgo8L3N2Zz4=);
|
|
49
|
+
background-repeat: no-repeat;
|
|
50
|
+
background-size: 16px 16px;
|
|
51
|
+
background-position-y: 6px;
|
|
52
|
+
}
|
|
53
|
+
#wenyan ul,
|
|
54
|
+
#wenyan ol {
|
|
55
|
+
padding-left: 1.2em;
|
|
56
|
+
}
|
|
57
|
+
#wenyan li {
|
|
58
|
+
margin-left: 1.2em;
|
|
59
|
+
}
|
|
60
|
+
#wenyan img {
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
height: auto;
|
|
63
|
+
margin: 0 auto;
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
#wenyan table {
|
|
67
|
+
margin-left: auto;
|
|
68
|
+
margin-right: auto;
|
|
69
|
+
border-collapse: collapse;
|
|
70
|
+
table-layout: fixed;
|
|
71
|
+
overflow: auto;
|
|
72
|
+
border-spacing: 0;
|
|
73
|
+
font-size: 1em;
|
|
74
|
+
word-wrap: break-word;
|
|
75
|
+
word-break: break-all;
|
|
76
|
+
}
|
|
77
|
+
#wenyan table td,
|
|
78
|
+
#wenyan table th {
|
|
79
|
+
height: 40px;
|
|
80
|
+
padding: 9px 12px;
|
|
81
|
+
line-height: 22px;
|
|
82
|
+
color: #222;
|
|
83
|
+
min-width: 88px;
|
|
84
|
+
border: 1px solid #d8d8d8;
|
|
85
|
+
vertical-align: top;
|
|
86
|
+
}
|
|
87
|
+
#wenyan blockquote {
|
|
88
|
+
margin: 0;
|
|
89
|
+
margin-bottom: 20px;
|
|
90
|
+
padding: 0 16px;
|
|
91
|
+
position: relative;
|
|
92
|
+
color: #999;
|
|
93
|
+
text-align: justify;
|
|
94
|
+
}
|
|
95
|
+
#wenyan blockquote:before {
|
|
96
|
+
content: " ";
|
|
97
|
+
left: 0;
|
|
98
|
+
position: absolute;
|
|
99
|
+
width: 2px;
|
|
100
|
+
height: 100%;
|
|
101
|
+
background: #f2f2f2;
|
|
102
|
+
}
|
|
103
|
+
#wenyan p code {
|
|
104
|
+
font-family: var(--monospace-font);
|
|
105
|
+
color: #1e6bb8;
|
|
106
|
+
}
|
|
107
|
+
/* 代码块 */
|
|
108
|
+
#wenyan pre {
|
|
109
|
+
border-radius: 3px;
|
|
110
|
+
border: 1px solid #e8e8e8;
|
|
111
|
+
line-height: 2;
|
|
112
|
+
margin: 1em 0.5em;
|
|
113
|
+
padding: .5em;
|
|
114
|
+
}
|
|
115
|
+
#wenyan pre code {
|
|
116
|
+
font-family: var(--monospace-font);
|
|
117
|
+
display: block;
|
|
118
|
+
overflow-x: auto;
|
|
119
|
+
margin: .5em;
|
|
120
|
+
padding: 0;
|
|
121
|
+
}
|
|
122
|
+
#wenyan hr {
|
|
123
|
+
width: 100%;
|
|
124
|
+
height: 1px;
|
|
125
|
+
background-color: #e8e8e8;
|
|
126
|
+
border: none;
|
|
127
|
+
margin: 20px 0;
|
|
128
|
+
}
|
|
129
|
+
/* 链接 */
|
|
130
|
+
#wenyan a {
|
|
131
|
+
word-wrap: break-word;
|
|
132
|
+
color: #0069c2;
|
|
133
|
+
}
|
|
134
|
+
/* 脚注 */
|
|
135
|
+
#wenyan #footnotes ul {
|
|
136
|
+
font-size: 0.9em;
|
|
137
|
+
margin: 0;
|
|
138
|
+
padding-left: 1.2em;
|
|
139
|
+
}
|
|
140
|
+
#wenyan #footnotes li {
|
|
141
|
+
margin: 0 0 0 1.2em;
|
|
142
|
+
word-wrap: break-word;
|
|
143
|
+
word-break: break-all;
|
|
144
|
+
}
|
|
145
|
+
#wenyan .footnote {
|
|
146
|
+
color: #0069c2;
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
export {
|
|
150
|
+
n as default
|
|
151
|
+
};
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ export type Theme = {
|
|
|
2
2
|
id: string;
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
5
|
+
appName: string;
|
|
6
|
+
author: string;
|
|
5
7
|
getCss: () => Promise<string>;
|
|
6
8
|
};
|
|
7
9
|
export declare const themes: Record<string, Theme>;
|
|
8
10
|
export declare function getAllThemes(): Theme[];
|
|
11
|
+
export declare const otherThemes: Record<string, Theme>;
|
package/dist/wrapper.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSDOM as a } from "jsdom";
|
|
2
|
-
import { configureMarked as
|
|
3
|
-
async function f(n,
|
|
4
|
-
|
|
5
|
-
const t =
|
|
2
|
+
import { configureMarked as m, handleFrontMatter as s, renderMarkdown as w, getContentForGzhBuiltinTheme as l } from "./core.js";
|
|
3
|
+
async function f(n, e, o, r) {
|
|
4
|
+
m();
|
|
5
|
+
const t = s(n), c = await w(t.body), d = new a(`<body><section id="wenyan">${c}</section></body>`).window.document.getElementById("wenyan"), i = await l(d, e, o, r);
|
|
6
6
|
return {
|
|
7
7
|
title: t.title,
|
|
8
8
|
cover: t.cover,
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
const n = `:root {
|
|
2
|
+
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
3
|
+
"Noto Color Emoji";
|
|
4
|
+
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
5
|
+
}
|
|
6
|
+
#wenyan {
|
|
7
|
+
font-family: var(--sans-serif-font);
|
|
8
|
+
line-height: 1.75;
|
|
9
|
+
font-size: 16px;
|
|
10
|
+
}
|
|
11
|
+
#wenyan * {
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
#wenyan h1,
|
|
15
|
+
#wenyan h2,
|
|
16
|
+
#wenyan h3,
|
|
17
|
+
#wenyan h4,
|
|
18
|
+
#wenyan h5,
|
|
19
|
+
#wenyan h6,
|
|
20
|
+
#wenyan p,
|
|
21
|
+
#wenyan pre {
|
|
22
|
+
margin: 1em 0;
|
|
23
|
+
}
|
|
24
|
+
#wenyan h1,
|
|
25
|
+
#wenyan h2 {
|
|
26
|
+
clear: left;
|
|
27
|
+
font-size: 1.2em;
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
line-height: 1.5;
|
|
30
|
+
margin-bottom: 1.16667em;
|
|
31
|
+
margin-top: 2.33333em;
|
|
32
|
+
}
|
|
33
|
+
#wenyan h3,
|
|
34
|
+
#wenyan h4,
|
|
35
|
+
#wenyan h5,
|
|
36
|
+
#wenyan h6 {
|
|
37
|
+
clear: left;
|
|
38
|
+
font-size: 1.1em;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
line-height: 1.5;
|
|
41
|
+
margin-bottom: 1.27273em;
|
|
42
|
+
margin-top: 1.90909em;
|
|
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
|
+
border-collapse: collapse;
|
|
59
|
+
font-size: 15px;
|
|
60
|
+
margin: 1.4em auto;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
table-layout: fixed;
|
|
63
|
+
text-align: left;
|
|
64
|
+
width: 100%;
|
|
65
|
+
word-wrap: break-word;
|
|
66
|
+
word-break: break-all;
|
|
67
|
+
}
|
|
68
|
+
#wenyan table th {
|
|
69
|
+
background: #ebeced;
|
|
70
|
+
color: #191b1f;
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
}
|
|
73
|
+
#wenyan table td,
|
|
74
|
+
#wenyan table th {
|
|
75
|
+
border: 1px solid #c4c7ce;
|
|
76
|
+
height: 24px;
|
|
77
|
+
line-height: 24px;
|
|
78
|
+
padding: 3px 12px;
|
|
79
|
+
}
|
|
80
|
+
#wenyan blockquote {
|
|
81
|
+
border-left: 3px solid #c4c7ce;
|
|
82
|
+
margin: 1.5em 0;
|
|
83
|
+
padding: 0 0 1em 1em;
|
|
84
|
+
color: #535861;
|
|
85
|
+
}
|
|
86
|
+
#wenyan code {
|
|
87
|
+
margin: 0px 2px;
|
|
88
|
+
padding: 3px 4px;
|
|
89
|
+
border-radius: 3px;
|
|
90
|
+
font-family: var(--monospace-font);
|
|
91
|
+
background-color: rgb(246, 246, 246);
|
|
92
|
+
}
|
|
93
|
+
#wenyan pre {
|
|
94
|
+
word-wrap: normal;
|
|
95
|
+
background: #f8f8fa;
|
|
96
|
+
border-radius: 4px;
|
|
97
|
+
line-height: 2;
|
|
98
|
+
margin: 1em 0.5em;
|
|
99
|
+
padding: .5em;
|
|
100
|
+
white-space: pre;
|
|
101
|
+
word-break: normal;
|
|
102
|
+
}
|
|
103
|
+
#wenyan pre code {
|
|
104
|
+
display: block;
|
|
105
|
+
overflow-x: auto;
|
|
106
|
+
margin: .5em;
|
|
107
|
+
padding: 0;
|
|
108
|
+
}
|
|
109
|
+
#wenyan hr {
|
|
110
|
+
border: none;
|
|
111
|
+
border-top: 1px solid #c4c7ce;
|
|
112
|
+
margin: 2em auto;
|
|
113
|
+
max-width: 100%;
|
|
114
|
+
width: 240px;
|
|
115
|
+
}
|
|
116
|
+
/* 链接 */
|
|
117
|
+
#wenyan a {
|
|
118
|
+
word-wrap: break-word;
|
|
119
|
+
color: #0069c2;
|
|
120
|
+
}
|
|
121
|
+
/* 脚注 */
|
|
122
|
+
#wenyan #footnotes ul {
|
|
123
|
+
font-size: 0.9em;
|
|
124
|
+
margin: 0;
|
|
125
|
+
padding-left: 1.2em;
|
|
126
|
+
}
|
|
127
|
+
#wenyan #footnotes li {
|
|
128
|
+
margin: 0 0 0 1.2em;
|
|
129
|
+
word-wrap: break-word;
|
|
130
|
+
word-break: break-all;
|
|
131
|
+
}
|
|
132
|
+
#wenyan .footnote {
|
|
133
|
+
color: #0069c2;
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
export {
|
|
137
|
+
n as default
|
|
138
|
+
};
|