wechat-md-publisher 0.2.2 → 0.2.4

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/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wechat-md-publisher",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "全功能微信公众号 Markdown 发布工具 - 支持草稿、发布、删除和多主题",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,6 +15,16 @@
15
15
  "README.md",
16
16
  "LICENSE"
17
17
  ],
18
+ "scripts": {
19
+ "dev": "vite build --watch",
20
+ "build": "vite build && tsc",
21
+ "test": "vitest",
22
+ "test:unit": "vitest run tests/unit",
23
+ "test:integration": "vitest run tests/integration",
24
+ "lint": "eslint src --ext .ts",
25
+ "format": "prettier --write \"src/**/*.ts\"",
26
+ "prepublishOnly": "pnpm build"
27
+ },
18
28
  "keywords": [
19
29
  "wechat",
20
30
  "weixin",
@@ -35,6 +45,7 @@
35
45
  "url": "https://github.com/sipingme/wechat-md-publisher/issues"
36
46
  },
37
47
  "homepage": "https://github.com/sipingme/wechat-md-publisher#readme",
48
+ "packageManager": "pnpm@10.7.1",
38
49
  "dependencies": {
39
50
  "@wenyan-md/core": "^2.0.8",
40
51
  "commander": "^12.1.0",
@@ -65,14 +76,5 @@
65
76
  "jsdom": "^27.4.0",
66
77
  "form-data-encoder": "^4.1.0",
67
78
  "formdata-node": "^6.0.3"
68
- },
69
- "scripts": {
70
- "dev": "vite build --watch",
71
- "build": "vite build && tsc",
72
- "test": "vitest",
73
- "test:unit": "vitest run tests/unit",
74
- "test:integration": "vitest run tests/integration",
75
- "lint": "eslint src --ext .ts",
76
- "format": "prettier --write \"src/**/*.ts\""
77
79
  }
78
- }
80
+ }
@@ -1,237 +1,164 @@
1
- /* Sports Theme - 运动风主题
2
- * 特点:活力 · 动感 · 渐变色
3
- * 主色调:#00A968 (翠绿色)
1
+ /* Sports Theme - Optimized for WeChat
2
+ * 运动风主题 - 微信公众号优化版
3
+ * 优化点:增强选择器优先级,确保样式在微信环境下正确显示
4
4
  */
5
5
 
6
6
  #wenyan {
7
- font-size: 15px;
8
- line-height: 1.8;
9
- color: #2c2c2c;
10
- background-color: #ffffff;
11
- padding: 16px;
12
- max-width: 680px;
13
- margin: 0 auto;
14
- letter-spacing: 0.02em;
15
- }
16
-
17
- /* 一级标题 - 圆角渐变背景 */
7
+ font-size: 15px !important;
8
+ line-height: 1.7 !important;
9
+ color: #2c2c2c !important;
10
+ background-color: #ffffff !important;
11
+ padding: 10px !important;
12
+ max-width: 100% !important;
13
+ margin: 0 auto !important;
14
+ word-wrap: break-word !important;
15
+ font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif !important;
16
+ box-sizing: border-box !important;
17
+ }
18
+
19
+ /* 一级标题 - 运动胶囊风格 */
18
20
  #wenyan h1 {
19
- padding: 0.6em 1.5em;
20
- margin: 2.2em 0 1.2em;
21
- color: #ffffff;
22
- font-size: 22px;
23
- font-weight: 700;
24
- text-align: center;
25
- letter-spacing: 0.12em;
26
- line-height: 1.4;
27
- background: linear-gradient(120deg, #00A968, #008A56, #00A968, #00A968);
28
- border-radius: 50px;
29
- box-shadow: 0 8px 20px rgba(0, 169, 104, 0.3);
30
- text-transform: uppercase;
31
- }
32
-
33
- /* 二级标题 - 左边框渐变 */
21
+ padding: 10px 20px !important;
22
+ margin: 25px 5px 15px !important;
23
+ color: #ffffff !important;
24
+ font-size: 20px !important;
25
+ font-weight: bold !important;
26
+ text-align: center !important;
27
+ background-color: #00A968 !important;
28
+ background: linear-gradient(90deg, #00A968, #008A56) !important;
29
+ border-radius: 30px !important;
30
+ box-shadow: 0 4px 12px rgba(0, 169, 104, 0.2) !important;
31
+ display: block !important;
32
+ box-sizing: border-box !important;
33
+ }
34
+
35
+ /* 二级标题 - 侧边能量条 */
34
36
  #wenyan h2 {
