@open-press/cli 0.8.0 → 1.1.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 (250) hide show
  1. package/README.md +33 -23
  2. package/dist/cli.js +320 -252
  3. package/package.json +9 -8
  4. package/template/core/AGENTS.md +0 -126
  5. package/template/core/CHANGELOG.md +0 -215
  6. package/template/core/README.md +0 -40
  7. package/template/core/engine/cli.mjs +0 -96
  8. package/template/core/engine/commands/_shared.mjs +0 -177
  9. package/template/core/engine/commands/deploy.mjs +0 -31
  10. package/template/core/engine/commands/dev.mjs +0 -49
  11. package/template/core/engine/commands/doctor.mjs +0 -229
  12. package/template/core/engine/commands/export.mjs +0 -8
  13. package/template/core/engine/commands/init.mjs +0 -24
  14. package/template/core/engine/commands/inspect.mjs +0 -35
  15. package/template/core/engine/commands/pdf.mjs +0 -26
  16. package/template/core/engine/commands/preview.mjs +0 -26
  17. package/template/core/engine/commands/render.mjs +0 -17
  18. package/template/core/engine/commands/replace.mjs +0 -41
  19. package/template/core/engine/commands/search.mjs +0 -33
  20. package/template/core/engine/commands/typecheck.mjs +0 -5
  21. package/template/core/engine/commands/upgrade.mjs +0 -159
  22. package/template/core/engine/commands/validate.mjs +0 -17
  23. package/template/core/engine/document-export.mjs +0 -15
  24. package/template/core/engine/init.mjs +0 -90
  25. package/template/core/engine/output/chrome-pdf.d.mts +0 -34
  26. package/template/core/engine/output/chrome-pdf.mjs +0 -358
  27. package/template/core/engine/output/deploy-sync.mjs +0 -15
  28. package/template/core/engine/output/fonts.mjs +0 -62
  29. package/template/core/engine/output/katex-assets.mjs +0 -45
  30. package/template/core/engine/output/page-block.mjs +0 -30
  31. package/template/core/engine/output/pdf-media.mjs +0 -45
  32. package/template/core/engine/output/public-assets.mjs +0 -19
  33. package/template/core/engine/output/static-server.mjs +0 -532
  34. package/template/core/engine/react/caption-numbering.mjs +0 -73
  35. package/template/core/engine/react/comment-endpoint.d.mts +0 -11
  36. package/template/core/engine/react/comment-endpoint.mjs +0 -102
  37. package/template/core/engine/react/comment-marker.mjs +0 -374
  38. package/template/core/engine/react/document-entry.mjs +0 -324
  39. package/template/core/engine/react/document-export.mjs +0 -373
  40. package/template/core/engine/react/http-json.mjs +0 -24
  41. package/template/core/engine/react/mdx-compile.mjs +0 -599
  42. package/template/core/engine/react/measurement-css.mjs +0 -136
  43. package/template/core/engine/react/object-entities.mjs +0 -119
  44. package/template/core/engine/react/pagination/allocator.mjs +0 -122
  45. package/template/core/engine/react/pagination/regions.mjs +0 -81
  46. package/template/core/engine/react/pagination-constants.mjs +0 -3
  47. package/template/core/engine/react/pagination.mjs +0 -9
  48. package/template/core/engine/react/pipeline/allocate.mjs +0 -251
  49. package/template/core/engine/react/pipeline/final-render.mjs +0 -94
  50. package/template/core/engine/react/pipeline/frame-measurement.mjs +0 -302
  51. package/template/core/engine/react/pipeline/press-tree.mjs +0 -135
  52. package/template/core/engine/react/project-asset-endpoint.d.mts +0 -10
  53. package/template/core/engine/react/project-asset-endpoint.mjs +0 -361
  54. package/template/core/engine/react/section-css.mjs +0 -56
  55. package/template/core/engine/react/source-edit-endpoint.d.mts +0 -10
  56. package/template/core/engine/react/source-edit-endpoint.mjs +0 -75
  57. package/template/core/engine/react/sources/heading-numbering.mjs +0 -132
  58. package/template/core/engine/react/sources/mdx-resolver.mjs +0 -439
  59. package/template/core/engine/react/style-discovery.mjs +0 -142
  60. package/template/core/engine/runtime/config.d.mts +0 -40
  61. package/template/core/engine/runtime/config.mjs +0 -175
  62. package/template/core/engine/runtime/file-utils.mjs +0 -106
  63. package/template/core/engine/runtime/file-walk.mjs +0 -22
  64. package/template/core/engine/runtime/inspection.mjs +0 -328
  65. package/template/core/engine/runtime/issue-report.mjs +0 -44
  66. package/template/core/engine/runtime/path-utils.mjs +0 -20
  67. package/template/core/engine/runtime/source-text-tools.d.mts +0 -102
  68. package/template/core/engine/runtime/source-text-tools.mjs +0 -832
  69. package/template/core/engine/runtime/source-workspace.mjs +0 -159
  70. package/template/core/engine/runtime/validation.mjs +0 -174
  71. package/template/core/index.html +0 -13
  72. package/template/core/openpress.config.mjs +0 -12
  73. package/template/core/package.json +0 -91
  74. package/template/core/src/main.tsx +0 -16
  75. package/template/core/src/openpress/app/OpenPressApp.tsx +0 -140
  76. package/template/core/src/openpress/app/OpenPressRuntime.tsx +0 -94
  77. package/template/core/src/openpress/app/index.ts +0 -2
  78. package/template/core/src/openpress/core/Frame.tsx +0 -78
  79. package/template/core/src/openpress/core/FrameContext.tsx +0 -24
  80. package/template/core/src/openpress/core/MdxArea.tsx +0 -34
  81. package/template/core/src/openpress/core/Press.tsx +0 -34
  82. package/template/core/src/openpress/core/cn.ts +0 -4
  83. package/template/core/src/openpress/core/index.tsx +0 -40
  84. package/template/core/src/openpress/core/primitives.tsx +0 -44
  85. package/template/core/src/openpress/core/types.ts +0 -191
  86. package/template/core/src/openpress/core/useSource.ts +0 -28
  87. package/template/core/src/openpress/document-model/anchorMapModel.ts +0 -27
  88. package/template/core/src/openpress/document-model/documentIndexes.ts +0 -329
  89. package/template/core/src/openpress/document-model/documentTypes.ts +0 -138
  90. package/template/core/src/openpress/document-model/index.ts +0 -6
  91. package/template/core/src/openpress/document-model/objectEntityModel.ts +0 -51
  92. package/template/core/src/openpress/document-model/projectIdentityModel.ts +0 -15
  93. package/template/core/src/openpress/document-model/reactDocumentMetadataModel.ts +0 -27
  94. package/template/core/src/openpress/manuscript/index.tsx +0 -238
  95. package/template/core/src/openpress/mdx/index.ts +0 -88
  96. package/template/core/src/openpress/numbering/index.ts +0 -294
  97. package/template/core/src/openpress/reader/PublicReaderPage.tsx +0 -267
  98. package/template/core/src/openpress/reader/ReaderNavigationPanel.tsx +0 -123
  99. package/template/core/src/openpress/reader/index.ts +0 -10
  100. package/template/core/src/openpress/reader/pageViewportScaleModel.ts +0 -73
  101. package/template/core/src/openpress/reader/readerPageRegistry.ts +0 -41
  102. package/template/core/src/openpress/reader/readerPageRoute.ts +0 -21
  103. package/template/core/src/openpress/reader/readerScroll.ts +0 -92
  104. package/template/core/src/openpress/reader/readerStateModel.ts +0 -15
  105. package/template/core/src/openpress/reader/readerTypes.ts +0 -4
  106. package/template/core/src/openpress/reader/usePageViewportScale.ts +0 -119
  107. package/template/core/src/openpress/reader/usePanelState.ts +0 -56
  108. package/template/core/src/openpress/reader/useReaderHashSync.ts +0 -61
  109. package/template/core/src/openpress/reader/useReaderKeyboardNav.ts +0 -48
  110. package/template/core/src/openpress/reader/useReaderRuntime.ts +0 -146
  111. package/template/core/src/openpress/reader/useReaderScrollAnchor.ts +0 -64
  112. package/template/core/src/openpress/shared/Panel.tsx +0 -77
  113. package/template/core/src/openpress/shared/frameScheduler.ts +0 -32
  114. package/template/core/src/openpress/shared/index.ts +0 -4
  115. package/template/core/src/openpress/shared/numberUtils.ts +0 -3
  116. package/template/core/src/openpress/shared/runtimeMode.ts +0 -11
  117. package/template/core/src/openpress/workbench/Workbench.tsx +0 -407
  118. package/template/core/src/openpress/workbench/actions/DeploymentControl.tsx +0 -157
  119. package/template/core/src/openpress/workbench/actions/PageZoomControl.tsx +0 -182
  120. package/template/core/src/openpress/workbench/actions/SearchControl.tsx +0 -345
  121. package/template/core/src/openpress/workbench/actions/deploymentStatusModel.ts +0 -112
  122. package/template/core/src/openpress/workbench/actions/index.ts +0 -5
  123. package/template/core/src/openpress/workbench/actions/useDeploymentWorkbench.ts +0 -136
  124. package/template/core/src/openpress/workbench/dialog/WorkbenchDialog.tsx +0 -72
  125. package/template/core/src/openpress/workbench/dialog/index.ts +0 -1
  126. package/template/core/src/openpress/workbench/document/components/DocumentPanel.tsx +0 -127
  127. package/template/core/src/openpress/workbench/document/components/InlineSourceEditorLayer.tsx +0 -207
  128. package/template/core/src/openpress/workbench/document/components/ReaderStage.tsx +0 -9
  129. package/template/core/src/openpress/workbench/document/hooks/useDocumentWorkbenchModel.ts +0 -34
  130. package/template/core/src/openpress/workbench/document/hooks/useInlineDocumentEditor.ts +0 -525
  131. package/template/core/src/openpress/workbench/document/index.ts +0 -10
  132. package/template/core/src/openpress/workbench/index.ts +0 -2
  133. package/template/core/src/openpress/workbench/inspector/InlineInspectorLayer.tsx +0 -459
  134. package/template/core/src/openpress/workbench/inspector/index.ts +0 -5
  135. package/template/core/src/openpress/workbench/inspector/inlineCommentModel.ts +0 -125
  136. package/template/core/src/openpress/workbench/inspector/inspectorGeometryModel.ts +0 -160
  137. package/template/core/src/openpress/workbench/inspector/inspectorModel.ts +0 -408
  138. package/template/core/src/openpress/workbench/inspector/useInspectorComments.ts +0 -248
  139. package/template/core/src/openpress/workbench/mentions/MentionSuggestionList.tsx +0 -41
  140. package/template/core/src/openpress/workbench/mentions/index.ts +0 -2
  141. package/template/core/src/openpress/workbench/mentions/useComposerMentions.ts +0 -185
  142. package/template/core/src/openpress/workbench/panels/Panel.tsx +0 -1
  143. package/template/core/src/openpress/workbench/panels/PendingCommentsPanel.tsx +0 -76
  144. package/template/core/src/openpress/workbench/panels/WorkbenchControlPanel.tsx +0 -29
  145. package/template/core/src/openpress/workbench/panels/index.ts +0 -3
  146. package/template/core/src/openpress/workbench/project/ProjectEntryPanel.tsx +0 -523
  147. package/template/core/src/openpress/workbench/project/ProjectPreviewDialog.tsx +0 -35
  148. package/template/core/src/openpress/workbench/project/index.ts +0 -2
  149. package/template/core/src/openpress/workbench/project/projectPreviewTypes.ts +0 -11
  150. package/template/core/src/openpress/workbench/project/projectSourceModel.ts +0 -24
  151. package/template/core/src/openpress/workbench/shell/WorkbenchShell.tsx +0 -167
  152. package/template/core/src/openpress/workbench/shell/index.ts +0 -1
  153. package/template/core/src/openpress/workbench/workbenchFormatters.ts +0 -120
  154. package/template/core/src/openpress/workbench/workbenchTypes.ts +0 -35
  155. package/template/core/src/styles/openpress/app-shell.css +0 -251
  156. package/template/core/src/styles/openpress/media-workspace.css +0 -230
  157. package/template/core/src/styles/openpress/print-route.css +0 -184
  158. package/template/core/src/styles/openpress/project-preview-panel.css +0 -924
  159. package/template/core/src/styles/openpress/public-viewer.css +0 -688
  160. package/template/core/src/styles/openpress/reader-runtime.css +0 -980
  161. package/template/core/src/styles/openpress/responsive.css +0 -245
  162. package/template/core/src/styles/openpress/workbench-panels.css +0 -594
  163. package/template/core/src/styles/openpress/workbench.css +0 -1255
  164. package/template/core/src/styles/openpress.css +0 -14
  165. package/template/core/src/vite-env.d.ts +0 -9
  166. package/template/core/tsconfig.json +0 -40
  167. package/template/core/vite.config.ts +0 -584
  168. package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +0 -35
  169. package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +0 -50
  170. package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +0 -47
  171. package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +0 -26
  172. package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +0 -32
  173. package/template/packs/academic-paper/document/components/ChapterOpenerVisual/index.tsx +0 -76
  174. package/template/packs/academic-paper/document/components/Page.tsx +0 -60
  175. package/template/packs/academic-paper/document/components/TokenSwatchGrid/index.tsx +0 -46
  176. package/template/packs/academic-paper/document/components/TokenSwatchGrid/style.css +0 -63
  177. package/template/packs/academic-paper/document/components/TypeSpecimen/index.tsx +0 -38
  178. package/template/packs/academic-paper/document/components/TypeSpecimen/style.css +0 -111
  179. package/template/packs/academic-paper/document/design.md +0 -279
  180. package/template/packs/academic-paper/document/index.tsx +0 -123
  181. package/template/packs/academic-paper/document/media/README.md +0 -13
  182. package/template/packs/academic-paper/document/media/figure-placeholder.svg +0 -9
  183. package/template/packs/academic-paper/document/openpress.config.mjs +0 -26
  184. package/template/packs/academic-paper/document/theme/README.md +0 -11
  185. package/template/packs/academic-paper/document/theme/base/page-contract.css +0 -522
  186. package/template/packs/academic-paper/document/theme/base/print.css +0 -93
  187. package/template/packs/academic-paper/document/theme/base/typography.css +0 -333
  188. package/template/packs/academic-paper/document/theme/fonts.css +0 -3
  189. package/template/packs/academic-paper/document/theme/page-surfaces/back-cover.css +0 -43
  190. package/template/packs/academic-paper/document/theme/page-surfaces/chapter-opener.css +0 -205
  191. package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +0 -294
  192. package/template/packs/academic-paper/document/theme/page-surfaces/toc.css +0 -149
  193. package/template/packs/academic-paper/document/theme/patterns/_chart-frame.css +0 -49
  194. package/template/packs/academic-paper/document/theme/patterns/figure-grid.css +0 -68
  195. package/template/packs/academic-paper/document/theme/patterns/table-utilities.css +0 -66
  196. package/template/packs/academic-paper/document/theme/shell/reader-controls.css +0 -761
  197. package/template/packs/academic-paper/document/theme/tokens.css +0 -80
  198. package/template/packs/academic-paper/openpress.config.mjs +0 -5
  199. package/template/packs/claude-document/document/chapters/01-document-shape/content/01-document-shape.mdx +0 -51
  200. package/template/packs/claude-document/document/chapters/02-review-loop/content/01-review-loop.mdx +0 -31
  201. package/template/packs/claude-document/document/components/ChapterOpenerVisual.tsx +0 -96
  202. package/template/packs/claude-document/document/components/Page.tsx +0 -37
  203. package/template/packs/claude-document/document/design.md +0 -142
  204. package/template/packs/claude-document/document/index.tsx +0 -94
  205. package/template/packs/claude-document/document/media/README.md +0 -13
  206. package/template/packs/claude-document/document/openpress.config.mjs +0 -26
  207. package/template/packs/claude-document/document/theme/README.md +0 -15
  208. package/template/packs/claude-document/document/theme/base/page-contract.css +0 -525
  209. package/template/packs/claude-document/document/theme/base/print.css +0 -93
  210. package/template/packs/claude-document/document/theme/base/typography.css +0 -612
  211. package/template/packs/claude-document/document/theme/fonts.css +0 -4
  212. package/template/packs/claude-document/document/theme/page-surfaces/back-cover.css +0 -72
  213. package/template/packs/claude-document/document/theme/page-surfaces/chapter-opener.css +0 -236
  214. package/template/packs/claude-document/document/theme/page-surfaces/cover.css +0 -309
  215. package/template/packs/claude-document/document/theme/page-surfaces/toc.css +0 -225
  216. package/template/packs/claude-document/document/theme/patterns/_chart-frame.css +0 -53
  217. package/template/packs/claude-document/document/theme/patterns/figure-grid.css +0 -68
  218. package/template/packs/claude-document/document/theme/patterns/table-utilities.css +0 -66
  219. package/template/packs/claude-document/document/theme/shell/reader-controls.css +0 -789
  220. package/template/packs/claude-document/document/theme/tokens.css +0 -89
  221. package/template/packs/claude-document/openpress.config.mjs +0 -5
  222. package/template/packs/editorial-monograph/document/chapters/01-product-and-use-cases/content/01-product-and-use-cases.mdx +0 -31
  223. package/template/packs/editorial-monograph/document/chapters/02-workflow/content/01-workflow.mdx +0 -89
  224. package/template/packs/editorial-monograph/document/chapters/03-agent-skills-contributors/content/01-agent-skills-contributors.mdx +0 -51
  225. package/template/packs/editorial-monograph/document/chapters/04-validation-deploy/content/01-validation-deploy.mdx +0 -39
  226. package/template/packs/editorial-monograph/document/components/ChapterOpenerVisual/index.tsx +0 -76
  227. package/template/packs/editorial-monograph/document/components/Page.tsx +0 -37
  228. package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/index.tsx +0 -46
  229. package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/style.css +0 -63
  230. package/template/packs/editorial-monograph/document/components/TypeSpecimen/index.tsx +0 -38
  231. package/template/packs/editorial-monograph/document/components/TypeSpecimen/style.css +0 -111
  232. package/template/packs/editorial-monograph/document/design.md +0 -279
  233. package/template/packs/editorial-monograph/document/index.tsx +0 -97
  234. package/template/packs/editorial-monograph/document/media/README.md +0 -13
  235. package/template/packs/editorial-monograph/document/openpress.config.mjs +0 -26
  236. package/template/packs/editorial-monograph/document/theme/README.md +0 -11
  237. package/template/packs/editorial-monograph/document/theme/base/page-contract.css +0 -505
  238. package/template/packs/editorial-monograph/document/theme/base/print.css +0 -93
  239. package/template/packs/editorial-monograph/document/theme/base/typography.css +0 -336
  240. package/template/packs/editorial-monograph/document/theme/fonts.css +0 -3
  241. package/template/packs/editorial-monograph/document/theme/page-surfaces/back-cover.css +0 -43
  242. package/template/packs/editorial-monograph/document/theme/page-surfaces/chapter-opener.css +0 -205
  243. package/template/packs/editorial-monograph/document/theme/page-surfaces/cover.css +0 -147
  244. package/template/packs/editorial-monograph/document/theme/page-surfaces/toc.css +0 -149
  245. package/template/packs/editorial-monograph/document/theme/patterns/_chart-frame.css +0 -49
  246. package/template/packs/editorial-monograph/document/theme/patterns/figure-grid.css +0 -68
  247. package/template/packs/editorial-monograph/document/theme/patterns/table-utilities.css +0 -66
  248. package/template/packs/editorial-monograph/document/theme/shell/reader-controls.css +0 -761
  249. package/template/packs/editorial-monograph/document/theme/tokens.css +0 -80
  250. package/template/packs/editorial-monograph/openpress.config.mjs +0 -5
