@wenyan-md/cli 1.0.2 → 1.0.3

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 CHANGED
@@ -116,6 +116,7 @@ $env:WECHAT_APP_ID="xxx"; $env:WECHAT_APP_SECRET="yyy"; wenyan publish "your mar
116
116
  - solarized-light
117
117
  - xcode
118
118
  - 代码块默认使用 Mac 风格,如要关闭:`--no-mac-style`
119
+ - 链接默认转脚注,如要关闭:`--no-footnote`
119
120
 
120
121
  ## 示例
121
122
 
@@ -10,7 +10,7 @@ export async function publishCommand(inputContent, options) {
10
10
  }
11
11
  inputContent = await readStdin();
12
12
  }
13
- const gzhContent = await getGzhContent(inputContent, options["theme"], options["highlight"], options["macStyle"]);
13
+ const gzhContent = await getGzhContent(inputContent, options["theme"], options["highlight"], options["macStyle"], options["footnote"]);
14
14
  if (!gzhContent.title) {
15
15
  console.error("未能找到文章标题");
16
16
  process.exit(1);
@@ -9,7 +9,7 @@ export async function renderCommand(inputContent, options) {
9
9
  }
10
10
  inputContent = await readStdin();
11
11
  }
12
- const gzhContent = await getGzhContent(inputContent, options["theme"], options["highlight"], options["macStyle"]);
12
+ const gzhContent = await getGzhContent(inputContent, options["theme"], options["highlight"], options["macStyle"], options["footnote"]);
13
13
  console.log(gzhContent.content);
14
14
  // process.exit(0);
15
15
  }
package/dist/index.js CHANGED
@@ -17,7 +17,10 @@ program
17
17
  .argument("[input-content]", "content of the input markdown file")
18
18
  .option("-t, --theme <theme-id>", "ID of the theme to use", "default")
19
19
  .option("-h, --highlight <highlight-theme-id>", "ID of the code highlight theme to use", "solarized-light")
20
- .option("-m, --mac-style", "display codeblock with mac style", true)
20
+ .option("--mac-style", "display codeblock with mac style", true)
21
+ .option("--no-mac-style", "disable mac style")
22
+ .option("--footnote", "convert link to footnote", true)
23
+ .option("--no-footnote", "disable footnote")
21
24
  .action(publishCommand);
22
25
  program
23
26
  .command("render")
@@ -25,6 +28,9 @@ program
25
28
  .argument("[input-content]", "content of the input markdown file")
26
29
  .option("-t, --theme <theme-id>", "ID of the theme to use", "default")
27
30
  .option("-h, --highlight <highlight-theme-id>", "ID of the code highlight theme to use", "solarized-light")
28
- .option("-m, --mac-style", "display codeblock with mac style", true)
31
+ .option("--mac-style", "display codeblock with mac style", true)
32
+ .option("--no-mac-style", "disable mac style")
33
+ .option("--footnote", "convert link to footnote", true)
34
+ .option("--no-footnote", "disable footnote")
29
35
  .action(renderCommand);
30
36
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenyan-md/cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
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",
@@ -32,7 +32,7 @@
32
32
  "url": "https://github.com/caol64/wenyan-cli/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@wenyan-md/core": "^1.0.2",
35
+ "@wenyan-md/core": "^1.0.8",
36
36
  "commander": "^14.0.0"
37
37
  },
38
38
  "devDependencies": {
@@ -44,7 +44,7 @@
44
44
  "scripts": {
45
45
  "build": "tsc",
46
46
  "dev": "tsx src/index.ts",
47
- "test:render": "cat test/publish.md | pnpm wenyan render",
48
- "test:publish": "cat test/publish.md | pnpm dotenv -e .env.test -- wenyan publish -t lapis"
47
+ "test:render": "pnpm build && cat test/publish.md | node ./bin/cli.js render",
48
+ "test:publish": "pnpm build && cat test/publish.md | pnpm dotenv -e .env.test -- node ./bin/cli.js publish -t lapis"
49
49
  }
50
50
  }