@chengzhao-dev/dsh-quarto-book 0.4.3 → 0.6.0

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.
Files changed (86) hide show
  1. package/README.en.md +3 -3
  2. package/README.md +3 -3
  3. package/lib/tools/render-check.js +5 -2
  4. package/package.json +5 -2
  5. package/skills/designing-theme/SKILL.md +3 -2
  6. package/skills/designing-theme/assets/theme/css/base.css +216 -55
  7. package/skills/designing-theme/assets/theme/css/callouts.css +32 -23
  8. package/skills/designing-theme/assets/theme/css/code.css +84 -2
  9. package/skills/designing-theme/assets/theme/css/content.css +152 -36
  10. package/skills/designing-theme/assets/theme/css/landing.css +175 -54
  11. package/skills/designing-theme/assets/theme/css/nav.css +462 -35
  12. package/skills/designing-theme/assets/theme/css/sidebar.css +76 -31
  13. package/skills/designing-theme/assets/theme/css/tokens.css +34 -16
  14. package/skills/designing-theme/assets/theme/includes/fonts.html +1 -1
  15. package/skills/designing-theme/assets/theme/includes/footer.html +16 -7
  16. package/skills/designing-theme/assets/theme/includes/palette.html +420 -0
  17. package/skills/designing-theme/assets/theme/palettes/flexoki/brand-mark.svg +3 -0
  18. package/skills/designing-theme/assets/theme/palettes/flexoki/favicon-dark.svg +5 -0
  19. package/skills/designing-theme/assets/theme/palettes/flexoki/favicon-light.svg +5 -0
  20. package/skills/designing-theme/assets/theme/palettes/flexoki/highlight-dark.theme +214 -0
  21. package/skills/designing-theme/assets/theme/palettes/flexoki/highlight-light.theme +214 -0
  22. package/skills/designing-theme/assets/theme/palettes/flexoki/meta.md +53 -0
  23. package/skills/designing-theme/assets/theme/palettes/flexoki/theme-dark.scss +43 -0
  24. package/skills/designing-theme/assets/theme/palettes/flexoki/theme-light.scss +40 -0
  25. package/skills/designing-theme/assets/theme/palettes/flexoki/tokens.css +156 -0
  26. package/skills/designing-theme/assets/theme/palettes/hill-light/brand-mark.svg +3 -0
  27. package/skills/designing-theme/assets/theme/palettes/hill-light/favicon-dark.svg +5 -0
  28. package/skills/designing-theme/assets/theme/palettes/hill-light/favicon-light.svg +5 -0
  29. package/skills/designing-theme/assets/theme/palettes/hill-light/meta.md +78 -0
  30. package/skills/designing-theme/assets/theme/palettes/hill-light/syntax.css +150 -0
  31. package/skills/designing-theme/assets/theme/palettes/hill-light/tokens.css +322 -0
  32. package/skills/designing-theme/assets/theme/palettes/solarized/brand-mark.svg +3 -0
  33. package/skills/designing-theme/assets/theme/palettes/solarized/favicon-dark.svg +5 -0
  34. package/skills/designing-theme/assets/theme/palettes/solarized/favicon-light.svg +5 -0
  35. package/skills/designing-theme/assets/theme/palettes/solarized/highlight-dark.theme +214 -0
  36. package/skills/designing-theme/assets/theme/palettes/solarized/highlight-light.theme +214 -0
  37. package/skills/designing-theme/assets/theme/palettes/solarized/meta.md +66 -0
  38. package/skills/designing-theme/assets/theme/palettes/solarized/syntax.css +67 -0
  39. package/skills/designing-theme/assets/theme/palettes/solarized/theme-dark.scss +43 -0
  40. package/skills/designing-theme/assets/theme/palettes/solarized/theme-light.scss +41 -0
  41. package/skills/designing-theme/assets/theme/palettes/solarized/tokens.css +154 -0
  42. package/skills/designing-theme/knowledge/reading-surface.md +27 -15
  43. package/skills/designing-theme/references/theme-spine.md +2 -2
  44. package/skills/designing-theme/references/theme-system.md +82 -36
  45. package/skills/designing-theme/scripts/checking-layout.py +306 -48
  46. package/skills/designing-theme/scripts/measuring-pages.mjs +40 -3
  47. package/skills/writing-quarto/examples/01-language-scope.md +3 -3
  48. package/skills/writing-quarto/examples/02-structure-shape.md +5 -5
  49. package/skills/writing-quarto/examples/03-block-after.md +2 -2
  50. package/skills/writing-quarto/examples/03-excerpt-lead.md +6 -6
  51. package/skills/writing-quarto/examples/03-layout-list.md +15 -15
  52. package/skills/writing-quarto/examples/03-qmd-elements.md +4 -4
  53. package/skills/writing-quarto/examples/04-paragraph-cases.md +5 -5
  54. package/skills/writing-quarto/examples/04-paragraph-opening.md +3 -3
  55. package/skills/writing-quarto/examples/05-sentence-brevity.md +5 -5
  56. package/skills/writing-quarto/examples/05-sentence-frame.md +6 -6
  57. package/skills/writing-quarto/examples/05-sentence-reference.md +5 -5
  58. package/skills/writing-quarto/examples/06-wording-cases.md +8 -8
  59. package/skills/writing-quarto/examples/08-appendix.md +4 -4
  60. package/skills/writing-quarto/quarto/basics.md +24 -2
  61. package/skills/writing-quarto/quarto/comments.md +43 -0
  62. package/skills/writing-quarto/quarto/coords.md +4 -4
  63. package/skills/writing-quarto/quarto/encoding.md +35 -0
  64. package/skills/writing-quarto/quarto/mermaid.md +1 -1
  65. package/skills/writing-quarto/quarto/prose.md +86 -0
  66. package/skills/writing-quarto/quarto/render.md +17 -16
  67. package/skills/writing-quarto/quarto/terminal.md +3 -3
  68. package/skills/writing-quarto/scripts/checking-dom.py +20 -8
  69. package/skills/writing-quarto/scripts/verifying-content.py +12 -3
  70. package/skills/writing-quarto/steps/01-task.md +6 -6
  71. package/skills/writing-quarto/steps/02-structure.md +19 -19
  72. package/skills/writing-quarto/steps/03-blocks.md +40 -40
  73. package/skills/writing-quarto/steps/04-paragraphs.md +55 -55
  74. package/skills/writing-quarto/steps/05-sentences.md +42 -43
  75. package/skills/writing-quarto/steps/06-wording.md +9 -11
  76. package/skills/writing-quarto/steps/07-layout.md +21 -17
  77. package/skills/writing-quarto/steps/08-reread.md +9 -13
  78. package/templates/quarto-book-project/SKILL.md +1 -1
  79. package/skills/designing-theme/assets/theme/assets/brand-mark.svg +0 -4
  80. package/skills/designing-theme/assets/theme/assets/favicon.svg +0 -9
  81. package/skills/designing-theme/assets/theme/palettes/github/highlight-dark.theme +0 -213
  82. package/skills/designing-theme/assets/theme/palettes/github/highlight-light.theme +0 -213
  83. package/skills/designing-theme/assets/theme/palettes/github/meta.md +0 -38
  84. package/skills/designing-theme/assets/theme/palettes/github/theme-dark.scss +0 -35
  85. package/skills/designing-theme/assets/theme/palettes/github/theme-light.scss +0 -34
  86. package/skills/designing-theme/assets/theme/palettes/github/tokens.css +0 -160