35
- padding: 0.4em 1em 0.5em 1em;
36
- margin: 1.6em 0 0.8em;
37
- font-size: 20px;
38
- font-weight: 600;
39
- text-align: left;
40
- letter-spacing: 0.06em;
41
- line-height: 1.4;
42
- color: #00A968;
43
- background: linear-gradient(to right, rgba(0, 169, 104, 0.05), rgba(56, 198, 244, 0.05));
44
- border-left: 4px solid #00A968;
45
- border-radius: 0 12px 12px 0;
46
- box-shadow: 0 3px 8px rgba(0, 169, 104, 0.12);
47
- text-transform: uppercase;
48
- }
49
-
50
- /* 三级标题 - 简化版二级标题 */
37
+ padding: 6px 15px !important;
38
+ margin: 20px 0 10px !important;
39
+ font-size: 18px !important;
40
+ font-weight: bold !important;
41
+ color: #00A968 !important;
42
+ background-color: #f0f9f5 !important;
43
+ border-left: 5px solid #00A968 !important;
44
+ border-radius: 0 8px 8px 0 !important;
45
+ display: block !important;
46
+ box-sizing: border-box !important;
47
+ }
48
+
49
+ /* 三级标题 */
51
50
  #wenyan h3 {
52
- padding: 0.4em 1.2em;
53
- margin: 1.8em 0 1em;
54
- color: #00A968;
55
- font-size: 18px;
56
- font-weight: 600;
57
- text-align: left;
58
- letter-spacing: 0.08em;
59
- border-left: 4px solid #00A968;
60
- background: linear-gradient(to right, rgba(255, 102, 0, 0.05), rgba(0, 169, 104, 0.05));
61
- border-radius: 0 25px 25px 0;
51
+ padding: 4px 12px !important;
52
+ margin: 15px 0 10px !important;
53
+ color: #00A968 !important;
54
+ font-size: 16px !important;
55
+ font-weight: bold !important;
56
+ border-left: 3px solid #00A968 !important;
57
+ display: block !important;
58
+ box-sizing: border-box !important;
62
59
  }
63
60
 
64
- /* 段落 */
61
+ /* 段落 - 修正对齐方式 */
65
62
  #wenyan p {
66
- margin: 1.3em 0;
67
- text-align: justify;
68
- line-height: 1.8;
63
+ margin: 1em 0 !important;
64
+ text-align: left !important;
65
+ line-height: 1.7 !important;
66
+ color: #2c2c2c !important;
67
+ font-size: 15px !important;
68
+ box-sizing: border-box !important;
69
69
  }
70
70
 
71
- /* 加粗 - 渐变色文字 */
71
+ /* 加粗 - 关键优化:不再使用 padding 防止撑开行高 */
72
72
  #wenyan strong {
73
- font-weight: 700;
74
- background: linear-gradient(135deg, #00A968, #008A56, #00A968, #00A968);
75
- -webkit-background-clip: text;
76
- -webkit-text-fill-color: transparent;
77
- background-clip: text;
73
+ font-weight: bold !important;
74
+ color: #00A968 !important;
75
+ border-bottom: 1px solid rgba(0, 169, 104, 0.3) !important;
78
76
  }
79
77
 
80
78
  /* 斜体 */
81
79
  #wenyan em {
82
- color: #00A968;
83
- font-style: italic;
84
- font-weight: 500;
80
+ color: #555 !important;
81
+ font-style: italic !important;
85
82
  }
86
83
 
87
- /* 行内代码 */
84
+ /* 行内代码 - 简化渐变 */
88
85
  #wenyan code {
89
- font-size: 90%;
90
- color: #00A968;
91
- background: linear-gradient(135deg, rgba(0, 169, 104, 0.1), rgba(56, 198, 244, 0.1));
92
- padding: 3px 6px;
93
- border-radius: 4px;
94
- font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;
86
+ font-size: 13px !important;
87
+ color: #00A968 !important;
88
+ background-color: #f3f3f3 !important;
89
+ padding: 2px 4px !important;
90
+ border-radius: 3px !important;
91
+ font-family: Consolas, Monaco, monospace !important;
95
92
  }
96
93
 
97
- /* 代码块 */
94
+ /* 代码块 - 强化暗色动感 */
98
95
  #wenyan pre {
99
- font-size: 14px;
100
- overflow-x: auto;
101
- border-radius: 8px;
102
- padding: 1.2em;
103
- line-height: 1.6;
104
- margin: 1.5em 0;
105
- background: linear-gradient(to right, #FF6600, #00A968, #38C6F4) 0 0 / 100% 3px no-repeat, #ffffff 0 3px;
106
- box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
107
- }
108
-
109
- #wenyan pre code {
110
- background: none;
111
- padding: 0;
112
- font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;
113
- font-size: 14px;
114
- color: #2c2c2c;
115
- line-height: 1.6;
96
+ font-size: 13px !important;
97
+ background-color: #2d2d2d !important;
98
+ color: #ddd !important;
99
+ padding: 15px !important;
100
+ border-radius: 8px !important;
101
+ border-left: 5px solid #00A968 !important;
102
+ margin: 1.5em 0 !important;
103
+ overflow-x: auto !important;
104
+ box-sizing: border-box !important;
116
105
  }
117
106
 
118
107
  /* 引用块 */
119
108
  #wenyan blockquote {
