@jiyeqian/md2pdf 1.7.3 → 1.7.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/README.md CHANGED
@@ -52,7 +52,8 @@ md2pdf 文件名.md --theme minimal --toc
52
52
  | `--no-meta` / `--no-lead` | 不要元信息条 / 首段不作为导语 |
53
53
  | `-t, --toc` | 文首插入目录页(取自 H2),条目可点击跳转 |
54
54
  | `--no-outline` | 不生成 PDF 书签(默认生成) |
55
- | `--bibliography [footnote\|bib]` | 将脚注收集为「参考文献」章节(默认 `footnote`;`bib` 为未来支持) |
55
+ | `--bibliography [footnote\|bib]` | 参考文献模式,**默认启用**(`footnote`,不加参数也生效);`bib` 为未来支持 |
56
+ | `--no-bibliography` | 关闭参考文献模式(脚注作为普通脚注) |
56
57
  | `--numbering <mode>` | 章节编号:`auto`(默认,识别到已有编号则不动)| `force`(强制)| `none`(不加) |
57
58
  | `--link-urls` | 正文链接后附 URL(纸质可读) |
58
59
  | `--landscape` / `--font-size <pt>` / `--margin <mm>` | 横向 / 字号(默认 10.5)/ 页边距(默认 20) |
@@ -82,7 +83,7 @@ node ci/inspect-pdf.mjs out.pdf
82
83
  - YAML frontmatter 的 `name` / `description` 生成元信息条;「适用于…/不用于…」自动拆两栏。
83
84
  - H2 自动分节加色块;表格深色表头+隔行浅底;有序列表圆形序号。
84
85
  - 数学公式:`$...$`(行内)与 `$$...$$`(独立成行)由内置 MathJax 渲染。
85
- - 脚注:`[^id]` 引用 + `[^id]: 内容` 定义;BibTeX 脚注(`@article{...}` 等)按 GB/T 7714-2025 著录,`--bibliography` 收集为「参考文献」章节。
86
+ - 脚注:`[^id]` 引用 + `[^id]: 内容` 定义;BibTeX 脚注(`@article{...}` 等)按 GB/T 7714-2025 著录,默认收集为「参考文献」章节(`--no-bibliography` 关闭)。
86
87
  - 相对路径图片自动解析进 PDF。
87
88
 
88
89
  改样式:`assets/base.css`(骨架)与 `assets/theme-*.css`(配色),改完重跑命令即生效。
package/assets/base.css CHANGED
@@ -52,6 +52,7 @@ h1 {
52
52
  margin: 0 0 12px;
53
53
  line-height: 1.25;
54
54
  letter-spacing: 0;
55
+ text-align: center;
55
56
  }
56
57
 
57
58
  .lead {
@@ -155,18 +156,18 @@ tbody td:first-child { font-weight: 600; color: var(--ink); }
155
156
  /* ---------- 列表 ---------- */
156
157
  ol, ul { margin: 0 0 14px; padding-left: 0; }
157
158
  ol { list-style: none; counter-reset: step; }
158
- ol li { position: relative; padding-left: 30px; margin-bottom: 11px; text-align: justify; }
159
- ol li:last-child { margin-bottom: 0; }
160
- ol li::before {
159
+ ol > li { position: relative; padding-left: 30px; margin-bottom: 11px; text-align: justify; }
160
+ ol > li:last-child { margin-bottom: 0; }
161
+ ol > li::before {
161
162
  counter-increment: step; content: counter(step);
162
163
  position: absolute; left: 0; top: .28em;
163
164
  width: 1.55em; height: 1.55em; line-height: 1.55em; text-align: center;
164
165
  font-family: var(--font-mono); font-size: .82em; font-weight: 700;
165
166
  }
166
167
  ul { list-style: none; }
167
- ul li { position: relative; padding-left: 18px; margin-bottom: 11px; text-align: justify; }
168
- ul li:last-child { margin-bottom: 0; }
169
- ul li::before {
168
+ ul > li { position: relative; padding-left: 18px; margin-bottom: 11px; text-align: justify; }
169
+ ul > li:last-child { margin-bottom: 0; }
170
+ ul > li::before {
170
171
  content: ""; position: absolute; left: 2px; top: .82em;
171
172
  width: 5px; height: 5px; border-radius: 50%;
172
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiyeqian/md2pdf",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "把 Markdown 排成优雅的中文 A4 PDF(无头 Chrome 渲染,带报头、表格/代码排版与页脚页码)",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -47,7 +47,7 @@ npm install -g @jiyeqian/md2pdf
47
47
  | `--no-meta` / `--no-lead` | 去掉元信息条 / 首段不作为导语 |
48
48
  | `-t, --toc` | 文首插入目录页(取自 H2),条目可点击跳转 |
49
49
  | `--no-outline` | 不生成 PDF 书签(默认生成) |
50
- | `--bibliography [footnote\|bib]` | 将脚注收集为「参考文献」章节(默认 footnotebib 为未来支持) |
50
+ | `--bibliography [footnote\|bib]` | 参考文献模式,默认启用(footnote);bib 为未来支持。`--no-bibliography` 关闭 |
51
51
  | `--numbering <mode>` | 章节编号:auto(默认)| force(强制)| none(不加) |
52
52
  | `--link-urls` | 链接后附 URL |
53
53
  | `--landscape` / `--font-size` / `--margin` | 横向 / 字号(默认 10.5pt)/ 页边距(默认 20mm) |
package/src/md2pdf.mjs CHANGED
@@ -40,7 +40,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
40
40
  const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
41
41
  const ASSETS = path.join(ROOT, 'assets');
42
42
 
43
- const VERSION = '1.7.3';
43
+ const VERSION = '1.7.4';
44
44
 
45
45
  // Node ≥ 22 有全局 WebSocket;更老的版本退回到内置的极简实现
46
46
  let _WS;
@@ -109,7 +109,7 @@ function parseArgs(argv) {
109
109
  inputs: [], theme: 'elegant', fontSize: 10.5,
110
110
  marginTop: 20, marginSide: 18, marginBottom: 18,
111
111
  footer: true, footerLeft: '', footerRight: '',
112
- meta: true, lead: true, toc: false, linkUrls: false, outline: true, bibliography: false,
112
+ meta: true, lead: true, toc: false, linkUrls: false, outline: true, bibliography: 'footnote',
113
113
  numbering: 'auto',
114
114
  landscape: false, keepHtml: false, htmlOnly: false, open: false, help: false,
115
115
  };