@wenyan-md/core 1.0.12 → 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/README.md +17 -2
- 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 +53 -53
- package/dist/core.js +431 -272
- 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-C5ES4IMt.js → phycat-BNJAZy4V.js} +2 -6
- package/dist/pie-CVpIzs7v.js +4 -0
- package/dist/publish.js +137 -345
- 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/styles/wenyan-styles.js +21 -40
- package/dist/theme.js +40 -33
- package/dist/toutiao_default-BQ7BN6_-.js +4 -0
- package/dist/types/core.d.ts +17 -0
- package/dist/types/publish.d.ts +1 -1
- package/dist/types/wechatApi.d.ts +1 -1
- package/dist/types/wrapper.d.ts +3 -3
- 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 +5 -3
- 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-CnUAGV72.js +0 -139
- package/dist/lapis-dRySN5pK.js +0 -194
- package/dist/maize-DFW0x6O3.js +0 -194
- package/dist/medium_default-BXHGUKdY.js +0 -135
- package/dist/monokai.min-CH2iHqHz.js +0 -4
- package/dist/orangeheart-Da7uQj8U.js +0 -184
- package/dist/pie-DUYodGli.js +0 -240
- package/dist/purple-Da1-Vfos.js +0 -183
- package/dist/rainbow-BtrbZco6.js +0 -167
- package/dist/solarized-dark.min-BxbYljx4.js +0 -11
- package/dist/solarized-light.min-Bb25xgOC.js +0 -11
- package/dist/toutiao_default-DthFV93V.js +0 -151
- package/dist/xcode.min-CG-lWQgl.js +0 -4
- package/dist/zhihu_default-7uVAZjKn.js +0 -138
|
@@ -5,7 +5,7 @@ var WenyanStyles=(function(e){"use strict";const i=`#wenyan pre::before {
|
|
|
5
5
|
background-repeat: no-repeat;
|
|
6
6
|
width: 100%;
|
|
7
7
|
height: 16px;
|
|
8
|
-
}`,s=[{id:"default",name:"Default",description:"A clean, classic layout ideal for long-form reading.",appName:"默认",author:""},{id:"orangeheart",name:"OrangeHeart",description:"A vibrant and elegant theme in warm orange tones.",appName:"Orange Heart",author:"evgo2017"},{id:"rainbow",name:"Rainbow",description:"A colorful, lively theme with a clean layout.",appName:"Rainbow",author:"thezbm"},{id:"lapis",name:"Lapis",description:"A minimal and refreshing theme in cool blue tones.",appName:"Lapis",author:"YiNN"},{id:"pie",name:"Pie",description:"Inspired by sspai.com and Misty — modern, sharp, and stylish.",appName:"Pie",author:"kevinzhao2233"},{id:"maize",name:"Maize",description:"A crisp, light theme with a soft maize palette.",appName:"Maize",author:"BEATREE"},{id:"purple",name:"Purple",description:"Clean and minimalist, with a subtle purple accent.",appName:"Purple",author:"hliu202"},{id:"phycat",name:"Phycat",description:"物理猫-薄荷:a mint-green theme with clear structure and hierarchy.",appName:"物理猫-薄荷",author:"sumruler"}],r=Object.assign({"./themes/default.css":()=>Promise.resolve().then(()=>b).then(n=>n.default),"./themes/juejin_default.css":()=>Promise.resolve().then(()=>w).then(n=>n.default),"./themes/lapis.css":()=>Promise.resolve().then(()=>f).then(n=>n.default),"./themes/maize.css":()=>Promise.resolve().then(()=>y).then(n=>n.default),"./themes/medium_default.css":()=>Promise.resolve().then(()=>u).then(n=>n.default),"./themes/orangeheart.css":()=>Promise.resolve().then(()=>x).then(n=>n.default),"./themes/phycat.css":()=>Promise.resolve().then(()=>j).then(n=>n.default),"./themes/pie.css":()=>Promise.resolve().then(()=>k).then(n=>n.default),"./themes/purple.css":()=>Promise.resolve().then(()=>v).then(n=>n.default),"./themes/rainbow.css":()=>Promise.resolve().then(()=>z).then(n=>n.default),"./themes/toutiao_default.css":()=>Promise.resolve().then(()=>
|
|
8
|
+
}`,s=[{id:"default",name:"Default",description:"A clean, classic layout ideal for long-form reading.",appName:"默认",author:""},{id:"orangeheart",name:"OrangeHeart",description:"A vibrant and elegant theme in warm orange tones.",appName:"Orange Heart",author:"evgo2017"},{id:"rainbow",name:"Rainbow",description:"A colorful, lively theme with a clean layout.",appName:"Rainbow",author:"thezbm"},{id:"lapis",name:"Lapis",description:"A minimal and refreshing theme in cool blue tones.",appName:"Lapis",author:"YiNN"},{id:"pie",name:"Pie",description:"Inspired by sspai.com and Misty — modern, sharp, and stylish.",appName:"Pie",author:"kevinzhao2233"},{id:"maize",name:"Maize",description:"A crisp, light theme with a soft maize palette.",appName:"Maize",author:"BEATREE"},{id:"purple",name:"Purple",description:"Clean and minimalist, with a subtle purple accent.",appName:"Purple",author:"hliu202"},{id:"phycat",name:"Phycat",description:"物理猫-薄荷:a mint-green theme with clear structure and hierarchy.",appName:"物理猫-薄荷",author:"sumruler"}],r=Object.assign({"./themes/default.css":()=>Promise.resolve().then(()=>b).then(n=>n.default),"./themes/juejin_default.css":()=>Promise.resolve().then(()=>w).then(n=>n.default),"./themes/lapis.css":()=>Promise.resolve().then(()=>f).then(n=>n.default),"./themes/maize.css":()=>Promise.resolve().then(()=>y).then(n=>n.default),"./themes/medium_default.css":()=>Promise.resolve().then(()=>u).then(n=>n.default),"./themes/orangeheart.css":()=>Promise.resolve().then(()=>x).then(n=>n.default),"./themes/phycat.css":()=>Promise.resolve().then(()=>j).then(n=>n.default),"./themes/pie.css":()=>Promise.resolve().then(()=>k).then(n=>n.default),"./themes/purple.css":()=>Promise.resolve().then(()=>v).then(n=>n.default),"./themes/rainbow.css":()=>Promise.resolve().then(()=>z).then(n=>n.default),"./themes/toutiao_default.css":()=>Promise.resolve().then(()=>_).then(n=>n.default),"./themes/zhihu_default.css":()=>Promise.resolve().then(()=>M).then(n=>n.default)});function d(n){const l=`./themes/${n.id}.css`,o=r[l];return o?{...n,getCss:o}:(console.warn(`[Themes] CSS file not found for theme: ${n.id}`),null)}const t=Object.fromEntries(s.map(n=>d(n)).filter(n=>n!==null).map(n=>[n.id,n]));function h(){return Object.values(t)}const c=Object.fromEntries(["juejin_default","medium_default","toutiao_default","zhihu_default"].map(n=>[n,{id:n,name:"",description:"",appName:"",author:"",getCss:r[`./themes/${n}.css`]}])),p=[{id:"atom-one-dark"},{id:"atom-one-light"},{id:"dracula"},{id:"github-dark"},{id:"github"},{id:"monokai"},{id:"solarized-dark"},{id:"solarized-light"},{id:"xcode"}],m=Object.assign({"./highlight/styles/atom-one-dark.min.css":()=>Promise.resolve().then(()=>T).then(n=>n.default),"./highlight/styles/atom-one-light.min.css":()=>Promise.resolve().then(()=>O).then(n=>n.default),"./highlight/styles/dracula.min.css":()=>Promise.resolve().then(()=>S).then(n=>n.default),"./highlight/styles/github-dark.min.css":()=>Promise.resolve().then(()=>I).then(n=>n.default),"./highlight/styles/github.min.css":()=>Promise.resolve().then(()=>P).then(n=>n.default),"./highlight/styles/monokai.min.css":()=>Promise.resolve().then(()=>D).then(n=>n.default),"./highlight/styles/solarized-dark.min.css":()=>Promise.resolve().then(()=>N).then(n=>n.default),"./highlight/styles/solarized-light.min.css":()=>Promise.resolve().then(()=>A).then(n=>n.default),"./highlight/styles/xcode.min.css":()=>Promise.resolve().then(()=>L).then(n=>n.default)}),a={};for(const n of p){const l=`./highlight/styles/${n.id}.min.css`,o=m[l];o?a[n.id]={...n,getCss:o}:console.warn(`[Highlight Themes] CSS file not found for theme: ${n.id}`)}function g(){return Object.values(a)}(function(n){n.macStyleCss=i,n.themes=t,n.hlThemes=a})(typeof window<"u"?window:void 0);const b=Object.freeze(Object.defineProperty({__proto__:null,default:`/**
|
|
9
9
|
* 欢迎使用自定义主题功能,使用教程:
|
|
10
10
|
* https://babyno.top/posts/2024/11/wenyan-supports-customized-themes/
|
|
11
11
|
*/
|
|
@@ -185,12 +185,7 @@ var WenyanStyles=(function(e){"use strict";const i=`#wenyan pre::before {
|
|
|
185
185
|
word-wrap: break-word;
|
|
186
186
|
word-break: break-all;
|
|
187
187
|
}
|
|
188
|
-
`},Symbol.toStringTag,{value:"Module"})),w=Object.freeze(Object.defineProperty({__proto__:null,default
|
|
189
|
-
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
190
|
-
"Noto Color Emoji";
|
|
191
|
-
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
192
|
-
}
|
|
193
|
-
#wenyan {
|
|
188
|
+
`},Symbol.toStringTag,{value:"Module"})),w=Object.freeze(Object.defineProperty({__proto__:null,default:`#wenyan {
|
|
194
189
|
font-family: var(--sans-serif-font);
|
|
195
190
|
line-height: 1.75;
|
|
196
191
|
}
|
|
@@ -342,7 +337,7 @@ var WenyanStyles=(function(e){"use strict";const i=`#wenyan pre::before {
|
|
|
342
337
|
}
|
|
343
338
|
#wenyan p,
|
|
344
339
|
#wenyan pre {
|
|
345
|
-
margin: 1em 0
|
|
340
|
+
margin: 1em 0;
|
|
346
341
|
}
|
|
347
342
|
#wenyan strong {
|
|
348
343
|
color: var(--primary-color);
|
|
@@ -702,7 +697,7 @@ var WenyanStyles=(function(e){"use strict";const i=`#wenyan pre::before {
|
|
|
702
697
|
}
|
|
703
698
|
`},Symbol.toStringTag,{value:"Module"})),u=Object.freeze(Object.defineProperty({__proto__:null,default:`:root {
|
|
704
699
|
--sans-serif-font: source-serif-pro, Georgia, Cambria, "Times New Roman", Times, serif;
|
|
705
|
-
--monospace-font:
|
|
700
|
+
--monospace-font: Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
706
701
|
}
|
|
707
702
|
#wenyan {
|
|
708
703
|
font-family: var(--sans-serif-font);
|
|
@@ -1018,10 +1013,6 @@ var WenyanStyles=(function(e){"use strict";const i=`#wenyan pre::before {
|
|
|
1018
1013
|
|
|
1019
1014
|
:root {
|
|
1020
1015
|
/* 标题后小图标,借鉴自思源笔记主题——Savor */
|
|
1021
|
-
--h1-r-graphic: url("https://cdn.phycat.cn/img/mdicon/green/h1_icon.svg")
|
|
1022
|
-
no-repeat center;
|
|
1023
|
-
--h2-r-graphic: url("https://cdn.phycat.cn/img/mdicon/green/h2_icon.svg")
|
|
1024
|
-
no-repeat center;
|
|
1025
1016
|
--h3-r-graphic: url("data:image/svg+xml;utf8,<svg fill='rgba(74, 200, 141, 0.5)' height='28' viewBox='0 0 32 32' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M4.571 25.143c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM4.571 18.286c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM11.429 25.143c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286z'/></svg>")
|
|
1026
1017
|
no-repeat center;
|
|
1027
1018
|
--h4-r-graphic: url("data:image/svg+xml;utf8,<svg fill='rgba(74, 200, 141, 0.5)' height='24' viewBox='0 0 32 32' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M4.571 25.143c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM4.571 18.286c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM11.429 25.143c-1.257 0-2.286 1.029-2.286 2.286s1.029 2.286 2.286 2.286 2.286-1.029 2.286-2.286-1.029-2.286-2.286-2.286zM11.429 22.857c1.257 0 2.286-1.029 2.286-2.286s-1.029-2.286-2.286-2.286-2.286 1.029-2.286 2.286 1.029 2.286 2.286 2.286z'/></svg>")
|
|
@@ -1373,7 +1364,7 @@ h6 {
|
|
|
1373
1364
|
}
|
|
1374
1365
|
#wenyan p,
|
|
1375
1366
|
#wenyan pre {
|
|
1376
|
-
margin: 1em 0
|
|
1367
|
+
margin: 1em 0;
|
|
1377
1368
|
}
|
|
1378
1369
|
#wenyan p {
|
|
1379
1370
|
word-spacing: 0.05rem;
|
|
@@ -1785,7 +1776,7 @@ h6 {
|
|
|
1785
1776
|
}
|
|
1786
1777
|
#wenyan p,
|
|
1787
1778
|
#wenyan pre {
|
|
1788
|
-
margin: 1em 0
|
|
1779
|
+
margin: 1em 0;
|
|
1789
1780
|
}
|
|
1790
1781
|
#wenyan h1,
|
|
1791
1782
|
#wenyan h2,
|
|
@@ -1809,6 +1800,7 @@ h6 {
|
|
|
1809
1800
|
padding-right: 1em;
|
|
1810
1801
|
border-left: 0.5em solid var(--h-border-color);
|
|
1811
1802
|
border-radius: 0.4em;
|
|
1803
|
+
display: inline-block;
|
|
1812
1804
|
}
|
|
1813
1805
|
#wenyan h3 {
|
|
1814
1806
|
font-size: 1.3em;
|
|
@@ -1927,12 +1919,7 @@ h6 {
|
|
|
1927
1919
|
word-wrap: break-word;
|
|
1928
1920
|
word-break: break-all;
|
|
1929
1921
|
}
|
|
1930
|
-
`},Symbol.toStringTag,{value:"Module"})),
|
|
1931
|
-
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
1932
|
-
"Noto Color Emoji";
|
|
1933
|
-
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
1934
|
-
}
|
|
1935
|
-
#wenyan {
|
|
1922
|
+
`},Symbol.toStringTag,{value:"Module"})),_=Object.freeze(Object.defineProperty({__proto__:null,default:`#wenyan {
|
|
1936
1923
|
font-family: var(--sans-serif-font);
|
|
1937
1924
|
line-height: 1.75;
|
|
1938
1925
|
}
|
|
@@ -1955,11 +1942,10 @@ h6 {
|
|
|
1955
1942
|
#wenyan h4,
|
|
1956
1943
|
#wenyan h5,
|
|
1957
1944
|
#wenyan h6 {
|
|
1958
|
-
font-size:
|
|
1945
|
+
font-size: 17px;
|
|
1959
1946
|
line-height: 30px;
|
|
1960
1947
|
margin-top: 20px;
|
|
1961
1948
|
margin-bottom: 12px;
|
|
1962
|
-
font-weight: 700;
|
|
1963
1949
|
position: relative;
|
|
1964
1950
|
}
|
|
1965
1951
|
#wenyan h1:before,
|
|
@@ -1971,13 +1957,13 @@ h6 {
|
|
|
1971
1957
|
content: "";
|
|
1972
1958
|
display: inline-block;
|
|
1973
1959
|
vertical-align: 1px;
|
|
1974
|
-
width:
|
|
1975
|
-
height:
|
|
1960
|
+
width: 10px;
|
|
1961
|
+
height: 26px;
|
|
1976
1962
|
margin-right: 6px;
|
|
1977
|
-
background-image: url(data:image/svg+xml;base64,
|
|
1963
|
+
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyNiIgdmlld0JveD0iMCAwIDEwIDI2IiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJNOS41IDYuNTY2NTlMNC40OTk5NCAxOS40MzI2TDAgMTkuNDMyNkw1LjAwMDA2IDYuNTY2NTlMOS41IDYuNTY2NTlaIiBmaWxsPSIjRkY0MDNBIi8+Cjwvc3ZnPgo=);
|
|
1978
1964
|
background-repeat: no-repeat;
|
|
1979
|
-
background-size:
|
|
1980
|
-
background-position-y:
|
|
1965
|
+
background-size: cover;
|
|
1966
|
+
background-position-y: 8px;
|
|
1981
1967
|
}
|
|
1982
1968
|
#wenyan ul,
|
|
1983
1969
|
#wenyan ol {
|
|
@@ -2074,12 +2060,7 @@ h6 {
|
|
|
2074
2060
|
#wenyan .footnote {
|
|
2075
2061
|
color: #0069c2;
|
|
2076
2062
|
}
|
|
2077
|
-
`},Symbol.toStringTag,{value:"Module"})),
|
|
2078
|
-
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
2079
|
-
"Noto Color Emoji";
|
|
2080
|
-
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
|
|
2081
|
-
}
|
|
2082
|
-
#wenyan {
|
|
2063
|
+
`},Symbol.toStringTag,{value:"Module"})),M=Object.freeze(Object.defineProperty({__proto__:null,default:`#wenyan {
|
|
2083
2064
|
font-family: var(--sans-serif-font);
|
|
2084
2065
|
line-height: 1.75;
|
|
2085
2066
|
font-size: 16px;
|
|
@@ -2208,14 +2189,14 @@ h6 {
|
|
|
2208
2189
|
#wenyan .footnote {
|
|
2209
2190
|
color: #0069c2;
|
|
2210
2191
|
}
|
|
2211
|
-
`},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null,default:"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}"},Symbol.toStringTag,{value:"Module"})),
|
|
2192
|
+
`},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null,default:"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}"},Symbol.toStringTag,{value:"Module"})),O=Object.freeze(Object.defineProperty({__proto__:null,default:"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}"},Symbol.toStringTag,{value:"Module"})),S=Object.freeze(Object.defineProperty({__proto__:null,default:`pre{background:#282936}
|
|
2212
2193
|
/*!
|
|
2213
2194
|
Theme: Dracula
|
|
2214
2195
|
Author: Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula)
|
|
2215
2196
|
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
2216
2197
|
Maintainer: @highlightjs/core-team
|
|
2217
2198
|
Version: 2021.09.0
|
|
2218
|
-
*/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}`},Symbol.toStringTag,{value:"Module"})),
|
|
2199
|
+
*/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}`},Symbol.toStringTag,{value:"Module"})),I=Object.freeze(Object.defineProperty({__proto__:null,default:`pre{background:#0d1117}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2219
2200
|
Theme: GitHub Dark
|
|
2220
2201
|
Description: Dark theme as seen on github.com
|
|
2221
2202
|
Author: github.com
|
|
@@ -2224,7 +2205,7 @@ h6 {
|
|
|
2224
2205
|
|
|
2225
2206
|
Outdated base version: https://github.com/primer/github-syntax-dark
|
|
2226
2207
|
Current colors taken from GitHub's CSS
|
|
2227
|
-
*/.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}`},Symbol.toStringTag,{value:"Module"})),
|
|
2208
|
+
*/.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}`},Symbol.toStringTag,{value:"Module"})),P=Object.freeze(Object.defineProperty({__proto__:null,default:`pre{background:#fff}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2228
2209
|
Theme: GitHub
|
|
2229
2210
|
Description: Light theme as seen on github.com
|
|
2230
2211
|
Author: github.com
|
|
@@ -2234,18 +2215,18 @@ h6 {
|
|
|
2234
2215
|
Outdated base version: https://github.com/primer/github-syntax-light
|
|
2235
2216
|
Current colors taken from GitHub's CSS
|
|
2236
2217
|
*/.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}
|
|
2237
|
-
`},Symbol.toStringTag,{value:"Module"})),
|
|
2218
|
+
`},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null,default:"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}"},Symbol.toStringTag,{value:"Module"})),N=Object.freeze(Object.defineProperty({__proto__:null,default:`pre{background:#002b36}
|
|
2238
2219
|
/*!
|
|
2239
2220
|
Theme: Solarized Dark
|
|
2240
2221
|
Author: Ethan Schoonover (modified by aramisgithub)
|
|
2241
2222
|
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
2242
2223
|
Maintainer: @highlightjs/core-team
|
|
2243
2224
|
Version: 2021.09.0
|
|
2244
|
-
*/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}`},Symbol.toStringTag,{value:"Module"})),
|
|
2225
|
+
*/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}`},Symbol.toStringTag,{value:"Module"})),A=Object.freeze(Object.defineProperty({__proto__:null,default:`pre{background:#fdf6e3}
|
|
2245
2226
|
/*!
|
|
2246
2227
|
Theme: Solarized Light
|
|
2247
2228
|
Author: Ethan Schoonover (modified by aramisgithub)
|
|
2248
2229
|
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
2249
2230
|
Maintainer: @highlightjs/core-team
|
|
2250
2231
|
Version: 2021.09.0
|
|
2251
|
-
*/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}`},Symbol.toStringTag,{value:"Module"})),
|
|
2232
|
+
*/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}`},Symbol.toStringTag,{value:"Module"})),L=Object.freeze(Object.defineProperty({__proto__:null,default:"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}"},Symbol.toStringTag,{value:"Module"}));return e.getAllHlThemes=g,e.getAllThemes=h,e.hlThemes=a,e.otherThemes=c,e.themes=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e})({});
|
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/types/publish.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function publishToDraft(title: string, content: string, cover: string): Promise<any>;
|
|
1
|
+
export declare function publishToDraft(title: string, content: string, cover: string, appId?: string, appSecret?: string): Promise<any>;
|
|
@@ -3,6 +3,6 @@ export type UploadResponse = {
|
|
|
3
3
|
media_id: string;
|
|
4
4
|
url: string;
|
|
5
5
|
};
|
|
6
|
-
export declare function fetchAccessToken(): Promise<any>;
|
|
6
|
+
export declare function fetchAccessToken(appId?: string, appSecret?: string): Promise<any>;
|
|
7
7
|
export declare function uploadMaterial(type: string, fileData: Blob | File, fileName: string, accessToken: string): Promise<any>;
|
|
8
8
|
export declare function publishArticle(title: string, content: string, thumbMediaId: string, accessToken: string): Promise<any>;
|
package/dist/types/wrapper.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type GzhContent = {
|
|
2
|
-
title
|
|
3
|
-
cover
|
|
2
|
+
title?: string;
|
|
3
|
+
cover?: string;
|
|
4
4
|
content: string;
|
|
5
|
-
description
|
|
5
|
+
description?: string;
|
|
6
6
|
};
|
|
7
7
|
export declare function getGzhContent(content: string, themeId: string, hlThemeId: string, isMacStyle?: boolean, isAddFootnote?: boolean): Promise<GzhContent>;
|
package/dist/wrapper.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { JSDOM
|
|
2
|
-
import { configureMarked
|
|
3
|
-
async function
|
|
4
|
-
|
|
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,11 +69,11 @@
|
|
|
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",
|
|
74
|
-
"build:all": "pnpm build && pnpm build:
|
|
76
|
+
"build:all": "pnpm build && pnpm build:styles && pnpm build:math && pnpm build:browser",
|
|
75
77
|
"test:main": "pnpm build && vitest run main.test.js",
|
|
76
78
|
"test:wrapper": "pnpm build && vitest run wrapper.test.js",
|
|
77
79
|
"test:publish": "pnpm build && vitest run test/publish.test.js",
|
|
@@ -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
|
-
};
|