@@ -1,61 +1,132 @@
1
- /* dsh-quarto-book Quarto 主题 · 首页落地页(Hero / 卡片网格;自 common.css 拆分) */
1
+ /* dsh-quarto-book Quarto 主题 · 首页落地页(Hero / 目录网格;书籍式编辑排版) */
2
2
 
3
- /* ---------- 首页落地页:Hero + 功能卡片 ---------- */
3
+ /* ---------- 首页落地页:Hero + 目录 ---------- */
4
4
  /* Hero 复用 #title-block-header(h1 + description 副标题)
5
5
  —— 间距控制点(关键):
6
6
  · 标题→描述:本规则 margin-top
7
7
  注意:Bootstrap 自带 #title-block-header.quarto-title-block.default .description { margin-top:0 }
8
8
  (特异性 1,3,0)会压过低特异性 #title-block-header .description(1,1,0),
9
- 故此处必须用【同等特异性】选择器才能生效;否则改 margin-top 一律无效(之前 20rem 不生效即此因)。
10
- · 描述→hero 卡片:本规则 margin-bottom(与 .feature-grid margin-top 折叠取大值,须同步改才生效) */
9
+ 故此处必须用【同等特异性】选择器才能生效。
10
+ · 描述→目录网格:本规则 margin-bottom(与 .feature-grid margin-top 折叠取大值,须同步改才生效) */
11
11
  #title-block-header.quarto-title-block.default .description {
12
12
  font-size: 1.125rem;
13
13
  text-align: left; /* 与左对齐标题一致(覆盖默认 theme 居中) */