@@ -1,279 +0,0 @@
1
- # open-press 樣式規格
2
-
3
- > 一份合併的設計說明,給內容作者、AI Agent 與 style pack contributor 共用。
4
- > Editorial-monograph starter 從這份檔案複製到 `document/design.md`;之後請依專案需要改寫,維持單一檔案結構。
5
-
6
- ---
7
-
8
- ## 1. 風格目標與使用場景
9
-
10
- open-press 初始模板面向長文件,而不是單頁網站或 dashboard。它要支援課程講義、提案、報告、白皮書、產品文件與公開說明文件,重點是穩定閱讀、可輸出、可被 AI 持續修改。
11
-
12
- 這套風格的基調是「安靜、可信、可交付」。文件使用白底、近黑文字、細線分隔、低彩度輔助資訊與少量暖色圖表色。章節標題保留 editorial 感,但正文、表格與圖表仍優先服務資訊密度。
13
-
14
- ### 設計原則
15
-
16
- | 原則 | 規則 | Agent 操作提醒 |
17
- | --- | --- | --- |
18
- | 文件優先 | 第一眼應該像可交付的 A4 文件,不像 landing page | 不要加入 hero marketing section、浮動卡片或裝飾性背景 |
19
- | 規格透明 | User 看到的 Design page 就是 Agent 依循的 design source | 修改風格時先更新 `document/design.md`,再更新 `document/theme/` |
20
- | 來源可改 | 內容從 MDX、React props 與 media assets 產生 | 不把關鍵文字或數據鎖死在截圖或手寫 SVG |
21
- | 輸出穩定 | 所有樣式要支援 reader、mobile preview 與 PDF | 避免 uncontrolled overflow、孤立 caption 與跨 footer 元件 |
22
-
23
- ### 使用場景
24
-
25
- | 場景 | 適合原因 | 不適合方向 |
26
- | --- | --- | --- |
27
- | 提案與商業報告 | 需要清楚章節、數據、圖表與結論 | 過度銷售語氣、滿版裝飾 |
28
- | 課程講義與白皮書 | 需要長文閱讀與穩定分頁 | 插畫密集或社群貼文式排版 |
29
- | 產品文件與說明書 | 需要流程、規格、表格與檢查清單 | Dashboard-like 操作面板 |
30
- | Design System Manual | 需要 user 與 Agent 看到同一份規格 | 另一套 token gallery 或 demo source |
31
-
32
- ### User 與 Agent 的分工
33
-
34
- User 檢查這份文件時,主要判斷「這是不是我要的文件風格」。Agent 閱讀這份文件時,主要判斷「接下來生成正式文件時要遵守哪些規格」。
35
-
36
- | 角色 | 讀這份文件時要取得的資訊 |
37
- | --- | --- |
38
- | User | 風格是否符合品牌、文件是否易讀、輸出是否可信 |
39
- | Agent | 語氣、字級、色彩、元件規則、驗收清單 |
40
- | open-press renderer | source mapping、bookmarks、page state、PDF-safe preview |
41
-
42
- ---
43
-
44
- ## 2. Tokens
45
-
46
- ### Typography Scale
47
-
48
- open-press 初始模板使用兩組字體:正文與介面使用無襯線,封面與章節標題使用襯線,讓文件在資訊密度與 editorial 氣質之間取得平衡。
49
-
50
- | 用途 | CSS selector / token | 字體 | 大小 | 字重 | 行高 / 字距 | 使用規則 |
51
- | --- | --- | --- | --- | --- | --- | --- |
52
- | Metric display | `.metric-display`, chart figure number | `--openpress-font-body` | `34pt` | 700 | line-height `1`, letter `0` | 只用於資料圖表或單一重點數字 |
53
- | Cover title | `.cover-title` | `--openpress-font-serif` | `clamp(36px, 8.5cqw, 64px)` | 300 | line-height `1`, letter `0.01em` | 文件名稱或產品名,整份文件只在封面使用 |
54
- | Cover tagline | `.cover-tagline` | `--openpress-font-serif` | `clamp(14px, 2.4cqw, 20px)` | 300 | letter `0.08em` | 封面一句話定位,不承載長句 |
55
- | Cover subtitle | `.cover-subtitle` | `--openpress-font-body` | `10.5pt-12.5pt` | 400 | line-height `1.55` | 封面主說明,最多一段 |
56
- | Chapter title | `h2` | `--openpress-font-serif` | `14pt-17pt` | 300 | line-height `1.45`, letter `0.04em` | 每個 `##` 產生一個章節 bookmark |
57
- | Section title | `h3` | `--openpress-font-serif` | `11pt-13pt` | 400 | line-height `1.55`, letter `0.03em` | 用於章節內小節,不要過度切碎 |
58
- | Minor heading | `h4` | `--openpress-font-body` | `10pt-11pt` | 500 | muted, letter `0.04em` | 表格前提示或局部標題 |
59
- | Body text | `p`, `li` | `--openpress-font-body` | `9.5pt-10.5pt` | 400 | line-height `1.85` | 長文閱讀基準;不要用過短行距 |
60
- | Table text | `table` | `--openpress-font-body` | `8pt-9pt` | 400 / th 500 | line-height `1.45` | 密集資料,保持掃讀 |
61
- | Caption | `figcaption`, `caption` | `--openpress-font-body` | `7.5pt-8.5pt` | 400 | line-height `1.5`, letter `0.02em` | 圖表下方置中,需可自動編號 |
62
-
63
- Agent 寫作時不應用「字變大」解決層級問題。若章節不清楚,先調整內容結構與 heading;若仍不足,再調整 token。
64
-
65
- ### Color Tokens
66
-
67
- 色票是視覺驗收工具,不取代表格規格。User 可以用視覺對照判斷文件氣質;Agent 應依照每張色票的 usage 決定是否使用。
68
-
69
- | Token | Value | 用途 |
70
- | --- | --- | --- |
71
- | `--openpress-color-document` | `#ffffff` | A4 文件紙面、表格與圖表背景 |
72
- | `--openpress-color-ink` | `#161616` | 主文字、標題、主要線條 |
73
- | `--openpress-color-muted` | `#6f6f6f` | caption、頁碼、章節編號、輔助說明 |
74
- | `--openpress-color-line` | `#e0e0e0` | 表格列線、細分隔線 |
75
- | `--openpress-color-soft-line` | `#f4f4f4` | 輕量分隔、flow stage 內部線 |
76
- | `--openpress-color-app-bg` | `#161616` | Workbench 外層深色 chrome |
77
- | `--openpress-chart-gold` | `#FFB000` | 主要 chart accent、current / starting point |
78
- | `--openpress-chart-coral` | `#FF6A4D` | chart 第二層強調 |
79
- | `--openpress-chart-coral-deep` | `#C9522B` | chart 深層強調 |
80
- | `--openpress-chart-dark` | `#1F2328` | chart anchor / mature state |
81
- | `--openpress-status-warn` | `#C9522B` | 行內語意強調:風險、警示、注意(`.status-warn`) |
82
- | `--openpress-status-success` | `#5C8C4F` | 行內語意強調:達標、通過、確認(`.status-success`) |
83
- | `--openpress-status-info` | `#4A6B8A` | 行內語意強調:補充說明、註腳(`.status-info`) |
84
-
85
- 文件頁面以黑白灰為主,暖色只用在圖表與少量 emphasis。不要把整份文件改成單一強烈品牌色,也不要用大面積漸層當背景。
86
-
87
- Starter 可以用 React 元件建立視覺對照頁,例如 `document/components/TypeSpecimen/`(typography)與 `document/components/TokenSwatchGrid/`(color)。
88
-
89
- ### Inline Emphasis
90
-
91
- Markdown 內的文字強調走兩條路徑:
92
-
93
- 1. **MD 原生語法**:`**bold**` → `<strong>`,`*italic*` → `<em>`,`~~strike~~` → `<del>`,`` `code` `` → `<code>`,`[text](url)` → `<a>`,`<mark>text</mark>` → highlight。每個都已綁 token 樣式,不用手動加 class。
94
- 2. **語意強調色**:在 markdown 內以 `<span class="status-warn|status-success|status-info">` 標註。class 限制在三色 status,避免按色相命名(如 `.accent-gold`)破壞語意系統。
95
-
96
- | Selector | 預設樣式來源 | 使用時機 |
97
- | --- | --- | --- |
98
- | `strong` | `font-weight: 600` + ink color | 段落內關鍵詞、列表 key term |
99
- | `em` | serif italic + ink color | 引用、術語、書名 |
100
- | `del` / `s` | muted + strike | 刪除、修正前後對照 |
101
- | `code` | mono font + 淺背景 + padding | 路徑、識別字、命令 |
102
- | `a` | ink + dotted underline | 超連結;underline 避免實線以區隔印刷正文 |
103
- | `mark` | gold tint 背景 + ink | 「primary highlight」——一份文件只挑少量重點數字或關鍵句 |
104
- | `.status-warn` | `--openpress-status-warn` + 600 | 風險、延遲、警示語境 |
105
- | `.status-success` | `--openpress-status-success` + 600 | 已達標、通過、完成 |
106
- | `.status-info` | `--openpress-status-info` + 600 | 補充、註記、輔助資訊 |
107
- | `.text-muted` | `--openpress-color-muted` | 非語意性「再弱一級」 |
108
-
109
- 不提供 `<u>` underline 樣式——印刷上跟 `<a>` 撞,反而降低可讀性。若要強調,改用 `<strong>` 或 `<mark>`。
110
-
111
- Block-level 強調(callout / warning / note)目前不在 design system 範圍;若文件需要區塊式提示,先評估是否能用既有 figure 或 table 表達。
112
-
113
- ### Chapter & Section Numbering
114
-
115
- Engine 不在 h2/h3 內容前注入任何編號或前綴;export pipeline 會在 build-time 寫入 `data-chapter` / `data-section` attribute(值是 `01`、`1.1` 這種兩位數阿拉伯格式)。實際顯示樣式由 theme 的 `::before content` 決定,這讓不同文件能挑不同 numbering vocabulary 而不動 reader runtime。
116
-
117
- 預設(editorial-monograph 起手樣式):
118
-
119
- ```css
120
- /* document/theme/base/typography.css */
121
- .reader-page--content .page-body > h2:first-child::before {
122
- content: attr(data-chapter); /* 顯示「02」 */
123
- }
124
-
125
- .reader-page--content h3[data-section]::before {
126
- content: attr(data-section); /* 顯示「2.1」 */
127
- }
128
- ```
129
-
130
- 要換成「一、二、(一)(二)」風格,**不動 engine、不動 pagination**,只改 `typography.css` 的 `::before content`:
131
-
132
- ```css
133
- @counter-style qj-cjk-decimal {
134
- system: cyclic;
135
- symbols: "一" "二" "三" "四" "五" "六" "七" "八" "九" "十";
136
- suffix: "、";
137
- }
138
-
139
- @counter-style qj-cjk-section {
140
- system: cyclic;
141
- symbols: "(一)" "(二)" "(三)" "(四)" "(五)"
142
- "(六)" "(七)" "(八)" "(九)" "(十)";
143
- suffix: "";
144
- }
145
-
146
- /* Chapter h2: 一、 */
147
- .reader-page--content .page-body > h2:first-child {
148
- counter-reset: qj-chapter calc(attr(data-chapter type(<integer>), 0));
149
- }
150
- .reader-page--content .page-body > h2:first-child::before {
151
- content: counter(qj-chapter, qj-cjk-decimal);
152
- }
153
-
154
- /* Section h3: (一) */
155
- .reader-page--content h3[data-section] {
156
- counter-reset: qj-section calc(attr(data-section, "0") * 10);
157
- }
158
- .reader-page--content h3[data-section]::before {
159
- content: counter(qj-section, qj-cjk-section);
160
- }
161
- ```
162
-
163
- 或更簡單:用 `attr()` 不做 counter,直接在 attribute 做字串映射(CSS 沒這能力時就回到 `@counter-style`)。要 `Chapter 1` / `§1.1` / 純數字無前綴等等,都改一條 `content:` 即可。
164
-
165
- 要點:
166
- - engine 只給 raw counter(`data-chapter="02"`、`data-section="2.1"`)
167
- - 顯示是 theme 的責任
168
- - 換樣式不需要改 markdown、不需要動 engine、不需要 rebuild pagination
169
-
170
- ### Spacing 與 Page Rhythm
171
-
172
- Spacing 定義頁面節奏,不是用來硬塞內容。若一頁過密,優先拆成新的 `##` 頁面,而不是縮小字級或移除留白。
173
-
174
- | Token | Value | 用途 |
175
- | --- | --- | --- |
176
- | `--openpress-space-1` | `2mm` | caption、局部小間距 |
177
- | `--openpress-space-2` | `4mm` | 段落、封面小區塊間距 |
178
- | `--openpress-space-3` | `6mm` | h3 前後、figure margin |
179
- | `--openpress-space-4` | `9mm` | h2 後、TOC 與大區塊 |
180
- | `--openpress-space-5` | `13mm` | 少數需要更大呼吸的頁面區塊 |
181
-
182
- 頁面節奏應該由 heading、paragraph、table、figure 的固定 spacing 自然形成,不用額外插入空白段落。固定版面中,寧可拆章節,也不要把過多內容硬塞在同一頁。
183
-
184
- ### Page Geometry
185
-
186
- 文件實體尺寸由三個 token 共同決定,page-contract 的 `@page`、reader runtime、shell measurement、PDF print route 都讀同一組值。要從 A4 換到 Letter / B5 / 16:9 投影片,改這三條即可,其他 CSS 不用動。
187
-
188
- | Token | Value | 用途 |
189
- | --- | --- | --- |
190
- | `--openpress-page-width` | `210mm` | 紙張寬;`@page size` 第一參數、`.reader-page` width、PDF 印出寬 |
191
- | `--openpress-page-height` | `297mm` | 紙張高;`@page size` 第二參數、`.reader-page` height、PDF 印出高 |
192
- | `--openpress-page-margin` | `18mm` | `@page margin`(CSS print 邊距,不是 body 內容 padding) |
193
-
194
- 切到非 A4 的範例:
195
-
196
- ```css
197
- /* Letter (8.5 × 11 in) */
198
- --openpress-page-width: 215.9mm;
199
- --openpress-page-height: 279.4mm;
200
-
201
- /* B5 */
202
- --openpress-page-width: 176mm;
203
- --openpress-page-height: 250mm;
204
-
205
- /* 16:9 投影片(landscape) */
206
- --openpress-page-width: 297mm;
207
- --openpress-page-height: 167mm;
208
- ```
209
-
210
- body 內容區的 page padding(content margin)由 `.reader-page` 內的 `--page-margin-*` 變數控制,與 `--openpress-page-margin` 是兩件事。前者是「內容到頁面邊緣的距離」,後者是「@page CSS 邊距」(PDF 印出時的物理邊距)。
211
-
212
- ---
213
-
214
- ## 3. Components
215
-
216
- 這一節定義 open-press 生成文件時可以使用的核心元件。Agent 新增內容時,應先判斷資訊類型,再選擇 paragraph、table、figure、chart 或 checklist,而不是為了視覺豐富度任意加入卡片。
217
-
218
- ### Page Surfaces
219
-
220
- | 元件 | Source 寫法 | 視覺規則 | Agent 使用時機 |
221
- | --- | --- | --- | --- |
222
- | Cover | `kind: cover` + HTML cover block | logo 左上、meta 右上、serif 大標、短 subtitle、可選 hero image | 文件開場,建立文件身份 |
223
- | TOC | `kind: toc` 或 exporter 插入 | 自動收集 `##`,顯示章節頁碼;不顯示 footer | 不手寫目錄內容 |
224
- | Chapter opener | `kind: chapter-opener` | H2 主題入口 mini cover,只保留大標、副標與一句 summary;不顯示 footer、不進正式目錄 | 書籍、教材、手冊等章節相對獨立的文件;只放在 `##` 全新主題之前 |
225
- | Chapter page | `##` heading | h2 產生章節頁與 bookmark,章節號由 renderer 注入 | 每個主要概念一個 `##` |
226
- | Back cover | `kind: back-cover` | 大 kicker、收束 statement、短 summary | 文件結尾與品牌收束 |
227
-
228
- ### Text Components
229
-
230
- - **Paragraph**:處理脈絡、判斷、說明與轉折。單段不宜過長;若同段超過三個概念,改成列表或表格。
231
- - **Ordered list**:表示流程、階段、優先順序。
232
- - **Unordered list**:表示同層級規則、注意事項或檢查項。
233
- - **Table**:比較角色、token、component、狀態與輸出規則。Markdown table 前使用 `<TableCaption>...</TableCaption>`,讓 renderer 自動編號。
234
- - **Caption**:必須能獨立說明圖表用途,不只寫「示意圖」。
235
-
236
- ### Tables
237
-
238
- 表格使用 thin-rule style:上方主線、header 底線、row hairline、偶數列淡背景。密集表格的文字比正文小一級,但仍要保留足夠行高。
239
-
240
- <TableCaption>表格使用規則</TableCaption>
241
-
242
- | 表格類型 | 欄位建議 | 注意事項 |
243
- | --- | --- | --- |
244
- | 規格表 | token / value / usage | value 保持短,usage 說明使用情境 |
245
- | 比較表 | item / rule / agent action | 避免超過四欄;長說明移到段落 |
246
- | 檢查表 | check / pass condition / risk | 適合放在章末或封底 |
247
-
248
- ### Figures 與 Charts
249
-
250
- 圖片與圖表都要有 caption,並避免孤立在頁尾。一般圖片使用 `figure`;資料視覺化與大段可重用 HTML 都抽成 PascalCase React component,每個 component 是 `document/components/ComponentName.tsx` 或 `document/components/ComponentName/index.tsx`。
251
-
252
- > **示範元件未隨 starter 提供完整 chart。** editorial-monograph 不預設打包任何 chart 或 bespoke component;專案需要時自己在 `document/components/` 下建立。
253
-
254
- ### Chart Rules
255
-
256
- | 規則 | 說明 |
257
- | --- | --- |
258
- | 資料歸資料 | chart data 透過 React props 或鄰近的 typed data module 傳入,不寫死在 CSS |
259
- | 樣式歸樣式 | chart frame 等通用規則放在 `document/theme/patterns/`;變體 CSS 放在元件自己的 `style.css` |
260
- | 元件歸元件 | 一個視覺 = 一個 `document/components/ComponentName/` 包;MDX 只保留 `<ComponentName />` 呼叫 |
261
- | Caption 必填 | caption 只寫說明文字,不手寫圖號或表號;export pipeline 會替 content pages 的 figure/table 自動編號 |
262
- | PDF-safe | 圖表需 `break-inside: avoid`,高度不可壓到 footer |
263
-
264
- 如果使用者要求新的視覺元件,Agent 應先更新本檔說明,再改對應的 `document/components/<name>/style.css` 或 `document/theme/` CSS,最後用 reader 預覽檢查 PDF 輸出。
265
-
266
- ---
267
-
268
- ## 4. CSS 權責
269
-
270
- | 層級 | 位置 | 責任 |
271
- | --- | --- | --- |
272
- | open-press core | package runtime / `engine/` / `src/openpress/` | Pagination、export、validation、React reader runtime |
273
- | Theme tokens | `document/theme/tokens.css` | CSS variables:color、font、spacing、chart token,不放 selector |
274
- | Theme base | `document/theme/base/` | A4 page contract、cover、TOC、heading、paragraph、figure、table、caption、print |
275
- | Theme patterns | `document/theme/patterns/` | Markdown/HTML class pattern:chart frame、色票、typography specimen、image grid |
276
- | Component-owned CSS | `document/components/ComponentName/style.css` | React component 專用樣式 |
277
- | Theme shell | `document/theme/shell/` | Exported reader controls,不放文件 typography |
278
- | Design Document | `document/design.md` | 說明目前 theme 的規格、取捨與驗收方式 |
279
- | Generated output | `public/openpress/`, `dist-react/` | export/render 產物,不手動修改 |
@@ -1,123 +0,0 @@
1
- import { Frame, Press } from "@open-press/core";
2
- import type { Manifest } from "@open-press/core";
3
- import { mdxSource } from "@open-press/core/mdx";
4
- import { Sections } from "@open-press/core/manuscript";
5
- import Page from "./components/Page";
6
-
7
- export const config: Manifest = {
8
- title: "Your article title goes here",
9
- subtitle: "This is a non-peer reviewed Express letter submitted to J SEDI",
10
- organization: "open-press · academic-paper",
11
- sourceDir: "chapters",
12
- mediaDir: "media",
13
- themeDir: "theme",
14
- designDoc: "design.md",
15
- componentsDir: "components",
16
- publicDir: "public/openpress",
17
- outputDir: "dist-react",
18
- pdf: {
19
- filename: "paper.pdf",
20
- },
21
- deploy: {
22
- adapter: "cloudflare-pages",
23
- source: ".deploy/document",
24
- projectName: null,
25
- commitDirty: false,
26
- requiresConfirmation: true,
27
- },
28
- };
29
-
30
- export const sources = {
31
- story: mdxSource({ preset: "section-folders", root: "chapters" }),
32
- };
33
-
34
- function Cover() {
35
- return (
36
- <Frame
37
- frameKey="cover"
38
- role="manuscript.cover"
39
- chrome={false}
40
- className="reader-page--cover"
41
- data-page-title="Title page"
42
- aria-labelledby="paper-title"
43
- >
44
- <div className="paper-cover">
45
- <p className="paper-cover-date">May 18, 2026 – This is a non-peer reviewed Express letter submitted to J SEDI</p>
46
- <p className="paper-cover-lead">This is a non-peer reviewed Express letter submitted to J SEDI</p>
47
- <p className="paper-cover-short-title">Your short title goes here</p>
48
- <h1 id="paper-title" className="paper-title">
49
- Your article title goes here
50
- <sup>*</sup>
51
- </h1>
52
- <p className="paper-author-contact-note">
53
- <span aria-hidden="true">∗</span> Corresponding author:
54
- firstauthor@university.jp
55
- </p>
56
-
57
- <p className="paper-author-line" aria-label="Authors">
58
- Name Firstauthor<sup>1</sup>, Name Secondauthor<sup>2</sup>, Name
59
- Thirdauthor<sup>1,3</sup>
60
- </p>
61
-
62
- <ol className="paper-author-affiliations" aria-label="Author affiliations">
63
- <li className="paper-author">
64
- <p className="paper-author-affiliation">
65
- 1 Department of Earth Sciences, A University, City, Country
66
- </p>
67
- </li>
68
- <li className="paper-author">
69
- <p className="paper-author-affiliation">
70
- 2 School of Earth Sciences, Another University, City, Country
71
- </p>
72
- </li>
73
- <li className="paper-author">
74
- <p className="paper-author-affiliation">
75
- 3 Center for Studying Cool Things, University of X, City, Country
76
- </p>
77
- </li>
78
- </ol>
79
-
80
- <section className="paper-contributions" aria-label="Author contributions">
81
- <p>
82
- <span className="paper-section-label">Author contributions:</span>{" "}
83
- Conceptualization: Name Firstauthor, Name Thirdauthor. Formal
84
- Analysis: Name Firstauthor, Name Secondauthor.
85
- </p>
86
- <p>
87
- <span className="paper-section-label">Writing - Original draft:</span>{" "}
88
- Name Firstauthor.{" "}
89
- <span className="paper-section-label">
90
- Writing - Review &amp; Editing:
91
- </span>{" "}
92
- Name Firstauthor, Name Secondauthor, Name Thirdauthor.
93
- </p>
94
- </section>
95
-
96
- <section className="paper-abstract" aria-label="Abstract">
97
- <p>
98
- <span className="paper-abstract-label">Abstract</span> The text for the
99
- first abstract goes here. This should be in English, no longer than
100
- 200 words, and should not include references.
101
- </p>
102
- </section>
103
-
104
- <section className="paper-nontechnical-summary" aria-label="Non-technical summary">
105
- <p>
106
- <span className="paper-abstract-label">Non-technical summary</span> The
107
- text for the non-technical summary goes here. Again, no longer than
108
- 200 words, no reference.
109
- </p>
110
- </section>
111
- </div>
112
- </Frame>
113
- );
114
- }
115
-
116
- export default function AcademicPaperPress() {
117
- return (
118
- <Press>
119
- <Cover />
120
- <Sections source="story" page={Page} />
121
- </Press>
122
- );
123
- }
@@ -1,13 +0,0 @@
1
- # media/
2
-
3
- 放這份文件用到的所有圖片、icon、品牌 asset。Markdown 內以 `media/<file>` 引用,會被解析為 `document/media/<file>`。
4
-
5
- 建議檔名規則:
6
-
7
- - 截圖:`<topic>-<screen>.png`
8
- - 場域 / 情境照片:`<topic>-<scene>.jpeg`
9
- - 品牌標誌:`logo-<name>.svg` 或 `logo-<name>.png`
10
- - 概念示意圖:`concept-<name>.png` / `concept-<name>.svg`
11
- - 人物照:`person-<name>.jpg`
12
-
13
- 統一用小寫 + 連字號;非必要避免空白與大寫。
@@ -1,9 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="900" height="540" viewBox="0 0 900 540" role="img" aria-labelledby="title desc">
2
- <title id="title">Figure placeholder</title>
3
- <desc id="desc">Simple figure placeholder graphic with gray border and label</desc>
4
- <rect width="100%" height="100%" fill="#f3f4f6"/>
5
- <rect x="24" y="24" width="852" height="492" fill="none" stroke="#9ca3af" stroke-width="4" stroke-dasharray="18 12" rx="8" />
6
- <text x="50%" y="50%" fill="#4b5563" font-size="44" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" text-anchor="middle" dominant-baseline="middle">
7
- Example Figure Placeholder
8
- </text>
9
- </svg>
@@ -1,26 +0,0 @@
1
- // academic-paper starter — replace with your paper's metadata.
2
- export default {
3
- title: "Paper Title",
4
- subtitle: "An academic-paper draft built with open-press",
5
- organization: "Department · Institution",
6
-
7
- sourceDir: "chapters",
8
- mediaDir: "media",
9
- themeDir: "theme",
10
- designDoc: "design.md",
11
- componentsDir: "components",
12
- publicDir: "public/openpress",
13
- outputDir: "dist-react",
14
-
15
- pdf: {
16
- filename: "paper.pdf",
17
- },
18
-
19
- deploy: {
20
- adapter: "cloudflare-pages",
21
- source: ".deploy/document",
22
- projectName: null,
23
- commitDirty: false,
24
- requiresConfirmation: true,
25
- },
26
- };
@@ -1,11 +0,0 @@
1
- # Theme
2
-
3
- This folder is the source of the document visual system. Keep the layers narrow so agents can change the right file without guessing.
4
-
5
- - `tokens.css`: design variables only. Colors, font families, type scale, spacing, chart colors, and shared numeric tokens live here.
6
- - `base/`: global document rules. Page contract, headings, paragraphs, lists, figures, tables, captions, and print safeguards live here.
7
- - `page-surfaces/`: whole-page layouts routed by `kind`, including cover, TOC, optional chapter opener, and back cover.
8
- - `patterns/`: named document patterns and specimens. Put chart frames, visual blocks, design swatches, image grids, and other class-based content patterns here.
9
- - `shell/`: exported reader controls around the document. Do not put document typography or component styling here.
10
-
11
- Use `document/components/ComponentName/style.css` for CSS that belongs to a React component. Generated files in `public/openpress/` and `dist-react/` are output only.