120
- font-style: normal;
121
- padding: 1.2em 1.5em;
122
- border-left: 5px solid #00A968;
123
- color: #3c3c3e;
124
- background: #f8f8f8;
125
- border-radius: 0 8px 8px 0;
126
- margin: 1.8em 0;
127
- }
128
-
129
- #wenyan blockquote p {
130
- margin: 0;
131
- color: #3c3c3e;
132
- line-height: 1.8;
133
- }
134
-
135
- /* 无序列表 */
136
- #wenyan ul {
137
- list-style: none;
138
- padding: 0;
139
- margin: 1.5em 0;
140
- }
141
-
142
- #wenyan ul li {
143
- margin: 0.6em 0;
144
- padding: 0;
145
- line-height: 1.8;
109
+ padding: 10px 15px !important;
110
+ border-left: 4px solid #ddd !important;
111
+ color: #666 !important;
112
+ background-color: #f9f9f9 !important;
113
+ margin: 1.5em 0 !important;
114
+ box-sizing: border-box !important;
146
115
  }
147
116
 
148
- #wenyan ul li::before {
149
- content: "• ";
150
- color: #00A968;
151
- font-weight: bold;
152
- margin-right: 0.5em;
117
+ /* 列表 - 关键修改:微信不支持伪元素 content,建议通过插件在 HTML 层面解决 */
118
+ #wenyan ul, #wenyan ol {
119
+ padding-left: 20px !important;
120
+ margin: 1em 0 !important;
121
+ box-sizing: border-box !important;
153
122
  }
154
123
 
155
- /* 有序列表 */
156
- #wenyan ol {
157
- list-style: none;
158
- padding: 0;
159
- margin: 1.5em 0;
160
- counter-reset: list-counter;
124
+ #wenyan li {
125
+ margin: 0.5em 0 !important;
126
+ line-height: 1.6 !important;
127
+ color: #2c2c2c !important;
128
+ box-sizing: border-box !important;
161
129
  }
162
130
 
163
- #wenyan ol li {
164
- margin: 0.6em 0;
165
- padding: 0;
166
- line-height: 1.8;
167
- counter-increment: list-counter;
168
- }
169
-
170
- #wenyan ol li::before {
171
- content: counter(list-counter) ". ";
172
- color: #00A968;
173
- font-weight: bold;
174
- margin-right: 0.5em;
175
- }
176
-
177
- /* 链接 */
178
- #wenyan a {
179
- color: #00A968;
180
- text-decoration: none;
181
- border-bottom: 1px solid #00A968;
182
- transition: all 0.3s ease;
183
- }
184
-
185
- #wenyan a:hover {
186
- color: #008A56;
187
- border-bottom-color: #008A56;
188
- }
189
-
190
- /* 图片 */
191
- #wenyan img {
192
- max-width: 100%;
193
- height: auto;
194
- border-radius: 8px;
195
- margin: 1.5em 0;
196
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
197
- }
198
-
199
- /* 表格 */
131
+ /* 表格 - 去掉阴影,强化边框 */
200
132
  #wenyan table {
201
- width: 100%;
202
- border-collapse: collapse;
203
- margin: 1.8em 0;
204
- border-radius: 12px;
205
- overflow: hidden;
206
- box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
207
- border: 2px solid transparent;
133
+ display: table !important;
134
+ width: 100% !important;
135
+ border-collapse: collapse !important;
136
+ margin: 1.5em 0 !important;
137
+ font-size: 14px !important;
138
+ border: 1px solid #eee !important;
139
+ box-sizing: border-box !important;
208
140
  }
209
141
 
210
142
  #wenyan table th {
211
- padding: 12px 16px;
212
- text-align: left;
213
- font-weight: 700;
214
- background: linear-gradient(135deg, rgba(255, 102, 0, 0.1), rgba(0, 169, 104, 0.1));
215
- color: #00A968;
216
- border-bottom: 2px solid rgba(255, 102, 0, 0.2);
217
- text-transform: uppercase;
218
- letter-spacing: 0.04em;
143
+ background-color: #00A968 !important;
144
+ color: #fff !important;
145
+ padding: 8px !important;
146
+ text-align: center !important;
147
+ box-sizing: border-box !important;
219
148
  }
220
149
 
221
150
  #wenyan table td {
222
- padding: 10px 16px;
223
- border-bottom: 1px solid rgba(0, 0, 0, 0.08);
224
- color: #2c2c2c;
225
- }
226
-
227
- #wenyan table tr:last-child td {
228
- border-bottom: none;
151
+ padding: 8px !important;
152
+ border-bottom: 1px solid #eee !important;
153
+ color: #2c2c2c !important;
154
+ box-sizing: border-box !important;
229
155
  }
230
156
 
231
157
  /* 分割线 */
232
158
  #wenyan hr {
233
- height: 3px;
234
- border: none;
235
- margin: 3em 0;
236
- background-image: linear-gradient(to right, rgba(255, 102, 0, 0), #FF6600, #00A968, #38C6F4, rgba(56, 198, 244, 0));
237
- }
159
+ height: 1px !important;
160
+ border: none !important;
161
+ border-top: 1px dashed #00A968 !important;
162
+ margin: 2em 0 !important;
163
+ box-sizing: border-box !important;
164
+ }