14
- margin-top: 1.5rem; /* 标题→描述:空一行(gitcn hero mt-3 放宽) */
15
- margin-bottom: 0.6rem; /* 描述→卡片:收紧(须与 .feature-grid 顶边距同步改) */
14
+ margin-top: 1.5rem; /* 标题→描述:留一行 */
15
+ margin-bottom: 0.6rem; /* 描述→目录:收紧 */
16
16
  }
17
17
  .feature-grid {
18
18
  display: grid;
19
- /* 桌面端固定两列;单卡也保留半行宽度,与双卡保持一致。
20
- 半行宽度沿用 calc((100% - 1.25rem) / 2) 的既有布局契约。 */
21
- grid-template-columns: repeat(2, minmax(0, calc((100% - 1.25rem) / 2)));
22
- gap: 1.25rem; /* 卡片间距对齐 gitcn(~20px) */
23
- margin: 0.6rem 0 1rem; /* 顶部 0.9rem → 0.6rem,与描述下边距折叠后整体 0.6rem */
19
+ /* 两栏目录;栏距比卡片内边距宽一档,让两栏的文本列互不干扰 */
20
+ grid-template-columns: repeat(2, minmax(0, 1fr));
21
+ gap: 0 2.5rem;
22
+ margin: 0.9rem 0 1.5rem;
23
+ counter-reset: landing-card;
24
24
  }
25
- /* 首页各分组(## 准备 / ## 语言核心)下方引导段:灰字小一号,对齐 gitcn 分组描述;
25
+ /* 只有一张卡(当前游戏)时占满整行,右侧不再留半行空白;
26
+ 多卡(后续棋类)仍按两栏目录排。 */
27
+ .feature-grid:has(> .landing-card:only-child) {
28
+ grid-template-columns: 1fr;
29
+ }
30
+ /* 单张「当前游戏」是首页的主目录条目:把序号放大成版式锚点,
31
+ 标题、提要列在中间,动作留在右下,避免整行只有左侧一小段文字。 */
32
+ .feature-grid:has(> .landing-card:only-child) .landing-card {
33
+ grid-template-columns: 3rem minmax(0, 1fr) auto;
34
+ grid-template-areas:
35
+ "index title cta"
36
+ "index desc cta";
37
+ column-gap: 1.25rem;
38
+ row-gap: 0.45rem;
39
+ padding: 1.35rem 0 1.5rem;
40
+ }
41
+ .feature-grid:has(> .landing-card:only-child) .landing-card::before {
42
+ font-size: 1.75rem;
43
+ letter-spacing: 0;
44
+ line-height: 1;
45
+ padding-top: 0.15rem;
46
+ opacity: 1;
47
+ }
48
+ .feature-grid:has(> .landing-card:only-child) .landing-card h3 {
49
+ font-size: 1.375rem;
50
+ }
51
+ .feature-grid:has(> .landing-card:only-child) .landing-card p {
52
+ font-size: 1rem;
53
+ max-width: 46ch;
54
+ }
55
+ /* 首页各分组(## 准备 / ## 语言核心)下方引导段:灰字小一号;
26
56
  作用域限定首页(:has(.hero-eyebrow)),内容页引言保持正文色不受影响 */
27
57
  #quarto-document-content:has(.hero-eyebrow) section.level2 > p:first-of-type {
28
58
  color: var(--text-secondary);
29
59
  font-size: 0.9375rem;
30
- line-height: 1.5;
31
- margin: 0 0 1.25rem;
60
+ line-height: 1.6;
61
+ margin: 0 0 1rem;
32
62
  }
33
- /* 首页专用卡片(与正文内容完全隔离的组件,高特异性确保标题加粗+描述灰必生效) */
63
+ /* 首页目录条目:书页目录的一行。
64
+ 左侧是序号、标题、提要,右侧是动作;顶线分隔,不画卡片底色。 */
34
65
  .landing-card {
35
- display: block;
36
- background: var(--card-bg);
37
- border: 1px solid var(--card-border);
38
- border-radius: var(--radius-lg);
39
- padding: 1.35rem 1.5rem;
66
+ display: grid;
67
+ grid-template-columns: minmax(0, 1fr) auto;
68
+ grid-template-areas:
69
+ "index index"
70
+ "title cta"
71
+ "desc cta";
72
+ column-gap: 2rem;
73
+ row-gap: 0.35rem;
74
+ align-items: start;
75
+ background: transparent;
76
+ border: 0;
77
+ border-top: 1px solid var(--card-border);
78
+ border-radius: 0;
79
+ padding: 1.1rem 0 1.35rem;
40
80
  transition: var(--transition);
41
- min-height: 100%; /* 两卡并排时等高,避免短卡显得挤 */
81
+ min-height: 0;
42
82
  box-sizing: border-box;
43
83
  }
