@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
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const medium_default = ':root {\n --sans-serif-font: source-serif-pro, Georgia, Cambria, "Times New Roman", Times, serif;\n --monospace-font: Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;\n}\n#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 font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;\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 font-family: var(--monospace-font);\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}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n font-family: var(--monospace-font);\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';
|
|
2
|
+
export {
|
|
3
|
+
medium_default as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const monokai_min = "pre{background:#272822}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#272822;color:#ddd}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-number,.hljs-selector-tag,.hljs-strong,.hljs-tag{color:#f92672}.hljs-code{color:#66d9ef}.hljs-attr,.hljs-attribute,.hljs-link,.hljs-regexp,.hljs-symbol{color:#bf79db}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-section,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string,.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#a6e22e}.hljs-class .hljs-title,.hljs-title.class_{color:#fff}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#75715e}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-section,.hljs-selector-id,.hljs-selector-tag,.hljs-title,.hljs-type{font-weight:700}";
|
|
2
|
+
export {
|
|
3
|
+
monokai_min as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const orangeheart = '/*\n * Typora Theme - Orange Heart / Author - evgo2017\n * https://github.com/evgo2017/typora-theme-orange-heart\n */\n\n#wenyan {\n font-family: var(--sans-serif-font);\n line-height: 1.75;\n font-size: 16px;\n}\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 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 font-family: var(--monospace-font);\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}\n#wenyan pre code {\n display: block;\n margin: .5em;\n padding: 0;\n font-family: var(--monospace-font);\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';
|
|
2
|
+
export {
|
|
3
|
+
orangeheart as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const pie = '/*\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 font-family: var(--sans-serif-font);\n line-height: 1.75;\n color: var(--mid-10);\n letter-spacing: 0;\n font-size: 16px;\n}\n#wenyan p,\n#wenyan pre {\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-family: Arial, serif;\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-family: var(--monospace-font);\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}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n font-family: var(--monospace-font);\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';
|
|
2
|
+
export {
|
|
3
|
+
pie as default
|
|
4
|
+
};
|
package/dist/publish.js
CHANGED
|
@@ -1,372 +1,163 @@
|
|
|
1
|
-
import { JSDOM
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
e += a.byteLength, yield new Uint8Array(a);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async function* D(t) {
|
|
26
|
-
const e = t.getReader();
|
|
27
|
-
for (; ; ) {
|
|
28
|
-
const { done: r, value: a } = await e.read();
|
|
29
|
-
if (r)
|
|
30
|
-
break;
|
|
31
|
-
yield a;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async function* x(t) {
|
|
35
|
-
for await (const e of t)
|
|
36
|
-
yield* z(e);
|
|
37
|
-
}
|
|
38
|
-
var H = (t) => {
|
|
39
|
-
if (C(t))
|
|
40
|
-
return x(t);
|
|
41
|
-
if (h(t.getReader))
|
|
42
|
-
return x(D(t));
|
|
43
|
-
throw new TypeError(
|
|
44
|
-
"Unsupported data source: Expected either ReadableStream or async iterable."
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
async function* O(t) {
|
|
48
|
-
let e = 0;
|
|
49
|
-
for (; e !== t.size; ) {
|
|
50
|
-
const a = await t.slice(
|
|
51
|
-
e,
|
|
52
|
-
Math.min(t.size, e + A)
|
|
53
|
-
).arrayBuffer();
|
|
54
|
-
e += a.byteLength, yield new Uint8Array(a);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
async function* T(t, e = !1) {
|
|
58
|
-
for (const r of t)
|
|
59
|
-
ArrayBuffer.isView(r) ? e ? yield* z(r) : yield r : h(r.stream) ? yield* H(r.stream()) : yield* O(r);
|
|
60
|
-
}
|
|
61
|
-
function* U(t, e, r = 0, a) {
|
|
62
|
-
a ??= e;
|
|
63
|
-
let s = r < 0 ? Math.max(e + r, 0) : Math.min(r, e), i = a < 0 ? Math.max(e + a, 0) : Math.min(a, e);
|
|
64
|
-
const n = Math.max(i - s, 0);
|
|
65
|
-
let o = 0;
|
|
66
|
-
for (const d of t) {
|
|
67
|
-
if (o >= n)
|
|
68
|
-
break;
|
|
69
|
-
const c = ArrayBuffer.isView(d) ? d.byteLength : d.size;
|
|
70
|
-
if (s && c <= s)
|
|
71
|
-
s -= c, i -= c;
|
|
72
|
-
else {
|
|
73
|
-
let l;
|
|
74
|
-
ArrayBuffer.isView(d) ? (l = d.subarray(s, Math.min(c, i)), o += l.byteLength) : (l = d.slice(s, Math.min(c, i)), o += l.size), i -= c, s = 0, yield l;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
var u, k, g, V = class E {
|
|
79
|
-
/**
|
|
80
|
-
* Returns a new [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) object.
|
|
81
|
-
* The content of the blob consists of the concatenation of the values given in the parameter array.
|
|
82
|
-
*
|
|
83
|
-
* @param blobParts An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
|
|
84
|
-
* @param options An optional object of type `BlobPropertyBag`.
|
|
85
|
-
*/
|
|
86
|
-
constructor(e = [], r = {}) {
|
|
87
|
-
if (w(this, u, []), w(this, k, ""), w(this, g, 0), r ??= {}, typeof e != "object" || e === null)
|
|
88
|
-
throw new TypeError(
|
|
89
|
-
"Failed to construct 'Blob': The provided value cannot be converted to a sequence."
|
|
90
|
-
);
|
|
91
|
-
if (!h(e[Symbol.iterator]))
|
|
92
|
-
throw new TypeError(
|
|
93
|
-
"Failed to construct 'Blob': The object must have a callable @@iterator property."
|
|
94
|
-
);
|
|
95
|
-
if (typeof r != "object" && !h(r))
|
|
96
|
-
throw new TypeError(
|
|
97
|
-
"Failed to construct 'Blob': parameter 2 cannot convert to dictionary."
|
|
98
|
-
);
|
|
99
|
-
const a = new TextEncoder();
|
|
100
|
-
for (const i of e) {
|
|
101
|
-
let n;
|
|
102
|
-
ArrayBuffer.isView(i) ? n = new Uint8Array(i.buffer.slice(
|
|
103
|
-
i.byteOffset,
|
|
104
|
-
i.byteOffset + i.byteLength
|
|
105
|
-
)) : i instanceof ArrayBuffer ? n = new Uint8Array(i.slice(0)) : i instanceof E ? n = i : n = a.encode(String(i)), p(this, g, f(this, g) + (ArrayBuffer.isView(n) ? n.byteLength : n.size)), f(this, u).push(n);
|
|
106
|
-
}
|
|
107
|
-
const s = r.type === void 0 ? "" : String(r.type);
|
|
108
|
-
p(this, k, /^[\x20-\x7E]*$/.test(s) ? s : "");
|
|
109
|
-
}
|
|
110
|
-
static [Symbol.hasInstance](e) {
|
|
111
|
-
return !!(e && typeof e == "object" && h(e.constructor) && (h(e.stream) || h(e.arrayBuffer)) && /^(Blob|File)$/.test(e[Symbol.toStringTag]));
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Returns the [`MIME type`](https://developer.mozilla.org/en-US/docs/Glossary/MIME_type) of the [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
|
|
115
|
-
*/
|
|
116
|
-
get type() {
|
|
117
|
-
return f(this, k);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Returns the size of the [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) in bytes.
|
|
121
|
-
*/
|
|
122
|
-
get size() {
|
|
123
|
-
return f(this, g);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Creates and returns a new [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) object which contains data from a subset of the blob on which it's called.
|
|
127
|
-
*
|
|
128
|
-
* @param start An index into the Blob indicating the first byte to include in the new Blob. If you specify a negative value, it's treated as an offset from the end of the Blob toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is 0. If you specify a value for start that is larger than the size of the source Blob, the returned Blob has size 0 and contains no data.
|
|
129
|
-
* @param end An index into the Blob indicating the first byte that will *not* be included in the new Blob (i.e. the byte exactly at this index is not included). If you specify a negative value, it's treated as an offset from the end of the Blob toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is size.
|
|
130
|
-
* @param contentType The content type to assign to the new Blob; this will be the value of its type property. The default value is an empty string.
|
|
131
|
-
*/
|
|
132
|
-
slice(e, r, a) {
|
|
133
|
-
return new E(U(f(this, u), this.size, e, r), {
|
|
134
|
-
type: a
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves with a string containing the contents of the blob, interpreted as UTF-8.
|
|
139
|
-
*/
|
|
140
|
-
async text() {
|
|
141
|
-
const e = new TextDecoder();
|
|
142
|
-
let r = "";
|
|
143
|
-
for await (const a of T(f(this, u)))
|
|
144
|
-
r += e.decode(a, { stream: !0 });
|
|
145
|
-
return r += e.decode(), r;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves with the contents of the blob as binary data contained in an [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).
|
|
149
|
-
*/
|
|
150
|
-
async arrayBuffer() {
|
|
151
|
-
const e = new Uint8Array(this.size);
|
|
152
|
-
let r = 0;
|
|
153
|
-
for await (const a of T(f(this, u)))
|
|
154
|
-
e.set(a, r), r += a.length;
|
|
155
|
-
return e.buffer;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Returns a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) which upon reading returns the data contained within the [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
|
|
159
|
-
*/
|
|
160
|
-
stream() {
|
|
161
|
-
const e = T(f(this, u), !0);
|
|
162
|
-
return new ReadableStream({
|
|
163
|
-
async pull(r) {
|
|
164
|
-
const { value: a, done: s } = await e.next();
|
|
165
|
-
if (s)
|
|
166
|
-
return queueMicrotask(() => r.close());
|
|
167
|
-
r.enqueue(a);
|
|
168
|
-
},
|
|
169
|
-
async cancel() {
|
|
170
|
-
await e.return();
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
get [Symbol.toStringTag]() {
|
|
175
|
-
return "Blob";
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
u = /* @__PURE__ */ new WeakMap();
|
|
179
|
-
k = /* @__PURE__ */ new WeakMap();
|
|
180
|
-
g = /* @__PURE__ */ new WeakMap();
|
|
181
|
-
var S = V;
|
|
182
|
-
Object.defineProperties(S.prototype, {
|
|
183
|
-
type: { enumerable: !0 },
|
|
184
|
-
size: { enumerable: !0 },
|
|
185
|
-
slice: { enumerable: !0 },
|
|
186
|
-
stream: { enumerable: !0 },
|
|
187
|
-
text: { enumerable: !0 },
|
|
188
|
-
arrayBuffer: { enumerable: !0 }
|
|
189
|
-
});
|
|
190
|
-
var M, v, G = class extends S {
|
|
191
|
-
/**
|
|
192
|
-
* Creates a new File instance.
|
|
193
|
-
*
|
|
194
|
-
* @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
|
|
195
|
-
* @param name The name of the file.
|
|
196
|
-
* @param options An options object containing optional attributes for the file.
|
|
197
|
-
*/
|
|
198
|
-
constructor(t, e, r = {}) {
|
|
199
|
-
if (super(t, r), w(this, M, void 0), w(this, v, 0), arguments.length < 2)
|
|
200
|
-
throw new TypeError(
|
|
201
|
-
`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`
|
|
202
|
-
);
|
|
203
|
-
p(this, M, String(e));
|
|
204
|
-
const a = r.lastModified === void 0 ? Date.now() : Number(r.lastModified);
|
|
205
|
-
Number.isNaN(a) || p(this, v, a);
|
|
206
|
-
}
|
|
207
|
-
static [Symbol.hasInstance](t) {
|
|
208
|
-
return t instanceof S && t[Symbol.toStringTag] === "File" && typeof t.name == "string";
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Name of the file referenced by the File object.
|
|
212
|
-
*/
|
|
213
|
-
get name() {
|
|
214
|
-
return f(this, M);
|
|
215
|
-
}
|
|
216
|
-
/* c8 ignore next 3 */
|
|
217
|
-
get webkitRelativePath() {
|
|
218
|
-
return "";
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
|
222
|
-
*/
|
|
223
|
-
get lastModified() {
|
|
224
|
-
return f(this, v);
|
|
225
|
-
}
|
|
226
|
-
get [Symbol.toStringTag]() {
|
|
227
|
-
return "File";
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
M = /* @__PURE__ */ new WeakMap();
|
|
231
|
-
v = /* @__PURE__ */ new WeakMap();
|
|
232
|
-
var m, y, J = class q {
|
|
233
|
-
constructor(e) {
|
|
234
|
-
w(this, m, void 0), w(this, y, void 0), p(this, m, e.path), p(this, y, e.start || 0), this.name = N(f(this, m)), this.size = e.size, this.lastModified = e.lastModified;
|
|
235
|
-
}
|
|
236
|
-
slice(e, r) {
|
|
237
|
-
return new q({
|
|
238
|
-
path: f(this, m),
|
|
239
|
-
lastModified: this.lastModified,
|
|
240
|
-
start: f(this, y) + e,
|
|
241
|
-
size: r - e
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
async *stream() {
|
|
245
|
-
const { mtimeMs: e } = await F(f(this, m));
|
|
246
|
-
if (e > this.lastModified)
|
|
247
|
-
throw new DOMException(
|
|
248
|
-
"The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",
|
|
249
|
-
"NotReadableError"
|
|
250
|
-
);
|
|
251
|
-
this.size && (yield* L(f(this, m), {
|
|
252
|
-
start: f(this, y),
|
|
253
|
-
end: f(this, y) + this.size - 1
|
|
254
|
-
}));
|
|
255
|
-
}
|
|
256
|
-
get [Symbol.toStringTag]() {
|
|
257
|
-
return "File";
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
m = /* @__PURE__ */ new WeakMap();
|
|
261
|
-
y = /* @__PURE__ */ new WeakMap();
|
|
262
|
-
var K = J;
|
|
263
|
-
function X(t, { mtimeMs: e, size: r }, a, s = {}) {
|
|
264
|
-
let i;
|
|
265
|
-
P(a) ? [s, i] = [a, void 0] : i = a;
|
|
266
|
-
const n = new K({ path: t, size: r, lastModified: e });
|
|
267
|
-
return i || (i = n.name), new G([n], i, {
|
|
268
|
-
...s,
|
|
269
|
-
lastModified: n.lastModified
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
async function Z(t, e, r) {
|
|
273
|
-
const a = await F(t);
|
|
274
|
-
return X(t, a, e, r);
|
|
1
|
+
import { JSDOM } from "jsdom";
|
|
2
|
+
import { fileFromPath } from "formdata-node/file-from-path";
|
|
3
|
+
import { FormData, Blob } from "formdata-node";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { stat } from "node:fs/promises";
|
|
6
|
+
import { FormDataEncoder } from "form-data-encoder";
|
|
7
|
+
import { Readable } from "node:stream";
|
|
8
|
+
const tokenUrl = "https://api.weixin.qq.com/cgi-bin/token";
|
|
9
|
+
const publishUrl = "https://api.weixin.qq.com/cgi-bin/draft/add";
|
|
10
|
+
const uploadUrl = `https://api.weixin.qq.com/cgi-bin/material/add_material`;
|
|
11
|
+
const appIdEnv = process.env.WECHAT_APP_ID || "";
|
|
12
|
+
const appSecretEnv = process.env.WECHAT_APP_SECRET || "";
|
|
13
|
+
async function fetchAccessToken(appId, appSecret) {
|
|
14
|
+
appId = appId ?? appIdEnv;
|
|
15
|
+
appSecret = appSecret ?? appSecretEnv;
|
|
16
|
+
const response = await fetch(`${tokenUrl}?grant_type=client_credential&appid=${appId}&secret=${appSecret}`);
|
|
17
|
+
if (!response.ok) {
|
|
18
|
+
const errorText = await response.text();
|
|
19
|
+
throw new Error(`获取AccessToken失败: ${response.status} ${errorText}`);
|
|
20
|
+
}
|
|
21
|
+
return await response.json();
|
|
275
22
|
}
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
if (!r.ok) {
|
|
282
|
-
const a = await r.text();
|
|
283
|
-
throw new Error(`获取AccessToken失败: ${r.status} ${a}`);
|
|
284
|
-
}
|
|
285
|
-
return await r.json();
|
|
286
|
-
}
|
|
287
|
-
async function ie(t, e, r, a) {
|
|
288
|
-
const s = new j();
|
|
289
|
-
s.append("media", e, r);
|
|
290
|
-
const i = await fetch(`${ee}?access_token=${a}&type=${t}`, {
|
|
23
|
+
async function uploadMaterial(type, fileData, fileName, accessToken) {
|
|
24
|
+
const form = new FormData();
|
|
25
|
+
form.append("media", fileData, fileName);
|
|
26
|
+
const encoder = new FormDataEncoder(form);
|
|
27
|
+
const response = await fetch(`${uploadUrl}?access_token=${accessToken}&type=${type}`, {
|
|
291
28
|
method: "POST",
|
|
292
|
-
|
|
29
|
+
headers: encoder.headers,
|
|
30
|
+
body: Readable.from(encoder),
|
|
31
|
+
duplex: "half"
|
|
293
32
|
});
|
|
294
|
-
if (!
|
|
295
|
-
const
|
|
296
|
-
throw new Error(`上传素材失败: ${
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
const errorText = await response.text();
|
|
35
|
+
throw new Error(`上传素材失败: ${response.status} ${errorText}`);
|
|
36
|
+
}
|
|
37
|
+
const data = await response.json();
|
|
38
|
+
if (data.errcode && data.errcode !== 0) {
|
|
39
|
+
throw new Error(`上传素材失败: ${data.errcode} ${data.errmsg}`);
|
|
297
40
|
}
|
|
298
|
-
|
|
299
|
-
|
|
41
|
+
if (data.url && data.url.startsWith("http://")) {
|
|
42
|
+
data.url = data.url.replace(/^http:\/\//i, "https://");
|
|
43
|
+
}
|
|
44
|
+
return data;
|
|
300
45
|
}
|
|
301
|
-
async function
|
|
302
|
-
const
|
|
46
|
+
async function publishArticle(title, content, thumbMediaId, accessToken) {
|
|
47
|
+
const response = await fetch(`${publishUrl}?access_token=${accessToken}`, {
|
|
303
48
|
method: "POST",
|
|
304
49
|
body: JSON.stringify({
|
|
305
50
|
articles: [
|
|
306
51
|
{
|
|
307
|
-
title
|
|
308
|
-
content
|
|
309
|
-
thumb_media_id:
|
|
52
|
+
title,
|
|
53
|
+
content,
|
|
54
|
+
thumb_media_id: thumbMediaId
|
|
310
55
|
}
|
|
311
56
|
]
|
|
312
57
|
})
|
|
313
58
|
});
|
|
314
|
-
if (!
|
|
315
|
-
const
|
|
316
|
-
throw new Error(`发布失败: ${
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
const errorText = await response.text();
|
|
61
|
+
throw new Error(`发布失败: ${response.status} ${errorText}`);
|
|
317
62
|
}
|
|
318
|
-
return await
|
|
63
|
+
return await response.json();
|
|
319
64
|
}
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
65
|
+
const hostImagePath = process.env.HOST_IMAGE_PATH || "";
|
|
66
|
+
const dockerImagePath = "/mnt/host-downloads";
|
|
67
|
+
async function uploadImage(imageUrl, accessToken, fileName) {
|
|
68
|
+
let fileData;
|
|
69
|
+
let finalName;
|
|
70
|
+
if (imageUrl.startsWith("http")) {
|
|
71
|
+
const response = await fetch(imageUrl);
|
|
72
|
+
if (!response.ok || !response.body) {
|
|
73
|
+
throw new Error(`Failed to download image from URL: ${imageUrl}`);
|
|
74
|
+
}
|
|
75
|
+
const fileNameFromUrl = path.basename(imageUrl.split("?")[0]);
|
|
76
|
+
const ext = path.extname(fileNameFromUrl);
|
|
77
|
+
finalName = fileName ?? (ext === "" ? `${fileNameFromUrl}.jpg` : fileNameFromUrl);
|
|
78
|
+
const buffer = await response.arrayBuffer();
|
|
79
|
+
if (buffer.byteLength === 0) {
|
|
80
|
+
throw new Error(`远程图片大小为0,无法上传: ${imageUrl}`);
|
|
81
|
+
}
|
|
82
|
+
const contentType = response.headers.get("content-type") || "image/jpeg";
|
|
83
|
+
fileData = new Blob([buffer], { type: contentType });
|
|
331
84
|
} else {
|
|
332
|
-
const
|
|
333
|
-
|
|
85
|
+
const localImagePath = hostImagePath ? imageUrl.replace(hostImagePath, dockerImagePath) : imageUrl;
|
|
86
|
+
const safePath = path.resolve(localImagePath);
|
|
87
|
+
const stats = await stat(safePath);
|
|
88
|
+
if (stats.size === 0) {
|
|
89
|
+
throw new Error(`本地图片大小为0,无法上传: ${safePath}`);
|
|
90
|
+
}
|
|
91
|
+
const fileNameFromLocal = path.basename(localImagePath);
|
|
92
|
+
const ext = path.extname(fileNameFromLocal);
|
|
93
|
+
finalName = fileName ?? (ext === "" ? `${fileNameFromLocal}.jpg` : fileNameFromLocal);
|
|
94
|
+
fileData = await fileFromPath(safePath);
|
|
334
95
|
}
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
337
|
-
throw new Error(`上传失败,错误码:${
|
|
338
|
-
|
|
96
|
+
const data = await uploadMaterial("image", fileData, finalName, accessToken);
|
|
97
|
+
if (data.errcode) {
|
|
98
|
+
throw new Error(`上传失败,错误码:${data.errcode},错误信息:${data.errmsg}`);
|
|
99
|
+
}
|
|
100
|
+
return data;
|
|
339
101
|
}
|
|
340
|
-
async function
|
|
341
|
-
if (!
|
|
342
|
-
return { html:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
102
|
+
async function uploadImages(content, accessToken) {
|
|
103
|
+
if (!content.includes("<img")) {
|
|
104
|
+
return { html: content, firstImageId: "" };
|
|
105
|
+
}
|
|
106
|
+
const dom = new JSDOM(content);
|
|
107
|
+
const document = dom.window.document;
|
|
108
|
+
const images = Array.from(document.querySelectorAll("img"));
|
|
109
|
+
const uploadPromises = images.map(async (element) => {
|
|
110
|
+
const dataSrc = element.getAttribute("src");
|
|
111
|
+
if (dataSrc) {
|
|
112
|
+
if (!dataSrc.startsWith("https://mmbiz.qpic.cn")) {
|
|
113
|
+
const resp = await uploadImage(dataSrc, accessToken);
|
|
114
|
+
element.setAttribute("src", resp.url);
|
|
115
|
+
return resp.media_id;
|
|
116
|
+
} else {
|
|
117
|
+
return dataSrc;
|
|
351
118
|
}
|
|
352
119
|
}
|
|
353
120
|
return null;
|
|
354
|
-
})
|
|
355
|
-
|
|
121
|
+
});
|
|
122
|
+
const mediaIds = (await Promise.all(uploadPromises)).filter(Boolean);
|
|
123
|
+
const firstImageId = mediaIds[0] || "";
|
|
124
|
+
const updatedHtml = dom.serialize();
|
|
125
|
+
return { html: updatedHtml, firstImageId };
|
|
356
126
|
}
|
|
357
|
-
async function
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
127
|
+
async function publishToDraft(title, content, cover, appId, appSecret) {
|
|
128
|
+
const accessToken = await fetchAccessToken(appId, appSecret);
|
|
129
|
+
if (!accessToken.access_token) {
|
|
130
|
+
if (accessToken.errcode) {
|
|
131
|
+
throw new Error(`获取 Access Token 失败,错误码:${accessToken.errcode},${accessToken.errmsg}`);
|
|
132
|
+
} else {
|
|
133
|
+
throw new Error(`获取 Access Token 失败: ${accessToken}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const { html, firstImageId } = await uploadImages(content, accessToken.access_token);
|
|
137
|
+
let thumbMediaId = "";
|
|
138
|
+
if (cover) {
|
|
139
|
+
const resp = await uploadImage(cover, accessToken.access_token, "cover.jpg");
|
|
140
|
+
thumbMediaId = resp.media_id;
|
|
141
|
+
} else {
|
|
142
|
+
if (firstImageId.startsWith("https://mmbiz.qpic.cn")) {
|
|
143
|
+
const resp = await uploadImage(firstImageId, accessToken.access_token, "cover.jpg");
|
|
144
|
+
thumbMediaId = resp.media_id;
|
|
145
|
+
} else {
|
|
146
|
+
thumbMediaId = firstImageId;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!thumbMediaId) {
|
|
364
150
|
throw new Error("你必须指定一张封面图或者在正文中至少出现一张图片。");
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
151
|
+
}
|
|
152
|
+
const data = await publishArticle(title, html, thumbMediaId, accessToken.access_token);
|
|
153
|
+
if (data.media_id) {
|
|
154
|
+
return data;
|
|
155
|
+
} else if (data.errcode) {
|
|
156
|
+
throw new Error(`上传到公众号草稿失败,错误码:${data.errcode},${data.errmsg}`);
|
|
157
|
+
} else {
|
|
158
|
+
throw new Error(`上传到公众号草稿失败: ${data}`);
|
|
159
|
+
}
|
|
369
160
|
}
|
|
370
161
|
export {
|
|
371
|
-
|
|
162
|
+
publishToDraft
|
|
372
163
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const purple = '/*\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 font-family: var(--sans-serif-font);\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 font-family: var(--sans-serif-font);\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-family: var(--monospace-font);\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}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n font-family: var(--monospace-font);\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';
|
|
2
|
+
export {
|
|
3
|
+
purple as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const rainbow = '/*\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 font-family: var(--sans-serif-font);\n line-height: 1.75;\n font-size: 16px;\n}\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 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}\n#wenyan pre code {\n display: block;\n overflow-x: auto;\n margin: .5em;\n padding: 0;\n font-family: var(--monospace-font);\n}\n#wenyan p code {\n font-family: var(--monospace-font);\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';
|
|
2
|
+
export {
|
|
3
|
+
rainbow as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const solarizedDark_min = "pre{background:#002b36}\n/*!\n Theme: Solarized Dark\n Author: Ethan Schoonover (modified by aramisgithub)\n License: ~ MIT (or more permissive) [via base16-schemes-source]\n Maintainer: @highlightjs/core-team\n Version: 2021.09.0\n*/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}";
|
|
2
|
+
export {
|
|
3
|
+
solarizedDark_min as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const solarizedLight_min = "pre{background:#fdf6e3}\n/*!\n Theme: Solarized Light\n Author: Ethan Schoonover (modified by aramisgithub)\n License: ~ MIT (or more permissive) [via base16-schemes-source]\n Maintainer: @highlightjs/core-team\n Version: 2021.09.0\n*/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}";
|
|
2
|
+
export {
|
|
3
|
+
solarizedLight_min as default
|
|
4
|
+
};
|