@chengzhao-dev/dsh-quarto-book 0.6.6 → 0.6.7
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.en.md
CHANGED
|
@@ -29,7 +29,7 @@ Both skills are discovered from the package's `skills/` directory and loaded on
|
|
|
29
29
|
2. Open a session in the book repository. `_quarto.yml` needs a standalone `type: book` line, and the book needs at least one `.qmd` or `.md` chapter source; only then do both skill names appear.
|
|
30
30
|
3. Call a skill: `writing-quarto` for prose, `designing-theme` for the theme.
|
|
31
31
|
|
|
32
|
-
Replace `--profile` with the profile you actually run. The desktop app always runs the `desktop` profile, and that profile is owned by the app, so `dsh --profile desktop` is rejected; install or upgrade with `dsh plugin --profile desktop add <package>`, and use the app's Settings → Plugins → Add plugin only if the app refuses that write. To pin a version, write `npm:@chengzhao-dev/dsh-quarto-book@0.6.
|
|
32
|
+
Replace `--profile` with the profile you actually run. The desktop app always runs the `desktop` profile, and that profile is owned by the app, so `dsh --profile desktop` is rejected; install or upgrade with `dsh plugin --profile desktop add <package>`, and use the app's Settings → Plugins → Add plugin only if the app refuses that write. To pin a version, write `npm:@chengzhao-dev/dsh-quarto-book@0.6.7`; to follow a GitHub tag, write `github:chengzhao-dev/dsh-quarto-book#v0.6.7`.
|
|
33
33
|
|
|
34
34
|
Upgrading from the old unscoped package `dsh-quarto-book` (removed from npm with 0.3.4, so this only affects profiles that installed it earlier): remove it from the same profile first with `dsh plugin --profile <profile> remove dsh-quarto-book`, then add the scoped package. Keeping both installed registers `writing-quarto` and `designing-theme` twice at the same rank 550.
|
|
35
35
|
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
2. 在书仓库里打开会话。`_quarto.yml` 要有独立一行的 `type: book`,书根至少有一个 `.qmd` 或 `.md` 章节源文件;两个技能名这时才会出现。
|
|
30
30
|
3. 调用技能:写正文用 `writing-quarto`,改主题用 `designing-theme`。
|
|
31
31
|
|
|
32
|
-
`--profile` 换成你实际运行的那个 profile。桌面应用固定跑 `desktop` profile,且该 profile 由应用独占管理,`dsh --profile desktop` 直接启动会被拒绝;安装或升级用 `dsh plugin --profile desktop add <包>`,应用拒绝写入时再走「设置 → 插件 → 添加插件」。需要固定版本时写 `npm:@chengzhao-dev/dsh-quarto-book@0.6.
|
|
32
|
+
`--profile` 换成你实际运行的那个 profile。桌面应用固定跑 `desktop` profile,且该 profile 由应用独占管理,`dsh --profile desktop` 直接启动会被拒绝;安装或升级用 `dsh plugin --profile desktop add <包>`,应用拒绝写入时再走「设置 → 插件 → 添加插件」。需要固定版本时写 `npm:@chengzhao-dev/dsh-quarto-book@0.6.7`,跟 GitHub 标签时写 `github:chengzhao-dev/dsh-quarto-book#v0.6.7`。
|
|
33
33
|
|
|
34
34
|
从旧的无作用域包 `dsh-quarto-book` 升级(该包已随 0.3.4 从 npm 删除,只影响之前装过它的 profile):先在同一个 profile 里 `dsh plugin --profile <profile> remove dsh-quarto-book`,再装新包。两个包同时留着会以相同的 rank 550 各注册一遍 `writing-quarto` 和 `designing-theme`。
|
|
35
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chengzhao-dev/dsh-quarto-book",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "把一份 Quarto Book 写成可读、可查、可发布的中文技术书:九步章节写作、结构/链接/图表检查、统一主题与渲染验收。 · Write, check, and publish a Chinese Quarto Book: nine-step chapter writing, structure/link/figure checks, a consistent theme, and render acceptance.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -7,33 +7,38 @@
|
|
|
7
7
|
扫读时表格被读成「另一类内容」。表头小一号但不加大写(中文表头 uppercase 无意义且显僵硬)。 */
|
|
8
8
|
font-size: 1rem;
|
|
9
9
|
border-collapse: collapse;
|
|
10
|
-
display:
|
|
10
|
+
/* 表格本体保持表格布局:display: table 才能让 tbl-colwidths 生效,
|
|
11
|
+
width: 100% 让表与代码块占满同一正文栏。横向滚动交给 .table-responsive。 */
|
|
12
|
+
display: table;
|
|
13
|
+
table-layout: fixed;
|
|
11
14
|
width: 100%;
|
|
12
15
|
max-width: 100%;
|
|
13
|
-
overflow-x: auto;
|
|
14
|
-
-webkit-overflow-scrolling: touch;
|
|
15
|
-
/* 列宽随内容分配:不写固定像素,长单元格换行,整表窄屏横向滚动。 */
|
|
16
|
-
table-layout: auto;
|
|
17
16
|
margin-block: 1.35rem 1.5rem;
|
|
18
17
|
border: none;
|
|
19
18
|
border-radius: 0;
|
|
20
19
|
font-variant-numeric: tabular-nums;
|
|
21
20
|
}
|
|
21
|
+
/* Quarto 的 .responsive 类把宽表包进这层:外层承担横向滚动。表体是 fixed + 100%
|
|
22
|
+
时不会溢出,滚动条永远不出现;包内因此改回按内容宽度排布,min-width 保证短表
|
|
23
|
+
仍占满正文栏,内容更宽时才真的滚动。 */
|
|
24
|
+
.table-responsive {
|
|
25
|
+
width: 100%;
|
|
26
|
+
overflow-x: auto;
|
|
27
|
+
-webkit-overflow-scrolling: touch;
|
|
28
|
+
}
|
|
29
|
+
.table-responsive > .table {
|
|
30
|
+
table-layout: auto;
|
|
31
|
+
width: max-content;
|
|
32
|
+
min-width: 100%;
|
|
33
|
+
}
|
|
22
34
|
.table > :not(caption) > * > * {
|
|
23
|
-
padding: 0.
|
|
35
|
+
padding: 0.625rem 1rem;
|
|
24
36
|
/* 多行单元格从顶部起排,同一行里短格子不被拉到垂直居中。 */
|
|
25
37
|
vertical-align: top;
|
|
26
38
|
/* 长 API 名与长句允许在格内折行,避免把整张表撑出内容列。 */
|
|
27
39
|
overflow-wrap: break-word;
|
|
28
40
|
border-bottom: 0;
|
|
29
41
|
}
|
|
30
|
-
/* 首尾列贴边,让表格与正文左缘对齐 */
|
|
31
|
-
.table > :not(caption) > * > :first-child {
|
|
32
|
-
padding-inline-start: 0;
|
|
33
|
-
}
|
|
34
|
-
.table > :not(caption) > * > :last-child {
|
|
35
|
-
padding-inline-end: 0;
|
|
36
|
-
}
|
|
37
42
|
.table thead th {
|
|
38
43
|
/* 表头用加粗与一道极浅底色标出层级;不套 .compact-table,列宽仍随内容。 */
|
|
39
44
|
background-color: color-mix(in srgb, var(--table-border) 24%, transparent);
|
|
@@ -41,9 +46,9 @@
|
|
|
41
46
|
/* 表头比表体小 1px(17px → 15px),层级靠字重、字号与底色,不靠更粗的线。 */
|
|
42
47
|
font-size: 0.9375rem;
|
|
43
48
|
line-height: 1.6;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
/* 表头是短标签,水平与垂直都居中;表体长句保持左对齐、顶对齐。 */
|
|
50
|
+
text-align: center;
|
|
51
|
+
vertical-align: middle;
|
|
47
52
|
border-top: 1px solid var(--table-border);
|
|
48
53
|
border-bottom: 1px solid var(--table-border);
|
|
49
54
|
}
|
|
@@ -52,26 +57,16 @@
|
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
/* 短对照表保持全宽左对齐(与正文同宽,不居中收窄);左对齐便于中文术语扫读。
|
|
55
|
-
|
|
60
|
+
宽表由 .table 默认规则负责,不要给多列/长单元格表套本类。 */
|
|
56
61
|
.compact-table {
|
|
57
|
-
overflow-x: auto;
|
|
58
|
-
}
|
|
59
|
-
.compact-table .table {
|
|
60
|
-
display: table;
|
|
61
62
|
width: 100%;
|
|
62
|
-
|
|
63
|
+
overflow-x: auto;
|
|
63
64
|
}
|
|
64
65
|
.compact-table .table th,
|
|
65
66
|
.compact-table .table td {
|
|
66
67
|
text-align: left;
|
|
67
68
|
padding-inline: 1.25rem;
|
|
68
69
|
}
|
|
69
|
-
.compact-table .table > :not(caption) > * > :first-child {
|
|
70
|
-
padding-inline-start: 0;
|
|
71
|
-
}
|
|
72
|
-
.compact-table .table > :not(caption) > * > :last-child {
|
|
73
|
-
padding-inline-end: 0;
|
|
74
|
-
}
|
|
75
70
|
|
|
76
71
|
/* 表题:Pandoc 输出 <caption>,Bootstrap 默认把它放表下(caption-side: bottom),
|
|
77
72
|
这里统一提到表上、左对齐,与图注一样小一号。 */
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
- **章节翻页**:一条顶线 + 左右两个文字链接,不用边框卡片;箭头用 `<` / `>`,hover 才转 `--accent`,下一页右对齐。箭头用字符而不用 SVG 是量过的:Bright 的 `<` `>` 墨迹中心在 0.23em,与同行西文同一轴,没有面包屑 `>` 那种偏高,换 SVG 反而要另配基线。
|
|
82
82
|
- **章节线**:标题不画线。全书只有一种横线——通栏 1px `--card-border` 发丝线,只出现在顶栏底边、引用块上下边、表格 booktabs、首页目录每行顶线、翻页顶线、页脚顶线、答案折叠线;`h2::after` 的 2.25rem 短发丝线已删除(连同首页 `.feature-grid` 例外),章节节奏只靠 H2 的 `margin-top: 3.25rem` 与字号台阶。约定改动时同步本节与 `css/base.css`。
|
|
83
83
|
- **引用块**:上下各一条 1px `--card-border` 横线、正文色、无底色、无左右竖条;与 Callout 的 2px 左色条区分开(后者是类型标记,不是分隔线)。
|
|
84
|
-
- **表格**:`display:
|
|
84
|
+
- **表格**:`display: table` + `table-layout: fixed` 吃 `tbl-colwidths`,`width: 100%` 让表与代码块占满同一正文栏;表头水平与垂直居中,表体左对齐、顶对齐,四边 padding 一致、首列不贴边。`display: block` 不行:外层块占 100%,里面的匿名表按内容收缩,表会变窄。宽表由 Quarto `.responsive` 类包成 `.table-responsive` 外层滚动容器;包内表改回 `table-layout: auto` + `width: max-content`,否则 fixed + 100% 永远不会溢出、滚动条是死的。不需要 JS 量列宽。表题走 `caption-side: top`、左对齐、14px `--text-secondary`;`table-striped` 压平成与普通行同底。
|
|
85
85
|
- **脚注**:区块顶部一条 1px `--card-border`、`margin-top: 3rem`、14px / lh 1.7、`--text-secondary`;回跳箭头随正文链接色。
|
|
86
86
|
- **任务列表**:`input[type=checkbox]` 用 `accent-color: var(--action-color)`,不用系统蓝。
|
|
87
87
|
- **图片**:正文图与坐标图圆角一律 `--radius-sm`(3px),不用 6px 大圆角;图注选择器同时覆盖 `figure figcaption`、`.quarto-float-caption`、`.figure-caption`(`lang: zh` 后 Quarto 生成「图 3.1: …」,`lang` 必须写在 `_quarto.yml`,否则图/表题回落英文 Figure/Table)。
|
|
@@ -27,11 +27,13 @@
|
|
|
27
27
|
| 接口 | 返回 | 边界 |
|
|
28
28
|
| --- | --- | --- |
|
|
29
29
|
| `GetCellType` | 坐标处的 `CellType` | 越界时抛出 `std::out_of_range` |
|
|
30
|
-
: {tbl-colwidths="[24,30,46]"}
|
|
30
|
+
: {.responsive tbl-colwidths="[24,30,46]"}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
比例按内容分配:名称与接口列 18–26,返回列 22–32,说明列 34–50,三项合计 100。三列以上时最长列不超过 55,避免其余列被挤成一条线。
|
|
34
|
-
-
|
|
34
|
+
- 表格与代码块同宽:主题用 `table-layout: fixed` 吃上面的比例,四边内边距一致,首列不贴边;表头在格内水平、垂直居中,表体左对齐、顶对齐。
|
|
35
|
+
- 宽表在表属性里加 `.responsive`(Quarto 内置类):Quarto 生成外层 `.table-responsive` 滚动容器,主题在该容器里改回按内容宽度排布,内容超过正文栏时才出现横向滚动。窄表可省。
|
|
36
|
+
- 不写固定宽度(`{width=...}`、`style="width:..."`),也不覆盖 `table-layout`;比例之外的几何由主题负责。
|
|
35
37
|
- 长单元格先改文案:删重复修饰,把条件与结果按「条件 + 结果」排成一句。仍长时允许格内折行,`overflow-wrap: break-word` 已由主题处理。
|
|
36
38
|
|
|
37
39
|
## 单元格
|
|
@@ -74,6 +76,6 @@
|
|
|
74
76
|
|
|
75
77
|
- [ ] 表前有导语、表后有一句结论,两句都不复述格子内容。
|
|
76
78
|
- [ ] 代码块、图、列表与表之间隔了一段正文。
|
|
77
|
-
- [ ] 表头没有手写加粗;列宽是相对比例,最长列不超过 55
|
|
79
|
+
- [ ] 表头没有手写加粗;列宽是相对比例,最长列不超过 55%;宽表加了 `.responsive`。
|
|
78
80
|
- [ ] 一格一个事实,没有「名词:说明」和手动空格对齐。
|
|
79
81
|
- [ ] 短表已改回句子或列表。
|