84
+ /* 目录序号:小号等宽数字,像纸书目录前的 01/02 */
85
+ .landing-card::before {
86
+ counter-increment: landing-card;
87
+ content: counter(landing-card, decimal-leading-zero);
88
+ grid-area: index;
89
+ font-family: var(--mono-font);
90
+ font-size: 1.25rem;
91
+ letter-spacing: 0;
92
+ line-height: 1.1;
93
+ padding-top: 0.1rem;
94
+ color: var(--text-secondary);
95
+ opacity: 1;
96
+ }
97
+ /* 悬停只改顶线,不做位移或阴影:目录保持纸书版式,避免点击时整块跳动。 */
44
98
  .landing-card:hover {
45
- border-color: var(--card-hover-border);
46
- background-color: var(--surface-raised);
47
- box-shadow: var(--card-shadow);
99
+ border-top-color: var(--accent);
100
+ background-color: transparent;
101
+ box-shadow: none;
48
102
  }
49
- .landing-card:focus-within {
50
- border-color: var(--accent);
103
+ /* 键盘焦点进入卡片时,顶线转成 accent 作整行提示。
104
+ 焦点框只画在真正获得焦点的链接上,不再用 :focus-within 套住整张卡片;
105
+ 鼠标点击不会命中 :focus-visible,因此不会弹出大框。 */
106
+ .landing-card:has(a:focus-visible) {
107
+ border-top-color: var(--accent);
108
+ }
109
+ #quarto-document-content .landing-card h3 a:focus-visible,
110
+ #quarto-document-content .landing-card a.cta:focus-visible {
51
111
  outline: 2px solid var(--accent);
52
- outline-offset: 2px;
112
+ outline-offset: 3px;
113
+ border-radius: 2px;
114
+ }
115
+ #quarto-document-content .landing-card h3 a:focus-visible {
116
+ text-decoration: underline;
117
+ text-decoration-color: var(--accent);
118
+ text-underline-offset: 0.2em;
119
+ }
120
+ @media (prefers-reduced-motion: reduce) {
121
+ .landing-card {
122
+ transition: none;
123
+ }
53
124
  }
54
125
  #quarto-document-content .landing-card h3 {
126
+ grid-area: title;
55
127
  margin-top: 0;
56
- margin-bottom: 0.5rem;
128
+ margin-bottom: 0;
57
129
  font-size: 1.0625rem;
58
- /* 单字面字体 + font-synthesis: none 下 600 不会变粗;卡片标题靠字号与边框区分 */
59
130
  color: var(--body-color);
60
131
  }
61
132
  #quarto-document-content .landing-card h3 a {
@@ -64,19 +135,41 @@
64
135
  text-decoration: none;
65
136
  }
66
137
  .landing-card h3 a:hover {
67
- color: var(--accent);
68
- text-decoration: none;
138
+ color: var(--link-hover-color);
139
+ text-decoration: underline;
140
+ text-decoration-color: var(--link-hover-color);
141
+ text-underline-offset: 0.2em;
142
+ }
143
+ .landing-card a:active {
144
+ opacity: 0.75;
69
145
  }
70
146
  #quarto-document-content .landing-card p {
147
+ grid-area: desc;
148
+ max-width: 54ch;
71
149
  margin-bottom: 0;
72
- color: var(--text-secondary); /* 描述灰字(对齐 gitcn) */
150
+ color: var(--text-secondary);
73
151
  font-size: 0.9375rem;
74
- line-height: 1.5;
152
+ line-height: 1.7;
153
+ }
154
+ /* Pandoc 会把 `[进入井字棋 →]{.cta}` 包进 <p>;网格项因此是段落而不是链接。
155
+ 把带 .cta 的段落放到 cta 区,链接本体再恢复字号。 */
156
+ #quarto-document-content .landing-card p:has(> a.cta) {
157
+ grid-area: cta;
158
+ align-self: end;
159
+ justify-self: end;
160
+ max-width: none;
161
+ margin: 0;
162
+ font-size: 0;
163
+ line-height: 1;
75
164
  }
76
- /* 未撰写章节:弱化 + "规划中" 角标 */
165
+ #quarto-document-content .landing-card p:has(> a.cta) > a.cta {
166
+ font-size: 0.8125rem;
167
+ }
168
+ /* 未撰写章节:弱化 + "规划中" 文字标记 */
77
169
  .landing-card.coming-soon {
78
- background-color: var(--surface-raised);
79
- border-color: var(--card-border);
170
+ background-color: transparent;
171
+ border-top-color: var(--card-border);
172
+ opacity: 0.7;
80
173
  }
