@wenyan-md/cli 1.0.10 → 1.0.11
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 +4 -0
- package/dist/commands/publish.js +8 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -251,6 +251,8 @@ wenyan publish example.md
|
|
|
251
251
|
---
|
|
252
252
|
title: 在本地跑一个大语言模型(2) - 给模型提供外部知识库
|
|
253
253
|
cover: /Users/xxx/image.jpg
|
|
254
|
+
author: xxx
|
|
255
|
+
source_url: http://
|
|
254
256
|
---
|
|
255
257
|
```
|
|
256
258
|
|
|
@@ -260,6 +262,8 @@ cover: /Users/xxx/image.jpg
|
|
|
260
262
|
- `cover` 文章封面
|
|
261
263
|
- 本地路径或网络图片
|
|
262
264
|
- 如果正文中已有图片,可省略
|
|
265
|
+
- `author` 文章作者
|
|
266
|
+
- `source_url` 原文地址
|
|
263
267
|
|
|
264
268
|
## 示例文章格式
|
|
265
269
|
|
package/dist/commands/publish.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { publishToWechatDraft } from "@wenyan-md/core/publish";
|
|
2
2
|
import { prepareRenderContext, runCommandWrapper } from "./render.js";
|
|
3
3
|
export async function publishCommand(inputContent, options) {
|
|
4
4
|
await runCommandWrapper(async () => {
|
|
@@ -7,7 +7,13 @@ export async function publishCommand(inputContent, options) {
|
|
|
7
7
|
throw new Error("Error: 未能找到文章标题");
|
|
8
8
|
if (!gzhContent.cover)
|
|
9
9
|
throw new Error("Error: 未能找到文章封面");
|
|
10
|
-
const data = await
|
|
10
|
+
const data = await publishToWechatDraft({
|
|
11
|
+
title: gzhContent.title,
|
|
12
|
+
content: gzhContent.content,
|
|
13
|
+
cover: gzhContent.cover,
|
|
14
|
+
author: gzhContent.author,
|
|
15
|
+
source_url: gzhContent.source_url,
|
|
16
|
+
}, {
|
|
11
17
|
relativePath: absoluteDirPath,
|
|
12
18
|
});
|
|
13
19
|
if (data.media_id) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenyan-md/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "A CLI tool for Wenyan markdown rendering & publishing",
|
|
5
5
|
"author": "Lei <caol64@gmail.com> (https://github.com/caol64)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/caol64/wenyan-cli/issues"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@wenyan-md/core": "^2.0.
|
|
34
|
+
"@wenyan-md/core": "^2.0.5",
|
|
35
35
|
"commander": "^14.0.0",
|
|
36
36
|
"form-data-encoder": "^4.1.0",
|
|
37
37
|
"formdata-node": "^6.0.3",
|