@open-press/cli 0.5.0 → 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 (34) hide show
  1. package/dist/cli.js +114 -23
  2. package/package.json +1 -1
  3. package/template/core/CHANGELOG.md +33 -3
  4. package/template/core/package.json +1 -1
  5. package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +21 -0
  6. package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +30 -0
  7. package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +29 -0
  8. package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +12 -0
  9. package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +27 -0
  10. package/template/packs/academic-paper/document/components/ChapterOpenerVisual/index.tsx +76 -0
  11. package/template/packs/academic-paper/document/components/Page.tsx +27 -0
  12. package/template/packs/academic-paper/document/components/TokenSwatchGrid/index.tsx +46 -0
  13. package/template/packs/academic-paper/document/components/TokenSwatchGrid/style.css +63 -0
  14. package/template/packs/academic-paper/document/components/TypeSpecimen/index.tsx +38 -0
  15. package/template/packs/academic-paper/document/components/TypeSpecimen/style.css +111 -0
  16. package/template/packs/academic-paper/document/design.md +279 -0
  17. package/template/packs/academic-paper/document/index.tsx +107 -0
  18. package/template/packs/academic-paper/document/media/README.md +13 -0
  19. package/template/packs/academic-paper/document/openpress.config.mjs +26 -0
  20. package/template/packs/academic-paper/document/theme/README.md +11 -0
  21. package/template/packs/academic-paper/document/theme/base/page-contract.css +505 -0
  22. package/template/packs/academic-paper/document/theme/base/print.css +93 -0
  23. package/template/packs/academic-paper/document/theme/base/typography.css +336 -0
  24. package/template/packs/academic-paper/document/theme/fonts.css +3 -0
  25. package/template/packs/academic-paper/document/theme/page-surfaces/back-cover.css +43 -0
  26. package/template/packs/academic-paper/document/theme/page-surfaces/chapter-opener.css +205 -0
  27. package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +267 -0
  28. package/template/packs/academic-paper/document/theme/page-surfaces/toc.css +139 -0
  29. package/template/packs/academic-paper/document/theme/patterns/_chart-frame.css +49 -0
  30. package/template/packs/academic-paper/document/theme/patterns/figure-grid.css +68 -0
  31. package/template/packs/academic-paper/document/theme/patterns/table-utilities.css +66 -0
  32. package/template/packs/academic-paper/document/theme/shell/reader-controls.css +761 -0
  33. package/template/packs/academic-paper/document/theme/tokens.css +80 -0
  34. package/template/packs/academic-paper/openpress.config.mjs +5 -0