81
174
  .landing-card.coming-soon h3,
82
175
  .landing-card.coming-soon h3 a,
@@ -86,34 +179,38 @@
86
179
  }
87
180
  .landing-card.coming-soon::after {
88
181
  content: "规划中";
89
- display: inline-block;
90
- margin-top: 0.7rem;
91
- font-size: 0.72rem;
182
+ grid-area: cta;
183
+ align-self: end;
184
+ justify-self: end;
185
+ font-size: 0.6875rem;
186
+ letter-spacing: 0.08em;
92
187
  color: var(--text-secondary);
93
- border: 1px solid var(--card-border);
94
- border-radius: 6px;
95
- padding: 0.05rem 0.55rem;
96
188
  }
97
189
 
98
- /* 主题卡 CTA:对齐 gitcn 的「开始学习 →」蓝链;块级 + 上留白,确保与描述分行 */
190
+ /* 目录 CTA:条目右下的动作,墨色下划线,hover 才转 accent */
99
191
  #quarto-document-content .landing-card a.cta {
100
- display: block;
101
- margin-top: 0.75rem;
102
- font-size: 0.875rem;
103
- font-weight: 600;
192
+ grid-area: cta;
193
+ align-self: end;
194
+ justify-self: end;
195
+ display: inline-block;
196
+ margin-top: 0;
197
+ font-size: 0.8125rem;
198
+ font-weight: 500;
199
+ white-space: nowrap;
104
200
  color: var(--link-color);
105
- text-decoration: none;
106
- }
107
- .landing-card a.cta:hover {
108
201
  text-decoration: underline;
109
202
  text-decoration-color: var(--link-underline);
110
- text-underline-offset: 0.2em;
203
+ text-underline-offset: 0.18em;
204
+ }
205
+ .landing-card a.cta:hover {
206
+ color: var(--link-hover-color);
207
+ text-decoration-color: var(--action-color);
111
208
  }
112
209
  /* 落地页分组标题与卡片的间距节奏
113
210
  Quarto 把 h2 包进 section.level2,不能用「主容器直属 h2」选择器 */
114
211
  #quarto-document-content > h2 + .feature-grid,
115
212
  #quarto-document-content section.level2 > h2 + .feature-grid {
116
- margin-top: 0.4rem;
213
+ margin-top: 0.9rem;
117
214
  }
118
215
  /* 分组引导段(h2 下首段)与卡片网格:略收紧,避免两卡一行时上下空档过大 */
119
216
  #quarto-document-content section.level2 > p:first-of-type + .feature-grid {
@@ -173,10 +270,34 @@ body.homepage .landing-card,
173
270
  gap: 1rem;
174
271
  }
175
272
  .landing-card {
176
- padding: 1.1rem 1.15rem;
273
+ padding: 1rem 0 1.25rem;
274
+ }
275
+ /* 窄屏单卡:动作挪到提要下方,提要不再被右侧 CTA 挤成一条窄栏 */
276
+ .feature-grid:has(> .landing-card:only-child) .landing-card {
277
+ grid-template-columns: 2.5rem minmax(0, 1fr);
278
+ grid-template-areas:
279
+ "index title"
280
+ "index desc"
281
+ "index cta";
282
+ column-gap: 1rem;
283
+ row-gap: 0.4rem;
284
+ }
285
+ .feature-grid:has(> .landing-card:only-child) .landing-card::before {
286
+ font-size: 1.5rem;
287
+ padding-top: 0.1rem;
288
+ }
289
+ .feature-grid:has(> .landing-card:only-child) .landing-card h3 {
290
+ font-size: 1.25rem;
291
+ }
292
+ .feature-grid:has(> .landing-card:only-child) .landing-card p {
293
+ font-size: 0.9375rem;
294
+ max-width: none;
295
+ }
296
+ .feature-grid:has(> .landing-card:only-child) .landing-card p:has(> a.cta) {
297
+ justify-self: end;
177
298
  }
178
299
  }
179
300
  body.homepage .landing-card h3 a,
180
301
  #quarto-document-content:has(> #title-block-header:first-child + .feature-grid) .landing-card h3 a {
181
- color: var(--body-color); /* 卡片标题非蓝链,与 hero 配色统一 */
302
+ color: var(--body-color); /* 目录标题不是动作色,与 hero 配色统一 */
182
303
  }