@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
package/dist/cli.js CHANGED
@@ -19,6 +19,41 @@ import path from "path";
19
19
  import { Readable } from "stream";
20
20
  import { pipeline } from "stream/promises";
21
21
  import { x as extract } from "tar";
22
+ async function degit({ owner, repo, ref = "main", dest, subdir }) {
23
+ const url = `https://codeload.github.com/${owner}/${repo}/tar.gz/refs/heads/${ref}`;
24
+ const tmpDir = await mkdir(path.join(tmpdir(), `open-press-degit-${Date.now()}`), { recursive: true });
25
+ const tarballPath = path.join(tmpDir, "repo.tar.gz");
26
+ try {
27
+ await fetchTo(url, tarballPath);
28
+ await mkdir(dest, { recursive: true });
29
+ const subdirSegments = subdir ? subdir.split("/").filter(Boolean).length : 0;
30
+ const totalStrip = 1 + subdirSegments;
31
+ const filterPrefix = subdir ? subdir.replace(/\/$/, "") + "/" : null;
32
+ await extract({
33
+ file: tarballPath,
34
+ cwd: dest,
35
+ strip: totalStrip,
36
+ filter: (filePath) => {
37
+ const segments = filePath.split("/");
38
+ const inside = segments.slice(1).join("/");
39
+ if (filterPrefix) {
40
+ return inside.startsWith(filterPrefix);
41
+ }
42
+ return true;
43
+ }
44
+ });
45
+ } finally {
46
+ await rm(tmpDir, { recursive: true, force: true }).catch(() => {
47
+ });
48
+ }
49
+ }
50
+ async function fetchTo(url, destFile) {
51
+ const res = await fetch(url, { redirect: "follow" });
52
+ if (!res.ok || !res.body) {
53
+ throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
54
+ }
55
+ await pipeline(Readable.fromWeb(res.body), createWriteStream(destFile));
56
+ }
22
57
  async function pathIsEmpty(target) {
23
58
  try {
24
59
  const s = await stat(target);
@@ -80,14 +115,14 @@ async function patchPackageJsonName(packagePath, newName) {
80
115
  }
81
116
 
82
117
  // src/init.ts
83
- var KNOWN_PACKS = ["editorial-monograph", "claude-document"];
84
- var SKILLS_SOURCE = "quan0715/open-press";
118
+ var BUNDLED_PACKS = ["editorial-monograph", "claude-document", "academic-paper"];
119
+ var FRAMEWORK_SKILLS_SOURCE = "quan0715/open-press";
85
120
  var __dirname = path2.dirname(fileURLToPath(import.meta.url));
86
121
  var TEMPLATE_ROOT = path2.resolve(__dirname, "..", "template");
87
122
  var TEMPLATE_CORE = path2.join(TEMPLATE_ROOT, "core");
88
123
  var TEMPLATE_PACKS = path2.join(TEMPLATE_ROOT, "packs");
89
124
  async function init(options) {
90
- validatePack(options.pack);
125
+ const packSpec = options.pack ? parsePackSpec(options.pack) : null;
91
126
  ensureTemplateBundled();
92
127
  const target = path2.resolve(process.cwd(), options.target);
93
128
  await ensureTarget(target, options.force);
@@ -95,17 +130,40 @@ async function init(options) {
95
130
  log("Copying framework (engine + runtime + config)\u2026");
96
131
  await cp(TEMPLATE_CORE, target, { recursive: true });
97
132
  const docDest = path2.join(target, "document");
98
- if (options.pack) {
99
- log(`Applying style pack: ${options.pack}`);
100
- await rm2(docDest, { recursive: true, force: true });
101
- await mkdir2(docDest, { recursive: true });
102
- const packStarter = path2.join(TEMPLATE_PACKS, options.pack, "document");
133
+ await rm2(docDest, { recursive: true, force: true });
134
+ await mkdir2(docDest, { recursive: true });
135
+ if (packSpec?.kind === "bundled") {
136
+ log(`Applying bundled style pack: ${packSpec.name}`);
137
+ const packStarter = path2.join(TEMPLATE_PACKS, packSpec.name, "document");
103
138
  if (!existsSync(packStarter)) {
104
- throw new Error(`Style pack starter not found in bundle: ${packStarter}`);
139
+ throw new Error(`Bundled style pack starter not found: ${packStarter}`);
105
140
  }
106
141
  await cp(packStarter, docDest, { recursive: true });
107
- } else {
108
- await mkdir2(docDest, { recursive: true });
142
+ } else if (packSpec?.kind === "github") {
143
+ log(`Fetching style pack from github:${packSpec.owner}/${packSpec.repo}${packSpec.ref ? `#${packSpec.ref}` : ""}\u2026`);
144
+ try {
145
+ await degit({
146
+ owner: packSpec.owner,
147
+ repo: packSpec.repo,
148
+ ref: packSpec.ref,
149
+ dest: docDest,
150
+ subdir: "starter/document"
151
+ });
152
+ } catch (err) {
153
+ throw new Error(
154
+ `Failed to fetch pack from github:${packSpec.owner}/${packSpec.repo}: ${err instanceof Error ? err.message : String(err)}`
155
+ );
156
+ }
157
+ if (await pathIsEmpty(docDest)) {
158
+ throw new Error(
159
+ `github:${packSpec.owner}/${packSpec.repo} doesn't contain starter/document/ at the repo root.
160
+ Third-party pack repos should follow this layout:
161
+ <repo>/
162
+ \u251C\u2500\u2500 starter/
163
+ \u2502 \u2514\u2500\u2500 document/ \u2190 cli copies this into your workspace's document/
164
+ \u2514\u2500\u2500 skills/<pack>/SKILL.md \u2190 npx skills add picks this up`
165
+ );
166
+ }
109
167
  }
110
168
  const pkgPath = path2.join(target, "package.json");
111
169
  if (existsSync(pkgPath)) {
@@ -121,13 +179,23 @@ async function init(options) {
121
179
  author: options.author
122
180
  });
123
181
  }
124
- log(`Installing agent skills via \`npx skills add ${SKILLS_SOURCE}\`\u2026`);
182
+ log(`Installing framework skills via \`npx skills add ${FRAMEWORK_SKILLS_SOURCE}\`\u2026`);
125
183
  try {
126
- await runInTarget(target, "npx", ["-y", "skills@latest", "add", SKILLS_SOURCE]);
184
+ await runInTarget(target, "npx", ["-y", "skills@latest", "add", FRAMEWORK_SKILLS_SOURCE]);
127
185
  } catch (err) {
128
- log(`(skills install failed; you can retry manually with \`npx skills add ${SKILLS_SOURCE}\`)`);
186
+ log(`(framework skills install failed; retry: npx skills add ${FRAMEWORK_SKILLS_SOURCE})`);
129
187
  log(` reason: ${err instanceof Error ? err.message : String(err)}`);
130
188
  }
189
+ if (packSpec?.kind === "github") {
190
+ const packSource = `${packSpec.owner}/${packSpec.repo}`;
191
+ log(`Installing pack skills via \`npx skills add ${packSource}\`\u2026`);
192
+ try {
193
+ await runInTarget(target, "npx", ["-y", "skills@latest", "add", packSource]);
194
+ } catch (err) {
195
+ log(`(pack skills install failed; retry: npx skills add ${packSource})`);
196
+ log(` reason: ${err instanceof Error ? err.message : String(err)}`);
197
+ }
198
+ }
131
199
  if (options.install) {
132
200
  log("Installing dependencies (npm install)\u2026");
133
201
  await runInTarget(target, "npm", ["install"]);
@@ -148,6 +216,26 @@ async function init(options) {
148
216
  }
149
217
  printNextSteps(target, options);
150
218
  }
219
+ function parsePackSpec(spec) {
220
+ if (spec.startsWith("github:")) {
221
+ const rest = spec.slice("github:".length);
222
+ const [pathPart, ref] = rest.split("#");
223
+ const segments = pathPart.split("/").filter(Boolean);
224
+ if (segments.length !== 2) {
225
+ throw new Error(
226
+ `Invalid --pack spec: "${spec}". Use github:owner/repo or github:owner/repo#ref.`
227
+ );
228
+ }
229
+ const [owner, repo] = segments;
230
+ return { kind: "github", owner, repo, ref: ref?.trim() || void 0 };
231
+ }
232
+ if (!BUNDLED_PACKS.includes(spec)) {
233
+ throw new Error(
234
+ `Unknown style pack: "${spec}". Bundled packs: ${BUNDLED_PACKS.join(", ")}. For third-party packs use github:owner/repo (e.g. github:quan0715/openpress-pack-nycu-thesis).`
235
+ );
236
+ }
237
+ return { kind: "bundled", name: spec };
238
+ }
151
239
  function ensureTemplateBundled() {
152
240
  if (!existsSync(TEMPLATE_CORE) || !existsSync(TEMPLATE_PACKS)) {
153
241
  throw new Error(
@@ -155,12 +243,6 @@ function ensureTemplateBundled() {
155
243
  );
156
244
  }
157
245
  }
158
- function validatePack(pack) {
159
- if (pack === void 0) return;
160
- if (!KNOWN_PACKS.includes(pack)) {
161
- throw new Error(`Unknown style pack: ${pack}. Known packs: ${KNOWN_PACKS.join(", ")}`);
162
- }
163
- }
164
246
  async function ensureTarget(target, force) {
165
247
  if (existsSync(target)) {
166
248
  if (force) return;
@@ -228,19 +310,28 @@ Usage:
228
310
  npx @open-press/cli init <target> [flags]
229
311
 
230
312
  Flags:
231
- --pack <name> Style pack starter: editorial-monograph | claude-document
313
+ --pack <spec> Style pack source. Either:
314
+ \u2022 a bundled name \u2014 editorial-monograph | claude-document | academic-paper
315
+ \u2022 github:owner/repo (third-party pack)
316
+ \u2022 github:owner/repo#branch-or-tag
232
317
  --title <s> Document title (written to openpress.config.mjs)
233
318
  --subtitle <s> Document subtitle
234
319
  --organization <s> Organization name
235
- --author <s> Author name (defaults to git user.name)
320
+ --author <s> Author name
236
321
  --no-git Skip git init
237
322
  --no-install Skip npm install
238
323
  --force Allow non-empty target
239
324
  --help Show this help
240
325
 
241
326
  Examples:
327
+ # Bundled
242
328
  npx @open-press/cli init my-doc --pack editorial-monograph
243
- npx @open-press/cli init my-doc --pack claude-document --title "Q2 Brief" --author Quan
329
+ npx @open-press/cli init my-brief --pack claude-document --title "Q2 Brief" --author Quan
330
+ npx @open-press/cli init my-paper --pack academic-paper --title "Paper Title" --author "First Author"
331
+
332
+ # Third-party (any GitHub repo with starter/document/ at the root)
333
+ npx @open-press/cli init my-thesis --pack github:quan0715/openpress-pack-nycu-thesis
334
+ npx @open-press/cli init my-paper --pack github:foo/their-pack#v1.2
244
335
  `;
245
336
  async function main(argv) {
246
337
  if (argv.length === 0 || argv.includes("--help") || argv.includes("-h")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-press/cli",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "Scaffolder for open-press — AI-first fixed-layout document workspaces.",
6
6
  "license": "MIT",
@@ -1,5 +1,38 @@
1
1
  # @open-press/core
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f8fdecd: Third bundled pack: `academic-paper`.
8
+
9
+ A single-column A4 academic / research paper starter — serif title block, abstract band, index terms, numbered sections (I, II, III), italic sub-sections (A, B, C), `[N]` numeric references, sample chapters derived from the IEEE conference template structure (Introduction, Methods, Results & Discussion, Acknowledgment, References).
10
+
11
+ ```bash
12
+ npx @open-press/cli init my-paper --pack academic-paper
13
+ ```
14
+
15
+ Suitable for: draft / preprint / iteration. Not suitable for camera-ready IEEE / ACM submission — those still need LaTeX with the publisher's class file.
16
+
17
+ Two-column body and other paged-document features (footnotes, cross-references with page numbers, running headers) are intentionally **out of scope for this release**. They'll be designed as a self-maintained engine evolution + multi-mode architecture in a separate spec round, rather than depending on a third-party pagination polyfill.
18
+
19
+ - c490653: `@open-press/cli init` accepts third-party style packs via `--pack github:owner/repo`.
20
+
21
+ ```bash
22
+ # bundled (unchanged)
23
+ npx @open-press/cli init my-doc --pack editorial-monograph
24
+
25
+ # third-party (new)
26
+ npx @open-press/cli init my-thesis --pack github:quan0715/openpress-pack-nycu-thesis
27
+ npx @open-press/cli init my-paper --pack github:foo/their-pack#v1.2
28
+ ```
29
+
30
+ The cli fetches `starter/document/` from the named repo (default branch, or `#ref` for a specific branch/tag) and copies it into the new workspace. If the pack repo also publishes SKILL files at `skills/<name>/`, they're installed via `npx skills add <owner>/<repo>` after the framework skills, so the agent picks them up automatically.
31
+
32
+ Repo layout convention for third-party packs is documented in `docs/style-pack-authoring.md`. Empty-result extraction (the named repo exists but has no `starter/document/` at root) fails with a clear error pointing at the expected layout.
33
+
34
+ The two bundled packs (`editorial-monograph`, `claude-document`) keep their current short-name behaviour; only the cli's validator widened to accept the `github:` prefix.
35
+
3
36
  ## 0.5.0
4
37
 
5
38
  ### Minor Changes
@@ -7,7 +40,6 @@
7
40
  - 0169cba: Agent-driven upgrade flow.
8
41
 
9
42
  **New commands:**
10
-
11
43
  - `npx open-press doctor` — diagnose workspace against latest framework state. Reports `@open-press/core` version vs npm latest, installed skill count, and any pending `docs/migrations/<version>.md` notes between current and latest. `--json` for machine-readable output, `--no-cache` to bypass the 24h cache. Always exits 0 (informational only).
12
44
 
13
45
  - `npx open-press upgrade` — orchestrate the upgrade. Runs `npm update @open-press/core` (when the workspace declares the dep) and `npx skills upgrade`, then surfaces the list of migration notes for the agent to read. **Does not auto-edit `document/` content** — the agent reads the surfaced `docs/migrations/<version>.md` notes and proposes edits to the user with confirmation. Use `--dry-run` to preview, `--no-deps` / `--no-skills` to target one layer.
@@ -17,7 +49,6 @@
17
49
  `open-press dev` now runs `doctor` before starting Vite. When the workspace is behind, a single line prints: `○ open-press: @open-press/core 0.4.0 → 0.5.0 · 1 migration note(s) — run npx open-press doctor for details.` Cached for 24h, network failure is silent, never blocks dev.
18
50
 
19
51
  **Migration docs:**
20
-
21
52
  - New `docs/migrations/_template.md` — each release with breaking changes ships a `docs/migrations/<version>.md` file with sections the agent reads.
22
53
  - New `docs/migrations/0.4.0.md` — backfilled. Documents the SKILL fold (no document or CLI changes).
23
54
 
@@ -34,7 +65,6 @@
34
65
  ### Minor Changes
35
66
 
36
67
  - 3cb4939: Consolidate internal skills (13 → 11).
37
-
38
68
  - `openpress-update` folded into `openpress` as an "Updating An Existing Workspace" section. The release-upgrade flow, pre-flight checks, breaking-change reference, and do-not list are now part of the system-operation skill where they naturally belong.
39
69
  - `openpress-document-hierarchy` folded into `openpress-writing` as a "Hierarchy" section. Hierarchy decisions (H2/H3/H4 model, TOC depth, appendix placement, H4 granularity) and prose decisions happen in the same workflow; one skill, one routing decision.
40
70
  - `references/data-structures-outline.md` moved from the hierarchy skill into `openpress-writing/references/`.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-press/core",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "open-press core — runtime primitives, CLI, and render pipeline for AI-first fixed-layout documents.",
6
6
  "license": "MIT",
@@ -0,0 +1,21 @@
1
+ ## Introduction
2
+
3
+ This document is a model and starting point for an academic paper drafted in open-press. The structure follows the IEEE conference template conventions where they make sense for screen-first reading: numbered sections, italic sub-sections, an abstract block, and a numbered references list. The two-column body of IEEEtran is not yet supported — single-column will land as the v0.8 paged.js migration arrives.
4
+
5
+ Use this pack for **drafting, iteration, and preprint distribution**. When the paper is ready for venue submission, export the prose into the publisher's required LaTeX class (`IEEEtran`, `acmart`, etc.). The pack does not replace LaTeX for camera-ready submission; it replaces the awkward iteration loop *before* submission.
6
+
7
+ ### Where to start
8
+
9
+ Each chapter directory under `document/chapters/` is one paper section:
10
+
11
+ - `01-introduction/` — motivate the work, state the contribution, summarise the structure.
12
+ - `02-methods/` — describe what you did, with enough detail to reproduce.
13
+ - `03-results-and-discussion/` — present results with figures and tables; interpret what they mean.
14
+ - `04-acknowledgment/` — acknowledge funding, collaborators, reviewers.
15
+ - `05-references/` — numbered `[1]`, `[2]` references.
16
+
17
+ Replace each chapter's MDX content with your own. The skeleton text below each `##` heading is illustrative — overwrite it.
18
+
19
+ ### Abstract and Index Terms
20
+
21
+ Edit the abstract and index terms inside `document/index.tsx` (the `cover` JSX export). They render on the title page above the body. Keep the abstract under 250 words and avoid abbreviations, symbols, or math in it.
@@ -0,0 +1,30 @@
1
+ ## Methods
2
+
3
+ Describe the materials, instruments, datasets, models, or procedures you used. Anyone familiar with the field should be able to reproduce your work from this section.
4
+
5
+ ### Apparatus and Materials
6
+
7
+ Specify hardware, software versions, datasets, and any pre-processing. Cite reused work using `[N]` numeric references (e.g. "we trained the encoder following the procedure of [3]").
8
+
9
+ ### Procedure
10
+
11
+ Describe the experimental procedure as steps a reader could follow:
12
+
13
+ 1. State the input data and pre-processing.
14
+ 2. State the model / algorithm / instrument settings.
15
+ 3. State the evaluation metric(s) and any held-out splits.
16
+ 4. State randomness control (seeds, repeats, confidence reporting).
17
+
18
+ ### Notation
19
+
20
+ Define notation early. Italicise Roman symbols for quantities and variables, but not Greek symbols. Use a long dash rather than a hyphen for a minus sign. Number equations consecutively:
21
+
22
+ $$a + b = \gamma \tag{1}$$
23
+
24
+ Refer to equations by `(1)`, not `Eq. (1)` or `equation (1)`, except at the start of a sentence: "Equation (1) shows ...".
25
+
26
+ ### Reporting Units
27
+
28
+ - Use SI (MKS) as primary units; English units only as secondary (in parentheses).
29
+ - Don't mix complete spellings and abbreviations: "Wb/m²" or "webers per square meter", not "webers/m²".
30
+ - Use a zero before decimal points: `0.25`, not `.25`.
@@ -0,0 +1,29 @@
1
+ ## Results and Discussion
2
+
3
+ Present the findings of your study, then interpret what they mean for the research question stated in the introduction.
4
+
5
+ ### Quantitative Results
6
+
7
+ Use a table to summarise results across conditions. Caption above the table.
8
+
9
+ <TableCaption>Sample comparison of conditions.</TableCaption>
10
+
11
+ | Condition | Metric A | Metric B | Notes |
12
+ | --- | --- | --- | --- |
13
+ | Baseline | 0.71 | 0.65 | Prior work [3] |
14
+ | Ours (v1) | 0.78 | 0.69 | This work |
15
+ | Ours (v2) | **0.83** | **0.72** | Best |
16
+
17
+ Cite figures and tables in the text the first time they appear: "Fig. 1 shows the architecture", "Table I summarises the conditions". Use `Fig.` even at the start of a sentence; spell out `Figure` only when it is the subject.
18
+
19
+ ### Qualitative Discussion
20
+
21
+ Discuss what the results mean. State the limitations honestly — if the experiment doesn't cover a case you'd like to claim, say so. Avoid the word "essentially" when you mean "approximately" or "effectively".
22
+
23
+ ### Threats to Validity
24
+
25
+ Briefly list what could invalidate the results: small sample size, single dataset, environmental drift, evaluator bias, etc. Reviewers will look for this section; pre-empt it.
26
+
27
+ ### Future Work
28
+
29
+ Indicate where the work goes next. Keep this to one short paragraph — over-claiming future scope hurts more than it helps in review.
@@ -0,0 +1,12 @@
1
+ ## Acknowledgment
2
+
3
+ The preferred American spelling is *acknowledgment* without an "e" after the "g". Avoid stilted constructions like "one of us (R. B. G.) thanks ...". Prefer "R. B. G. thanks ...".
4
+
5
+ Acknowledge:
6
+
7
+ - Funding sources (with grant numbers if applicable).
8
+ - Collaborators who contributed materially but are not listed as authors.
9
+ - Anonymous reviewers whose comments improved the paper.
10
+ - Institutional or computational resources.
11
+
12
+ Place sponsor acknowledgments in the unnumbered footnote on the first page of the published version. In this draft pack, keep them here until you migrate to a publisher's class file at submission time.
@@ -0,0 +1,27 @@
1
+ ## References
2
+
3
+ Number citations consecutively within square brackets `[1]`. Sentence punctuation follows the bracket. Refer simply to the reference number, as in `[3]` — do not use `Ref. [3]` or `reference [3]` except at the start of a sentence: "Reference [3] was the first ...".
4
+
5
+ Unless there are six authors or more, give all authors' names; do not use `et al.`. Papers not yet published should be cited as *unpublished*; accepted but not yet published as *in press*. Capitalize only the first word in a paper title, except for proper nouns and element symbols.
6
+
7
+ For papers published in translation journals, give the English citation first, followed by the original foreign-language citation.
8
+
9
+ ---
10
+
11
+ [1] G. Eason, B. Noble, and I. N. Sneddon, "On certain integrals of Lipschitz–Hankel type involving products of Bessel functions," *Phil. Trans. Roy. Soc. London*, vol. A247, pp. 529–551, April 1955.
12
+
13
+ [2] J. Clerk Maxwell, *A Treatise on Electricity and Magnetism*, 3rd ed., vol. 2. Oxford: Clarendon, 1892, pp. 68–73.
14
+
15
+ [3] I. S. Jacobs and C. P. Bean, "Fine particles, thin films and exchange anisotropy," in *Magnetism*, vol. III, G. T. Rado and H. Suhl, Eds. New York: Academic, 1963, pp. 271–350.
16
+
17
+ [4] K. Elissa, "Title of paper if known," unpublished.
18
+
19
+ [5] R. Nicole, "Title of paper with only first word capitalized," *J. Name Stand. Abbrev.*, in press.
20
+
21
+ [6] Y. Yorozu, M. Hirano, K. Oka, and Y. Tagawa, "Electron spectroscopy studies on magneto-optical media and plastic substrate interface," *IEEE Transl. J. Magn. Japan*, vol. 2, pp. 740–741, August 1987.
22
+
23
+ [7] M. Young, *The Technical Writer's Handbook*. Mill Valley, CA: University Science, 1989.
24
+
25
+ ---
26
+
27
+ > **Reminder**: replace the seven placeholder references above with your own bibliography before circulating the draft. They are the IEEE conference template's example citations and have nothing to do with your paper.
@@ -0,0 +1,76 @@
1
+ const TONES = new Set(["sage", "lavender", "mint", "amber"]);
2
+
3
+ const VISUALS = {
4
+ "linked-list": `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
5
+ <rect class="chapter-opener-illustration__paper" x="42" y="96" width="116" height="82" rx="4" />
6
+ <rect class="chapter-opener-illustration__paper" x="204" y="96" width="116" height="82" rx="4" />
7
+ <rect class="chapter-opener-illustration__paper" x="366" y="96" width="116" height="82" rx="4" />
8
+ <path class="chapter-opener-illustration__stroke" d="M158 137 H204" />
9
+ <path class="chapter-opener-illustration__stroke" d="M320 137 H366" />
10
+ <path class="chapter-opener-illustration__arrow" d="M190 122 206 137 190 152" />
11
+ <path class="chapter-opener-illustration__arrow" d="M352 122 368 137 352 152" />
12
+ <path class="chapter-opener-illustration__thin" d="M72 128 H118 M72 150 H128 M234 128 H280 M234 150 H286 M396 128 H442 M396 150 H452" />
13
+ <circle class="chapter-opener-illustration__node" cx="144" cy="137" r="13" />
14
+ <circle class="chapter-opener-illustration__node" cx="306" cy="137" r="13" />
15
+ <circle class="chapter-opener-illustration__node" cx="468" cy="137" r="13" />
16
+ <path class="chapter-opener-illustration__stroke" d="M262 178 C262 222 220 244 158 244 C98 244 68 222 68 190" />
17
+ <path class="chapter-opener-illustration__arrow" d="M52 204 68 188 84 204" />
18
+ </svg>`,
19
+ tree: `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
20
+ <path class="chapter-opener-illustration__paper" d="M232 40 316 40 352 86 330 132 218 132 194 86Z" />
21
+ <path class="chapter-opener-illustration__paper" d="M88 198 170 178 228 218 204 288 100 288 58 240Z" />
22
+ <path class="chapter-opener-illustration__paper" d="M314 198 400 176 466 224 450 292 328 292 282 238Z" />
23
+ <path class="chapter-opener-illustration__stroke" d="M262 118 160 214 M270 118 374 214" />
24
+ <path class="chapter-opener-illustration__stroke" d="M160 214 122 258 M160 214 204 258 M374 214 330 258 M374 214 420 258" />
25
+ <circle class="chapter-opener-illustration__node" cx="266" cy="100" r="24" />
26
+ <circle class="chapter-opener-illustration__node" cx="160" cy="214" r="22" />
27
+ <circle class="chapter-opener-illustration__node" cx="374" cy="214" r="22" />
28
+ <circle class="chapter-opener-illustration__dot" cx="122" cy="258" r="13" />
29
+ <circle class="chapter-opener-illustration__dot" cx="204" cy="258" r="13" />
30
+ <circle class="chapter-opener-illustration__dot" cx="330" cy="258" r="13" />
31
+ <circle class="chapter-opener-illustration__dot" cx="420" cy="258" r="13" />
32
+ </svg>`,
33
+ code: `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
34
+ <path class="chapter-opener-illustration__paper" d="M92 52 338 52 386 104 386 286 92 286Z" />
35
+ <path class="chapter-opener-illustration__paper" d="M348 82 438 82 476 122 452 226 356 226 326 154Z" />
36
+ <path class="chapter-opener-illustration__thin" d="M132 112 H250 M132 146 H292 M132 180 H238 M132 214 H276" />
37
+ <path class="chapter-opener-illustration__stroke" d="M308 114 C340 122 356 148 356 180 C356 220 332 244 292 250" />
38
+ <path class="chapter-opener-illustration__arrow" d="M304 226 288 250 316 260" />
39
+ <path class="chapter-opener-illustration__stroke" d="M406 124 V202" />
40
+ <circle class="chapter-opener-illustration__node" cx="406" cy="124" r="17" />
41
+ <circle class="chapter-opener-illustration__node" cx="406" cy="202" r="17" />
42
+ </svg>`,
43
+ answers: `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
44
+ <path class="chapter-opener-illustration__paper" d="M128 44 396 44 440 90 418 292 104 292 82 86Z" />
45
+ <path class="chapter-opener-illustration__thin" d="M178 116 H350 M178 168 H350 M178 220 H322" />
46
+ <path class="chapter-opener-illustration__stroke" d="M128 112 148 134 190 88" />
47
+ <path class="chapter-opener-illustration__stroke" d="M128 164 148 186 190 140" />
48
+ <path class="chapter-opener-illustration__stroke" d="M128 216 148 238 190 192" />
49
+ <circle class="chapter-opener-illustration__node" cx="386" cy="92" r="18" />
50
+ <path class="chapter-opener-illustration__stroke" d="M386 92 C420 126 424 172 394 208" />
51
+ <path class="chapter-opener-illustration__arrow" d="M380 186 394 210 420 200" />
52
+ </svg>`,
53
+ };
54
+
55
+ export type ChapterOpenerVisualVariant = keyof typeof VISUALS;
56
+
57
+ export interface ChapterOpenerVisualProps {
58
+ variant?: ChapterOpenerVisualVariant;
59
+ tone?: string;
60
+ }
61
+
62
+ export default function ChapterOpenerVisual({
63
+ variant = "linked-list",
64
+ tone = "sage",
65
+ }: ChapterOpenerVisualProps) {
66
+ const visual = VISUALS[variant] ?? VISUALS["linked-list"];
67
+ const safeTone = TONES.has(tone) ? tone : "sage";
68
+
69
+ return (
70
+ <figure
71
+ className={`chapter-opener-illustration chapter-opener-illustration--${variant} chapter-opener-tone--${safeTone}`}
72
+ aria-hidden="true"
73
+ dangerouslySetInnerHTML={{ __html: visual }}
74
+ />
75
+ );
76
+ }
@@ -0,0 +1,27 @@
1
+ import type { PageProps } from "@openpress/core";
2
+
3
+ export default function Page({
4
+ pageIndex,
5
+ totalPages,
6
+ chapterSlug,
7
+ chapterTone,
8
+ children,
9
+ }: PageProps) {
10
+ return (
11
+ <section
12
+ className="reader-page reader-page--content"
13
+ data-page-kind="content"
14
+ data-page-footer="true"
15
+ data-page-index={pageIndex}
16
+ data-total-pages={totalPages}
17
+ data-chapter-slug={chapterSlug}
18
+ data-chapter-tone={chapterTone}
19
+ >
20
+ <div className="page-frame">
21
+ <header className="page-header" aria-hidden="true" />
22
+ <main className="page-body">{children}</main>
23
+ <footer className="page-footer" aria-hidden="true" />
24
+ </div>
25
+ </section>
26
+ );
27
+ }
@@ -0,0 +1,46 @@
1
+ import type { CSSProperties } from "react";
2
+
3
+ export interface TokenSwatch {
4
+ name: string;
5
+ hex: string;
6
+ summary: string;
7
+ swatchVar: string;
8
+ swatchBorderVar?: string;
9
+ dark?: boolean;
10
+ }
11
+
12
+ export interface TokenSwatchGridProps {
13
+ ariaLabel?: string;
14
+ swatches: TokenSwatch[];
15
+ }
16
+
17
+ export default function TokenSwatchGrid({
18
+ ariaLabel = "Color specimen",
19
+ swatches,
20
+ }: TokenSwatchGridProps) {
21
+ return (
22
+ <section className="token-swatch-grid" data-openpress-component="TokenSwatchGrid" aria-label={ariaLabel}>
23
+ {swatches.map((swatch) => (
24
+ <article
25
+ key={swatch.name}
26
+ className={swatch.dark ? "token-swatch token-swatch--dark" : "token-swatch"}
27
+ style={swatchStyle(swatch)}
28
+ >
29
+ <div className="token-swatch__sample" />
30
+ <div className="token-swatch__body">
31
+ <h4>{swatch.name}</h4>
32
+ <code>{swatch.hex}</code>
33
+ <p>{swatch.summary}</p>
34
+ </div>
35
+ </article>
36
+ ))}
37
+ </section>
38
+ );
39
+ }
40
+
41
+ function swatchStyle(swatch: TokenSwatch): CSSProperties {
42
+ return {
43
+ "--swatch": swatch.swatchVar,
44
+ ...(swatch.swatchBorderVar ? { "--swatch-border": swatch.swatchBorderVar } : {}),
45
+ } as CSSProperties;
46
+ }
@@ -0,0 +1,63 @@
1
+ /* token-swatch-grid
2
+ * Color specimen grid referenced by design.md to display each color token with
3
+ * its sample, hex, and usage note.
4
+ */
5
+
6
+ .token-swatch-grid {
7
+ display: grid;
8
+ grid-template-columns: repeat(3, minmax(0, 1fr));
9
+ gap: 3mm;
10
+ margin: var(--openpress-space-3) 0 var(--openpress-space-4);
11
+ break-inside: avoid;
12
+ }
13
+
14
+ .token-swatch {
15
+ min-height: 42mm;
16
+ overflow: hidden;
17
+ border: 1px solid var(--openpress-color-line);
18
+ border-radius: 6px;
19
+ background: var(--openpress-color-document);
20
+ box-sizing: border-box;
21
+ break-inside: avoid;
22
+ }
23
+
24
+ .token-swatch__sample {
25
+ height: 17mm;
26
+ background: var(--swatch);
27
+ border-bottom: 1px solid var(--swatch-border, var(--openpress-color-line));
28
+ }
29
+
30
+ .token-swatch__body {
31
+ padding: 3mm;
32
+ }
33
+
34
+ .token-swatch h4 {
35
+ margin: 0;
36
+ color: var(--openpress-color-ink);
37
+ font-family: var(--openpress-font-body);
38
+ font-size: 9pt;
39
+ font-weight: 600;
40
+ line-height: 1.25;
41
+ letter-spacing: 0;
42
+ }
43
+
44
+ .token-swatch code {
45
+ display: block;
46
+ margin-top: 1mm;
47
+ color: var(--openpress-color-muted);
48
+ font-size: 8pt;
49
+ line-height: 1.35;
50
+ }
51
+
52
+ .token-swatch p {
53
+ margin: 2mm 0 0;
54
+ color: #333333;
55
+ font-size: 8.4pt;
56
+ line-height: 1.45;
57
+ }
58
+
59
+ @media (max-width: 899px) {
60
+ .token-swatch-grid {
61
+ grid-template-columns: repeat(2, minmax(0, 1fr));
62
+ }
63
+ }