@@ -0,0 +1,267 @@
1
+ /* page-surfaces / cover
2
+ * Cover and back-cover share most of their layout chrome (meta header, byline
3
+ * footer, central main column). Shared selectors live here so cover is the
4
+ * primary reference; back-cover.css only refines the parts that differ.
5
+ */
6
+
7
+ .reader-page--cover,
8
+ .reader-page--back-cover {
9
+ background: var(--openpress-color-document);
10
+ padding: clamp(28px, 5cqw, 48px) clamp(24px, 4.5cqw, 42px);
11
+ flex-direction: column;
12
+ justify-content: space-between;
13
+ gap: clamp(16px, 2.5cqw, 24px);
14
+ }
15
+
16
+ .reader-app.is-ready .reader-page--cover,
17
+ .reader-app.is-ready .reader-page--back-cover,
18
+ .reader-page--cover.is-active,
19
+ .reader-page--back-cover.is-active {
20
+ display: flex;
21
+ }
22
+
23
+ .cover-meta,
24
+ .back-cover-meta {
25
+ display: flex;
26
+ justify-content: space-between;
27
+ align-items: flex-start;
28
+ gap: var(--openpress-space-3);
29
+ padding-bottom: var(--openpress-space-2);
30
+ border-bottom: 1px solid var(--openpress-color-ink);
31
+ font-family: var(--openpress-font-body);
32
+ font-size: clamp(8pt, 1.25cqw, 9.5pt);
33
+ color: var(--openpress-color-muted);
34
+ letter-spacing: 0.12em;
35
+ flex-shrink: 0;
36
+ }
37
+
38
+ .mihua-logo,
39
+ .openpress-logo {
40
+ display: block;
41
+ width: clamp(112px, 18cqw, 154px);
42
+ height: auto;
43
+ flex-shrink: 0;
44
+ object-fit: contain;
45
+ }
46
+
47
+ .cover-meta-title {
48
+ margin-left: auto;
49
+ max-width: 48%;
50
+ padding-top: 0.35em;
51
+ text-align: right;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .cover-main,
56
+ .back-cover-main {
57
+ display: flex;
58
+ flex-direction: column;
59
+ flex: 1;
60
+ min-height: 0;
61
+ }
62
+
63
+ .cover-title {
64
+ margin: 0;
65
+ font-family: var(--openpress-font-serif);
66
+ font-size: clamp(36px, 8.5cqw, 64px);
67
+ font-weight: 300;
68
+ line-height: 1;
69
+ letter-spacing: 0.01em;
70
+ color: var(--openpress-color-ink);
71
+ }
72
+
73
+ .cover-tagline {
74
+ margin: var(--openpress-space-2) 0 0;
75
+ font-family: var(--openpress-font-serif);
76
+ font-size: clamp(14px, 2.4cqw, 20px);
77
+ font-weight: 300;
78
+ letter-spacing: 0.08em;
79
+ color: var(--openpress-color-muted);
80
+ }
81
+
82
+ .cover-rule,
83
+ .back-cover-rule {
84
+ height: 1px;
85
+ width: 40px;
86
+ background: var(--openpress-color-ink);
87
+ margin: var(--openpress-space-3) 0;
88
+ }
89
+
90
+ .cover-subtitle {
91
+ margin: 0;
92
+ font-family: var(--openpress-font-body);
93
+ font-size: clamp(10.5pt, 1.85cqw, 12.5pt);
94
+ font-weight: 400;
95
+ letter-spacing: 0.02em;
96
+ line-height: 1.55;
97
+ color: var(--openpress-color-ink);
98
+ }
99
+
100
+ .cover-summary {
101
+ margin: var(--openpress-space-2) 0 0;
102
+ font-family: var(--openpress-font-body);
103
+ font-size: clamp(9pt, 1.65cqw, 10pt);
104
+ line-height: 1.8;
105
+ color: var(--openpress-color-muted);
106
+ max-width: 90%;
107
+ }
108
+
109
+ .cover-visual,
110
+ .back-cover-visual {
111
+ margin: var(--openpress-space-3) 0 0;
112
+ flex-shrink: 0;
113
+ }
114
+
115
+ .cover-visual img,
116
+ .back-cover-visual img {
117
+ display: block;
118
+ width: 100%;
119
+ height: auto;
120
+ max-height: 22cqh;
121
+ object-fit: cover;
122
+ border: 0;
123
+ padding: 0;
124
+ background: transparent;
125
+ }
126
+
127
+ .cover-byline,
128
+ .back-cover-byline {
129
+ display: flex;
130
+ justify-content: space-between;
131
+ align-items: baseline;
132
+ padding-top: var(--openpress-space-2);
133
+ border-top: 1px solid var(--openpress-color-ink);
134
+ font-family: var(--openpress-font-body);
135
+ font-size: clamp(8pt, 1.25cqw, 9.5pt);
136
+ color: var(--openpress-color-muted);
137
+ letter-spacing: 0.12em;
138
+ flex-shrink: 0;
139
+ }
140
+
141
+ .cover-byline span:first-child,
142
+ .back-cover-byline span:first-child {
143
+ font-family: var(--openpress-font-serif);
144
+ font-weight: 400;
145
+ letter-spacing: 0.04em;
146
+ color: var(--openpress-color-ink);
147
+ }
148
+
149
+ /* ─ academic-paper title block ──────────────────────────────────────────── */
150
+ /* IEEE-style title page: large serif title, optional subtitle, 3-column */
151
+ /* author grid, abstract band, index terms band. Single-column body picks */
152
+ /* up after this surface. Two-column body arrives with the v0.8 paged.js */
153
+ /* migration. */
154
+
155
+ .paper-cover {
156
+ display: flex;
157
+ flex-direction: column;
158
+ gap: clamp(18px, 2.4cqw, 32px);
159
+ padding-block: clamp(24px, 3cqw, 40px) 0;
160
+ font-family: var(--openpress-font-serif);
161
+ color: var(--openpress-color-ink);
162
+ }
163
+
164
+ .paper-title {
165
+ font-family: var(--openpress-font-serif);
166
+ font-size: clamp(28px, 4.4cqw, 36px);
167
+ line-height: 1.2;
168
+ font-weight: 400;
169
+ text-align: center;
170
+ margin: 0;
171
+ letter-spacing: 0;
172
+ }
173
+
174
+ .paper-subtitle {
175
+ font-size: clamp(11px, 1.4cqw, 12px);
176
+ font-style: italic;
177
+ text-align: center;
178
+ color: var(--openpress-color-muted);
179
+ margin: 0;
180
+ }
181
+
182
+ .paper-authors {
183
+ list-style: none;
184
+ padding: 0;
185
+ margin: clamp(8px, 1.6cqw, 16px) 0 0;
186
+ display: grid;
187
+ grid-template-columns: repeat(3, 1fr);
188
+ gap: clamp(10px, 1.4cqw, 16px) clamp(8px, 1.2cqw, 14px);
189
+ }
190
+
191
+ .paper-author {
192
+ display: flex;
193
+ flex-direction: column;
194
+ align-items: center;
195
+ text-align: center;
196
+ font-size: clamp(10.5px, 1.3cqw, 11.5px);
197
+ line-height: 1.35;
198
+ gap: 0;
199
+ }
200
+
201
+ .paper-author-name {
202
+ font-weight: 500;
203
+ margin: 0 0 0.25em 0;
204
+ }
205
+
206
+ .paper-author-affiliation {
207
+ font-style: italic;
208
+ margin: 0;
209
+ color: var(--openpress-color-ink);
210
+ }
211
+
212
+ .paper-author-location,
213
+ .paper-author-contact {
214
+ margin: 0;
215
+ color: var(--openpress-color-ink);
216
+ }
217
+
218
+ .paper-abstract,
219
+ .paper-index-terms {
220
+ margin-top: clamp(8px, 1.6cqw, 14px);
221
+ font-size: clamp(10.5px, 1.3cqw, 11.5px);
222
+ line-height: 1.45;
223
+ }
224
+
225
+ .paper-abstract p,
226
+ .paper-index-terms p {
227
+ margin: 0;
228
+ text-indent: 1.2em;
229
+ font-style: italic;
230
+ }
231
+
232
+ .paper-abstract-label {
233
+ font-style: normal;
234
+ font-weight: 700;
235
+ }
236
+
237
+ /* Single-column flush body (v0.6). The v0.8 paged.js migration replaces */
238
+ /* this declaration with `column-count: 2; column-gap: 1rem;` and adds */
239
+ /* `column-span: all` for the title block + abstract above. */
240
+ .reader-page--content .page-body {
241
+ max-width: none;
242
+ }
243
+
244
+ /* ─ academic-paper back cover ───────────────────────────────────────────── */
245
+
246
+ .paper-back-cover {
247
+ display: flex;
248
+ flex-direction: column;
249
+ gap: clamp(10px, 1.6cqw, 16px);
250
+ font-family: var(--openpress-font-serif);
251
+ padding-inline: clamp(24px, 4cqw, 56px);
252
+ }
253
+
254
+ .paper-back-kicker {
255
+ font-family: var(--openpress-font-mono, monospace);
256
+ font-size: 11px;
257
+ letter-spacing: 0.08em;
258
+ text-transform: uppercase;
259
+ color: var(--openpress-color-muted);
260
+ margin: 0;
261
+ }
262
+
263
+ .paper-back-statement {
264
+ font-size: clamp(13px, 1.6cqw, 15px);
265
+ line-height: 1.5;
266
+ margin: 0;
267
+ }
@@ -0,0 +1,139 @@
1
+ /* page-surfaces / toc
2
+ * Table-of-contents page surface routed by `kind: toc` and built by the
3
+ * engine's renderToc(). Layout uses a 3-column grid (index / title / page).
4
+ */
5
+
6
+ .reader-page--toc {
7
+ padding: 0;
8
+ }
9
+
10
+ .reader-page--toc h2 {
11
+ margin-top: 0;
12
+ font-family: var(--openpress-font-serif);
13
+ font-weight: 300;
14
+ letter-spacing: 0.12em;
15
+ font-size: clamp(15pt, 3.6cqw, 18pt);
16
+ border-bottom: 0;
17
+ padding-bottom: 0;
18
+ }
19
+
20
+ .reader-page--toc h2.toc-heading--continuation {
21
+ margin-bottom: 0;
22
+ color: var(--openpress-color-muted);
23
+ font-family: var(--openpress-font-mono);
24
+ font-size: calc(8.5pt - var(--openpress-type-step-down));
25
+ font-weight: 400;
26
+ letter-spacing: 0.08em;
27
+ text-align: right;
28
+ }
29
+
30
+ .toc-list {
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: 0.75mm;
34
+ margin: 10mm 0 0;
35
+ padding: 0;
36
+ list-style: none;
37
+ }
38
+
39
+ .toc-continuation .toc-list {
40
+ margin-top: 5mm;
41
+ }
42
+
43
+ .toc-list li {
44
+ border-bottom: 0;
45
+ }
46
+
47
+ .toc-list a {
48
+ display: grid;
49
+ grid-template-columns: 9mm minmax(0, 1fr) 12mm;
50
+ column-gap: 3mm;
51
+ align-items: baseline;
52
+ color: var(--openpress-color-ink);
53
+ text-decoration: none;
54
+ padding: 1.6mm 0;
55
+ font-weight: 400;
56
+ line-height: 1.38;
57
+ }
58
+
59
+ .toc-list a:hover .toc-title {
60
+ color: var(--openpress-color-muted);
61
+ }
62
+
63
+ .toc-index {
64
+ display: inline-block;
65
+ color: var(--openpress-color-muted);
66
+ font-family: var(--openpress-font-mono);
67
+ font-variant-numeric: tabular-nums;
68
+ font-weight: 400;
69
+ letter-spacing: 0;
70
+ font-size: 9.5pt;
71
+ text-align: left;
72
+ }
73
+
74
+ .toc-level-2 a {
75
+ margin-top: 2.5mm;
76
+ padding: 3mm 0 2mm;
77
+ border-top: 1px solid rgba(169, 180, 194, 0.42);
78
+ }
79
+
80
+ .toc-level-2:first-child a {
81
+ margin-top: 0;
82
+ border-top: 0;
83
+ }
84
+
85
+ .toc-level-2 .toc-title {
86
+ color: var(--openpress-color-ink);
87
+ font-size: 12pt;
88
+ font-weight: 500;
89
+ }
90
+
91
+ .toc-level-2 .toc-title::after {
92
+ content: none;
93
+ }
94
+
95
+ .toc-level-2 .toc-page {
96
+ color: var(--openpress-color-ink);
97
+ font-size: 9.8pt;
98
+ }
99
+
100
+ .toc-level-3 a {
101
+ grid-template-columns: 9mm minmax(0, 1fr) 12mm;
102
+ padding: 1.28mm 0 1.28mm 7mm;
103
+ color: var(--openpress-color-muted);
104
+ font-size: 10pt;
105
+ }
106
+
107
+ .toc-level-3 .toc-index {
108
+ font-size: 9pt;
109
+ }
110
+
111
+ .toc-level-3 .toc-page {
112
+ font-size: 9.5pt;
113
+ }
114
+
115
+ .toc-title {
116
+ display: flex;
117
+ gap: 3mm;
118
+ align-items: baseline;
119
+ color: var(--openpress-color-ink);
120
+ }
121
+
122
+ .toc-title::after {
123
+ content: "";
124
+ flex: 1;
125
+ min-width: 10mm;
126
+ border-bottom: 1px dotted rgba(72, 101, 129, 0.32);
127
+ transform: translateY(-0.22em);
128
+ }
129
+
130
+ .toc-page {
131
+ color: var(--openpress-color-muted);
132
+ font-family: var(--openpress-font-mono);
133
+ font-variant-numeric: tabular-nums;
134
+ font-weight: 400;
135
+ font-size: 9.8pt;
136
+ justify-self: end;
137
+ min-width: 10mm;
138
+ text-align: right;
139
+ }
@@ -0,0 +1,49 @@
1
+ /* _chart-frame.css
2
+ * 共用圖表外框。文件圖表只要在 figure 上掛 chart-frame,
3
+ * 元件自己的 class 只負責內部結構樣式。
4
+ */
5
+
6
+ .reader-page--content .page-body > figure.chart-frame,
7
+ :where(.chart-frame) {
8
+ width: 100%;
9
+ max-width: none;
10
+ margin: var(--openpress-space-3) 0 var(--openpress-space-4);
11
+ margin-left: 0;
12
+ margin-right: 0;
13
+ padding: var(--openpress-space-2);
14
+ border: 1px solid rgba(0, 0, 0, 0.07);
15
+ background: var(--openpress-color-document);
16
+ box-sizing: border-box;
17
+ break-inside: avoid;
18
+ }
19
+
20
+ :where(.chart-frame) figcaption {
21
+ margin-top: var(--openpress-space-2);
22
+ color: var(--openpress-color-muted);
23
+ font-size: clamp(10px, 1.05cqw, 11px);
24
+ line-height: 1.55;
25
+ letter-spacing: 0.04em;
26
+ text-align: center;
27
+ }
28
+
29
+ .reader-page--content .page-body > figure svg,
30
+ :where(.chart-frame) svg {
31
+ display: block;
32
+ max-width: 100%;
33
+ height: auto;
34
+ overflow: visible;
35
+ }
36
+
37
+ @media (max-width: 899px) {
38
+ .reader-page--content .page-body > figure.chart-frame,
39
+ :where(.chart-frame) {
40
+ max-height: 100%;
41
+ }
42
+
43
+ .reader-page--content .page-body > figure svg,
44
+ :where(.chart-frame) svg {
45
+ width: 100%;
46
+ max-height: 100%;
47
+ object-fit: contain;
48
+ }
49
+ }
@@ -0,0 +1,68 @@
1
+ /* figure-grid
2
+ * Reusable image grid pattern for inline Markdown/HTML figures.
3
+ */
4
+
5
+ table.figure-grid {
6
+ border: 0;
7
+ background: transparent;
8
+ table-layout: fixed;
9
+ }
10
+
11
+ div.figure-grid {
12
+ display: grid;
13
+ grid-template-columns: repeat(2, minmax(0, 1fr));
14
+ gap: 4mm;
15
+ margin: var(--openpress-space-4) 0 var(--openpress-space-2);
16
+ break-inside: avoid;
17
+ }
18
+
19
+ table.figure-grid td {
20
+ border: 0;
21
+ padding: 0 2mm 3mm;
22
+ vertical-align: top;
23
+ }
24
+
25
+ table.figure-grid figure,
26
+ div.figure-grid figure {
27
+ margin-top: 0;
28
+ margin-bottom: 0;
29
+ }
30
+
31
+ .figure-grid img {
32
+ width: auto;
33
+ height: auto;
34
+ max-width: 100%;
35
+ max-height: 62mm;
36
+ }
37
+
38
+ /* Three-column triptych: one lead figure plus two siblings, centered on the
39
+ * page. Use this when a section needs a coordinated trio of images at a fixed
40
+ * aspect ratio (e.g. founder profile, milestone photo set). */
41
+ div.figure-grid--triptych {
42
+ grid-template-columns: repeat(3, minmax(0, 1fr));
43
+ gap: 3mm;
44
+ width: min(92%, 156mm);
45
+ margin: var(--openpress-space-4) auto var(--openpress-space-2);
46
+ }
47
+
48
+ div.figure-grid--triptych figure {
49
+ display: flex;
50
+ flex-direction: column;
51
+ align-items: center;
52
+ margin: 0;
53
+ }
54
+
55
+ div.figure-grid--triptych img {
56
+ width: 100%;
57
+ max-height: none;
58
+ aspect-ratio: 3 / 2;
59
+ object-fit: cover;
60
+ }
61
+
62
+ div.figure-grid--triptych .figure-grid__lead img {
63
+ aspect-ratio: 4 / 3;
64
+ }
65
+
66
+ div.figure-grid--triptych figcaption {
67
+ text-align: left;
68
+ }
@@ -0,0 +1,66 @@
1
+ /* table-utilities
2
+ * Semantic table helpers used by content Markdown.
3
+ */
4
+
5
+ .cell-check,
6
+ .cell-partial,
7
+ .cell-dash {
8
+ display: inline-block;
9
+ font-feature-settings: "tnum";
10
+ line-height: 1;
11
+ }
12
+
13
+ .cell-check {
14
+ color: #24a148;
15
+ font-weight: 600;
16
+ }
17
+
18
+ .cell-partial {
19
+ color: #b58105;
20
+ font-weight: 500;
21
+ }
22
+
23
+ .cell-dash {
24
+ color: var(--openpress-color-text-placeholder);
25
+ letter-spacing: -0.04em;
26
+ }
27
+
28
+ .status-text {
29
+ display: inline;
30
+ font-size: inherit;
31
+ line-height: inherit;
32
+ white-space: nowrap;
33
+ }
34
+
35
+ .status-live {
36
+ color: #198038;
37
+ }
38
+
39
+ .status-building {
40
+ color: #0f62fe;
41
+ }
42
+
43
+ .status-planned {
44
+ color: #525252;
45
+ }
46
+
47
+ .status-ai-full {
48
+ color: #007d79;
49
+ }
50
+
51
+ .status-ai-partial {
52
+ color: #8a5a00;
53
+ }
54
+
55
+ td.numeric,
56
+ th.numeric {
57
+ text-align: right;
58
+ font-variant-numeric: tabular-nums;
59
+ white-space: nowrap;
60
+ }
61
+
62
+ td.savings-rate,
63
+ th.savings-rate {
64
+ color: var(--openpress-color-green);
65
+ font-weight: 600;
66
+ }