paperlint 4.2.0 → 6.0.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 (251) hide show
  1. package/CLAUDE.md +15 -2
  2. package/CONTRIBUTING.md +3 -0
  3. package/README.md +23 -12
  4. package/action.harness.mjs +54 -36
  5. package/action.yml +12 -27
  6. package/bin/paperlint.mjs +5 -1
  7. package/dist/adapters/latex/includes.d.ts +5 -1
  8. package/dist/adapters/latex/includes.d.ts.map +1 -1
  9. package/dist/adapters/latex/includes.js +8 -2
  10. package/dist/adapters/latex/includes.js.map +1 -1
  11. package/dist/adapters/latex/index.d.ts +1 -0
  12. package/dist/adapters/latex/index.d.ts.map +1 -1
  13. package/dist/adapters/latex/index.js +3 -0
  14. package/dist/adapters/latex/index.js.map +1 -1
  15. package/dist/adapters/latex/layout.d.ts +27 -0
  16. package/dist/adapters/latex/layout.d.ts.map +1 -0
  17. package/dist/adapters/latex/layout.js +62 -0
  18. package/dist/adapters/latex/layout.js.map +1 -0
  19. package/dist/adapters/latex/nodes.d.ts.map +1 -1
  20. package/dist/adapters/latex/nodes.js +11 -1
  21. package/dist/adapters/latex/nodes.js.map +1 -1
  22. package/dist/adapters/latex/parse.d.ts.map +1 -1
  23. package/dist/adapters/latex/parse.js +5 -1
  24. package/dist/adapters/latex/parse.js.map +1 -1
  25. package/dist/build.d.ts.map +1 -1
  26. package/dist/build.js +7 -3
  27. package/dist/build.js.map +1 -1
  28. package/dist/cli.d.ts +2 -8
  29. package/dist/cli.d.ts.map +1 -1
  30. package/dist/cli.js +92 -42
  31. package/dist/cli.js.map +1 -1
  32. package/dist/domain/anonymity.d.ts +68 -0
  33. package/dist/domain/anonymity.d.ts.map +1 -0
  34. package/dist/domain/anonymity.js +94 -0
  35. package/dist/domain/anonymity.js.map +1 -0
  36. package/dist/domain/body-pages.d.ts +69 -0
  37. package/dist/domain/body-pages.d.ts.map +1 -0
  38. package/dist/domain/body-pages.js +141 -0
  39. package/dist/domain/body-pages.js.map +1 -0
  40. package/dist/domain/paper-source.js +2 -2
  41. package/dist/domain/tex-document.d.ts +9 -0
  42. package/dist/domain/tex-document.d.ts.map +1 -1
  43. package/dist/eslint-rules/latex-language.d.ts +5 -1
  44. package/dist/eslint-rules/latex-language.d.ts.map +1 -1
  45. package/dist/eslint-rules/latex-language.js +6 -3
  46. package/dist/eslint-rules/latex-language.js.map +1 -1
  47. package/dist/eslint-rules/paper-context.d.ts +20 -0
  48. package/dist/eslint-rules/paper-context.d.ts.map +1 -0
  49. package/dist/eslint-rules/paper-context.js +44 -0
  50. package/dist/eslint-rules/paper-context.js.map +1 -0
  51. package/dist/eslint-rules/paper-typography.d.ts +1 -1
  52. package/dist/eslint-rules/paper-typography.d.ts.map +1 -1
  53. package/dist/eslint-rules/paper-typography.js +32 -18
  54. package/dist/eslint-rules/paper-typography.js.map +1 -1
  55. package/dist/eslint-rules/pdf-last-page-balance.d.ts +1 -1
  56. package/dist/eslint-rules/pdf-last-page-balance.js +2 -2
  57. package/dist/eslint-rules/tex-build.d.ts.map +1 -1
  58. package/dist/eslint-rules/tex-build.js +7 -1
  59. package/dist/eslint-rules/tex-build.js.map +1 -1
  60. package/dist/facts-file.d.ts +28 -2
  61. package/dist/facts-file.d.ts.map +1 -1
  62. package/dist/facts-file.js +54 -9
  63. package/dist/facts-file.js.map +1 -1
  64. package/dist/init.d.ts +4 -19
  65. package/dist/init.d.ts.map +1 -1
  66. package/dist/init.js +24 -29
  67. package/dist/init.js.map +1 -1
  68. package/dist/lib/paper-config.d.ts.map +1 -1
  69. package/dist/lib/paper-config.js +2 -1
  70. package/dist/lib/paper-config.js.map +1 -1
  71. package/dist/package-dirs.d.ts +2 -0
  72. package/dist/package-dirs.d.ts.map +1 -1
  73. package/dist/package-dirs.js +8 -0
  74. package/dist/package-dirs.js.map +1 -1
  75. package/dist/paper-files.d.ts +2 -2
  76. package/dist/paper-includes.d.ts +17 -0
  77. package/dist/paper-includes.d.ts.map +1 -0
  78. package/dist/paper-includes.js +51 -0
  79. package/dist/paper-includes.js.map +1 -0
  80. package/dist/paper-settings.d.ts +11 -0
  81. package/dist/paper-settings.d.ts.map +1 -1
  82. package/dist/paper-settings.js +38 -4
  83. package/dist/paper-settings.js.map +1 -1
  84. package/dist/pdf-content.d.ts +40 -0
  85. package/dist/pdf-content.d.ts.map +1 -0
  86. package/dist/pdf-content.js +97 -0
  87. package/dist/pdf-content.js.map +1 -0
  88. package/dist/pdf-facts.d.ts +30 -0
  89. package/dist/pdf-facts.d.ts.map +1 -1
  90. package/dist/pdf-facts.js +37 -1
  91. package/dist/pdf-facts.js.map +1 -1
  92. package/dist/ports/latex.d.ts +3 -1
  93. package/dist/ports/latex.d.ts.map +1 -1
  94. package/dist/presets.d.ts +2 -0
  95. package/dist/presets.d.ts.map +1 -1
  96. package/dist/presets.js +4 -0
  97. package/dist/presets.js.map +1 -1
  98. package/dist/rules-config.d.ts +1 -0
  99. package/dist/rules-config.d.ts.map +1 -1
  100. package/dist/rules-config.js.map +1 -1
  101. package/dist/structure.js +1 -1
  102. package/dist/structure.js.map +1 -1
  103. package/dist/tex-paper.d.ts +17 -3
  104. package/dist/tex-paper.d.ts.map +1 -1
  105. package/dist/tex-paper.js +36 -38
  106. package/dist/tex-paper.js.map +1 -1
  107. package/dist/tex-requirements.d.ts +4 -0
  108. package/dist/tex-requirements.d.ts.map +1 -1
  109. package/dist/tex-requirements.js +3 -0
  110. package/dist/tex-requirements.js.map +1 -1
  111. package/dist/tex-venue-rules.d.ts +7 -1
  112. package/dist/tex-venue-rules.d.ts.map +1 -1
  113. package/dist/tex-venue-rules.js +40 -0
  114. package/dist/tex-venue-rules.js.map +1 -1
  115. package/dist/types.d.ts +2 -0
  116. package/dist/types.d.ts.map +1 -1
  117. package/dist/venue-rules.d.ts +38 -8
  118. package/dist/venue-rules.d.ts.map +1 -1
  119. package/dist/venue-rules.js +179 -41
  120. package/dist/venue-rules.js.map +1 -1
  121. package/docs/configuration.md +23 -20
  122. package/docs/e2e.md +32 -11
  123. package/docs/install.md +8 -8
  124. package/docs/prior-art/paper-folder-scaffolding.md +4 -7
  125. package/docs/rules/anonymity/identity.md +111 -0
  126. package/docs/rules/format/layout-override.md +61 -0
  127. package/docs/rules/format/page-limit.md +108 -0
  128. package/docs/rules/pdf/body-size.md +87 -0
  129. package/docs/rules.md +55 -46
  130. package/eslint-rules/latex-language.ts +10 -4
  131. package/eslint-rules/paper-context.test.ts +47 -0
  132. package/eslint-rules/paper-context.ts +57 -0
  133. package/eslint-rules/paper-typography.ts +67 -23
  134. package/eslint-rules/pdf-last-page-balance.harness.mjs +6 -1
  135. package/eslint-rules/pdf-last-page-balance.ts +2 -2
  136. package/eslint-rules/tex-build.ts +8 -1
  137. package/fixtures/build-e2e/aidc/expect.json +1 -1
  138. package/fixtures/build-e2e/aidc/paperlint.json +1 -1
  139. package/fixtures/build-e2e/anon-ack/PIPELINE-STATUS.md +3 -0
  140. package/fixtures/build-e2e/anon-ack/expect.json +19 -0
  141. package/fixtures/build-e2e/anon-ack/paper.tex +31 -0
  142. package/fixtures/build-e2e/anon-ack/paperlint.json +1 -0
  143. package/fixtures/build-e2e/anon-author/PIPELINE-STATUS.md +3 -0
  144. package/fixtures/build-e2e/anon-author/expect.json +19 -0
  145. package/fixtures/build-e2e/anon-author/paper.tex +29 -0
  146. package/fixtures/build-e2e/anon-author/paperlint.json +1 -0
  147. package/fixtures/build-e2e/anon-bib/PIPELINE-STATUS.md +3 -0
  148. package/fixtures/build-e2e/anon-bib/expect.json +20 -0
  149. package/fixtures/build-e2e/anon-bib/paper.tex +35 -0
  150. package/fixtures/build-e2e/anon-bib/paperlint.json +1 -0
  151. package/fixtures/build-e2e/anon-href/PIPELINE-STATUS.md +3 -0
  152. package/fixtures/build-e2e/anon-href/expect.json +19 -0
  153. package/fixtures/build-e2e/anon-href/paper.tex +30 -0
  154. package/fixtures/build-e2e/anon-href/paperlint.json +1 -0
  155. package/fixtures/build-e2e/anon-macro/PIPELINE-STATUS.md +3 -0
  156. package/fixtures/build-e2e/anon-macro/expect.json +19 -0
  157. package/fixtures/build-e2e/anon-macro/paper.tex +30 -0
  158. package/fixtures/build-e2e/anon-macro/paperlint.json +1 -0
  159. package/fixtures/build-e2e/anon-pdfauthor/PIPELINE-STATUS.md +3 -0
  160. package/fixtures/build-e2e/anon-pdfauthor/expect.json +19 -0
  161. package/fixtures/build-e2e/anon-pdfauthor/paper.tex +31 -0
  162. package/fixtures/build-e2e/anon-pdfauthor/paperlint.json +1 -0
  163. package/fixtures/build-e2e/unbalanced/expect.json +2 -2
  164. package/fixtures/real-markdown-paper/baseline.json +1 -2
  165. package/lib/paper-config.ts +3 -1
  166. package/package.json +1 -1
  167. package/presets/acm-sigconf.jsonc +3 -1
  168. package/presets/aidc.jsonc +16 -17
  169. package/presets/ieee-conference.jsonc +8 -0
  170. package/presets/venue-profile.schema.json +9 -0
  171. package/scripts/check.ts +2 -2
  172. package/scripts/eslint-report-guard.mjs +5 -2
  173. package/scripts/harness-api.frozen.json +0 -1
  174. package/skills/paper-pipeline/references/pipeline-status-template.md +2 -16
  175. package/skills/render-paper/extract-pdf-facts.harness.ts +3 -3
  176. package/src/adapters/latex/includes.ts +10 -2
  177. package/src/adapters/latex/index.test.ts +8 -0
  178. package/src/adapters/latex/index.ts +3 -0
  179. package/src/adapters/latex/layout.ts +106 -0
  180. package/src/adapters/latex/nodes.ts +11 -3
  181. package/src/adapters/latex/parse.ts +5 -1
  182. package/src/build.harness.mjs +6 -4
  183. package/src/build.test.ts +23 -1
  184. package/src/build.ts +7 -3
  185. package/src/cli.harness.mjs +22 -54
  186. package/src/cli.test.ts +15 -18
  187. package/src/cli.ts +114 -46
  188. package/src/domain/anonymity.test.ts +163 -0
  189. package/src/domain/anonymity.ts +129 -0
  190. package/src/domain/body-pages.test.ts +300 -0
  191. package/src/domain/body-pages.ts +223 -0
  192. package/src/domain/paper-source.ts +2 -2
  193. package/src/domain/tex-document.ts +10 -0
  194. package/src/facts-file.test.ts +100 -4
  195. package/src/facts-file.ts +91 -9
  196. package/src/init.test.ts +33 -13
  197. package/src/init.ts +25 -48
  198. package/src/linted-set.test.ts +11 -1
  199. package/src/new-paper.harness.mjs +1 -5
  200. package/src/new-paper.test.ts +7 -1
  201. package/src/package-dirs.ts +9 -0
  202. package/src/paper-files.ts +2 -2
  203. package/src/paper-includes.test.ts +161 -0
  204. package/src/paper-includes.ts +77 -0
  205. package/src/paper-settings.test.ts +63 -6
  206. package/src/paper-settings.ts +53 -5
  207. package/src/pdf-content.test.ts +71 -0
  208. package/src/pdf-content.ts +125 -0
  209. package/src/pdf-facts.test.ts +110 -2
  210. package/src/pdf-facts.ts +106 -8
  211. package/src/ports/latex.ts +3 -0
  212. package/src/presets.ts +8 -8
  213. package/src/rule-cases.test.ts +29 -33
  214. package/src/rule-docs.test.ts +0 -3
  215. package/src/rules-config.ts +1 -0
  216. package/src/structure.harness.ts +1 -3
  217. package/src/structure.ts +1 -1
  218. package/src/tex-paper.test.ts +78 -61
  219. package/src/tex-paper.ts +57 -48
  220. package/src/tex-requirements.ts +9 -0
  221. package/src/tex-venue-rules.test.ts +111 -6
  222. package/src/tex-venue-rules.ts +57 -2
  223. package/src/types.ts +2 -0
  224. package/src/venue-rules.test.ts +351 -39
  225. package/src/venue-rules.ts +247 -47
  226. package/templates/paper/PIPELINE-STATUS.md +0 -4
  227. package/dist/action-ref.d.ts +0 -12
  228. package/dist/action-ref.d.ts.map +0 -1
  229. package/dist/action-ref.js +0 -16
  230. package/dist/action-ref.js.map +0 -1
  231. package/dist/eslint-rules/paper-research-question.d.ts +0 -31
  232. package/dist/eslint-rules/paper-research-question.d.ts.map +0 -1
  233. package/dist/eslint-rules/paper-research-question.js +0 -188
  234. package/dist/eslint-rules/paper-research-question.js.map +0 -1
  235. package/docs/rules/tex/missing-input.md +0 -58
  236. package/eslint-rules/paper-research-question.harness.mjs +0 -212
  237. package/eslint-rules/paper-research-question.ts +0 -199
  238. package/fixtures/paper-research-question/comment-only/PIPELINE-STATUS.md +0 -9
  239. package/fixtures/paper-research-question/comment-only/paper.tex +0 -7
  240. package/fixtures/paper-research-question/declared-not-in-paper/PIPELINE-STATUS.md +0 -10
  241. package/fixtures/paper-research-question/declared-not-in-paper/paper.tex +0 -6
  242. package/fixtures/paper-research-question/draft/PIPELINE-STATUS.md +0 -6
  243. package/fixtures/paper-research-question/draft/paper.tex +0 -2
  244. package/fixtures/paper-research-question/markdown-no-rq/PIPELINE-STATUS.md +0 -9
  245. package/fixtures/paper-research-question/markdown-no-rq/paper.md +0 -4
  246. package/fixtures/paper-research-question/shipped-no-rq/PIPELINE-STATUS.md +0 -12
  247. package/fixtures/paper-research-question/shipped-no-rq/paper.tex +0 -3
  248. package/fixtures/paper-research-question/shipped-with-rq/PIPELINE-STATUS.md +0 -10
  249. package/fixtures/paper-research-question/shipped-with-rq/paper.tex +0 -2
  250. package/src/action-ref.test.ts +0 -26
  251. package/src/action-ref.ts +0 -15
package/CLAUDE.md CHANGED
@@ -77,6 +77,19 @@ and stay QUIET on a clean fixture. A check that has only been seen quiet is
77
77
  indistinguishable from a dead one — silence is its success state. Prove the fire half by
78
78
  seeing the test go RED before the fix lands ([`docs/testing.md`](docs/testing.md)).
79
79
 
80
+ **One rule, one requirement.** A rule checks one thing a user would want to switch off, or set a
81
+ severity for, on its own; two checks with different reasons to disable them are two rules. Several
82
+ messageIds for facets of one requirement are fine. Example: `pdf/limits` checked body pages,
83
+ reference pages and the reference font size — the first two are one page budget and became
84
+ `format/page-limit`; the font size is a different requirement and moved to `pdf/body-size`.
85
+
86
+ **A rule that judges a venue requirement is validated on real accepted papers of that venue** (or
87
+ of its parent venue, with the same template), built to PDF, with the ground truth established
88
+ independently of the rule — rendered and looked at — plus variant fixtures derived from those real
89
+ sources, one change each. Synthetic minimal fixtures alone are not enough: they are written by the
90
+ same hand as the rule, and share its blind spots. Example: `format/page-limit`'s body count, on the
91
+ built ACSAC papers in `fixtures/accepted-papers/` (`test/e2e/tex/page-count.e2e.ts`).
92
+
80
93
  **A new rule ships with its page**, `docs/rules/<group>/<rule>.md`, in these sections: What it
81
94
  catches · Why · Examples (failing / passing) · Options / preset fields · What it does not check ·
82
95
  How to fix. Its `meta.docs.url` points at that page, and its row in `docs/rules.md` is one line
@@ -209,8 +222,8 @@ again on every build, so a checker fix reaches every paper ([`docs/references.md
209
222
  then does what only a command can, because it depends on the project it lands in: it finds the
210
223
  papers directory and declares it in a root `paperlint.json` when it is not the default `papers`, links each skill into `.claude/skills/`, writes
211
224
  the hook commands into `.claude/settings.json` (vigiles' `mergeRegistrations`, reading
212
- `plugin/hooks/hooks.json` as the one source), and offers a CI workflow pinned to the installed
213
- release's tag. `paperlint doctor` reads all of it back. Details: `docs/install.md`.
225
+ `plugin/hooks/hooks.json` as the one source), and offers a CI workflow that runs the action from
226
+ `node_modules` after `npm ci`. `paperlint doctor` reads all of it back. Details: `docs/install.md`.
214
227
 
215
228
  **There is no Claude Code plugin or marketplace entry; it was removed in the release after 1.0.0
216
229
  (#82).** Do not bring it back without answering these, each measured:
package/CONTRIBUTING.md CHANGED
@@ -77,6 +77,9 @@ Most of the package's rules run on users' papers and are described for users in
77
77
  [`docs/rules.md`](docs/rules.md); the rest lint this package's own source and never see a user's
78
78
  files.
79
79
 
80
+ One rule checks one requirement, and a rule that judges a venue requirement is validated on real
81
+ accepted papers built to PDF — both in [`CLAUDE.md`](CLAUDE.md#the-ten-rules-that-decide-what-may-live-here--and-what-may-not-be-written), rule 3.
82
+
80
83
  A new rule ships with its page, `docs/rules/<group>/<rule>.md`, in these sections: What it
81
84
  catches · Why · Examples (failing / passing) · Options / preset fields · What it does not check ·
82
85
  How to fix. Its `meta.docs.url` points at that page, and its row in `docs/rules.md` is one line
package/README.md CHANGED
@@ -69,14 +69,14 @@ build: compiles and measures the PDF; lint then checks pages, fonts, references
69
69
  A **venue preset** holds a venue's format and page limits. A paper's **kind** picks which limit
70
70
  applies: at AgenticDev a `short` paper gets 5 pages and a `full` one 10. You choose it once per paper.
71
71
 
72
- | preset | venue | format | kinds and page limits |
73
- | --------------------------- | ------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
74
- | `paperlint:acm-sigconf` | any ACM conference | ACM two-column | no kinds: the format only, no page limit |
75
- | `paperlint:agenticdev` | AgenticDev @ ASE | ACM two-column | `short` 5, `full` 10, `demo` 5 pages, + 2 pages of references |
76
- | `paperlint:aisec` | AISec @ ACM CCS | ACM two-column | `research`, `benchmark`, `position`, `sok`: 10 pages + 2 pages of references |
77
- | `paperlint:realm` | REALM @ EMNLP | ACL two-column, A4 | `long` 8, `short` 4 — recorded, not checked ([why](docs/rules.md#checks-against-the-venue)) |
78
- | `paperlint:ieee-conference` | any IEEE conference | IEEE two-column | no kinds: the format only, no page limit |
79
- | `paperlint:aidc` | AIDC @ IEEE ACSAC | IEEE two-column, `compsoc` | `regular` 12, `short` 6 — recorded, not checked ([why](docs/rules.md#checks-against-the-venue)); requires the «LLM Usage Statement» |
72
+ | preset | venue | format | kinds and page limits |
73
+ | --------------------------- | ------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
74
+ | `paperlint:acm-sigconf` | any ACM conference | ACM two-column | no kinds: the format only, no page limit |
75
+ | `paperlint:agenticdev` | AgenticDev @ ASE | ACM two-column | `short` 5, `full` 10, `demo` 5 pages, + 2 pages of references |
76
+ | `paperlint:aisec` | AISec @ ACM CCS | ACM two-column | `research`, `benchmark`, `position`, `sok`: 10 pages + 2 pages of references |
77
+ | `paperlint:realm` | REALM @ EMNLP | ACL two-column, A4 | `long` 8, `short` 4 — recorded, not checked ([why](docs/rules.md#checks-against-the-venue)) |
78
+ | `paperlint:ieee-conference` | any IEEE conference | IEEE two-column | no kinds: the format only, no page limit |
79
+ | `paperlint:aidc` | AIDC @ IEEE ACSAC | IEEE two-column, `compsoc` | `regular` 12, `short` 6, counted before the references ([why](docs/rules.md#checks-against-the-venue)); requires the «LLM Usage Statement»; double-blind |
80
80
 
81
81
  Not shipped yet: USENIX, NeurIPS, Springer, IEEE venues other than AIDC, and ACL venues other than
82
82
  REALM.
@@ -190,6 +190,9 @@ Every skill, by stage: [`docs/skills.md`](docs/skills.md).
190
190
  - Commit `repro/references-cache.json`: it keeps what the citation services answered, so a build
191
191
  asks only about new or edited entries (and answers older than 30 days), so an unchanged
192
192
  bibliography usually builds without the network ([`docs/references.md`](docs/references.md)).
193
+ - A paper whose body is in other files (`\input{sections/intro}`) is linted file by file: a finding
194
+ lands at the file and line it is in, and `--fix` edits that file. The files are the ones
195
+ `paper.tex` includes from its body, found where the build finds them — not every `.tex` beside it.
193
196
  - Lint also checks the pipeline's own records: `PIPELINE-STATUS.md`, reviews, notes on related
194
197
  papers ([`docs/rules.md`](docs/rules.md)).
195
198
  - The rules run on ESLint, so a deliberate exception is a comment on the line above:
@@ -274,14 +277,22 @@ jobs:
274
277
  - run: npx paperlint lint
275
278
  ```
276
279
 
277
- Lint only — each paper then gets one warning that it was not built:
280
+ Lint only — each paper then gets one warning that it was not built. Call the action from the
281
+ installed package, after `npm ci`: the action and the CLI it runs are then one revision, pinned by
282
+ your lockfile.
278
283
 
279
284
  ```yaml
280
- - uses: zernie/paperlint@v3.0.0
281
- with:
282
- paths: papers # your papersDir
285
+ steps:
286
+ - uses: actions/checkout@v4
287
+ - uses: actions/setup-node@v4
288
+ with:
289
+ node-version: 22
290
+ - run: npm ci
291
+ - uses: ./node_modules/paperlint
283
292
  ```
284
293
 
294
+ With no `paths` it lints the `papersDir` of your `paperlint.json`; pass `paths:` only to lint less.
295
+
285
296
  ## ❓ FAQ
286
297
 
287
298
  **Does it install anything without asking?**
@@ -33,8 +33,8 @@ assert.equal(action.runs.using, "composite", "the action must be composite");
33
33
  const names = action.runs.steps.map((s) => s.name);
34
34
  assert.equal(
35
35
  action.runs.steps.length,
36
- 4,
37
- `expected 4 steps, got ${action.runs.steps.length}: ${names}`,
36
+ 3,
37
+ `expected 3 steps, got ${action.runs.steps.length}: ${names}`,
38
38
  );
39
39
 
40
40
  const eslintStep = action.runs.steps.find((s) => s.name === "paperlint lint");
@@ -92,7 +92,7 @@ assert.match(
92
92
  //
93
93
  // So: execute the REAL `run:` block under the REAL flags, with a stub standing in for `npx`, and
94
94
  // require that the guard was reached and that ESLint's code came through it.
95
- const stubbedStepRun = (stubRc) => {
95
+ const stubbedStepRun = (stubRc, paths = ".") => {
96
96
  const bin = realpathSync(mkdtempSync(join(tmpdir(), "paperlint-bin-")));
97
97
  writeFileSync(
98
98
  join(bin, "npx"),
@@ -100,6 +100,7 @@ const stubbedStepRun = (stubRc) => {
100
100
  // `-o`, it REDIRECTS output. So the stub also checks the redirect itself — if it disappears
101
101
  // from the step, the file stays empty and the guard says "nothing was measured".
102
102
  `#!/usr/bin/env bash\n` +
103
+ `printf '%s\\n' "$@" > "$RUNNER_TEMP/npx-args"\n` +
103
104
  `printf '%s' "$REPORT_JSON"\n` +
104
105
  `exit "$STUB_RC"\n`,
105
106
  { mode: 0o755 },
@@ -115,8 +116,8 @@ const stubbedStepRun = (stubRc) => {
115
116
  PATH: `${bin}:${process.env.PATH}`,
116
117
  RUNNER_TEMP: TMP,
117
118
  GITHUB_ACTION_PATH: HERE,
118
- PAPERLINT_CONFIG: "eslint.config.mjs",
119
- PAPERLINT_PATHS: ".",
119
+ PAPERLINT_CONFIG: "",
120
+ PAPERLINT_PATHS: paths,
120
121
  PAPERLINT_MAXWARN: "-1",
121
122
  STUB_RC: String(stubRc),
122
123
  REPORT_JSON: JSON.stringify([{ filePath: "/x/a.md", messages: [] }]),
@@ -169,41 +170,46 @@ for (const key of [
169
170
  ])
170
171
  assert.ok(action.inputs[key], `input \`${key}\` is missing`);
171
172
 
172
- // ── `paths` is REQUIRED, and the requirement is ENFORCED, not merely declared ─────────────────
173
- // 🔴 GitHub does not enforce `required: true` for COMPOSITE actions. A caller who omits the
174
- // input reaches the first step with an empty string and no error at all. So two separate things
175
- // are asserted here, and neither implies the other: that the contract is DECLARED, and that a
176
- // step exists which can actually fail on it.
173
+ // ── `paths` is OPTIONAL: with none, the CLI lints the papersDir its paperlint.json declares ──────
174
+ // `paperlint lint` with no path finds the root paperlint.json and lints its `papersDir`, so that is
175
+ // the normal call and the action must not refuse it. What is asserted is the behaviour: the real
176
+ // `run:` block, handed an empty `paths`, calls the CLI with no path argument at all, and the guard
177
+ // still runs over what the CLI reported.
177
178
  assert.equal(
178
179
  action.inputs.paths.required,
179
- true,
180
- "`paths` must be declared required",
180
+ false,
181
+ "`paths` must be optional — the CLI finds papersDir itself",
181
182
  );
182
- assert.ok(
183
- !("default" in action.inputs.paths),
184
- "`paths` must have NO default — the old default `.` linted the whole checkout, so a caller " +
185
- "who never chose a scope still got a green job over one",
186
- );
187
- const pathsGuard = action.runs.steps.find((s) =>
188
- /paths was actually given/i.test(s.name ?? ""),
189
- );
190
- assert.ok(
191
- pathsGuard,
192
- `no step enforcing the \`paths\` contract among: ${names}`,
193
- );
194
- assert.match(
195
- pathsGuard.run,
196
- /exit 1/,
197
- "the `paths` guard must FAIL, not warn — a declaration nobody checks is documentation",
198
- );
199
- // And it must come FIRST: checking scope after texlive setup would burn apt minutes
200
- // for a call already wrong.
201
183
  assert.equal(
202
- action.runs.steps[0].name,
203
- pathsGuard.name,
204
- "the `paths` guard must run FIRST — checking scope after an apt install burns minutes on a " +
205
- "call that was already wrong",
184
+ action.inputs.paths.default,
185
+ "",
186
+ "`paths` must default to empty, which means: the papersDir of paperlint.json",
206
187
  );
188
+ {
189
+ const r = stubbedStepRun(0, "");
190
+ assert.equal(r.status, 0, `an empty \`paths\` must run clean: ${r.stderr}`);
191
+ assert.deepEqual(
192
+ readFileSync(join(TMP, "npx-args"), "utf8").trim().split("\n"),
193
+ ["paperlint", "lint", "--max-warnings=-1", "--json"],
194
+ "with no `paths` the CLI must get no path argument — not an empty string, not `.`",
195
+ );
196
+ assert.match(r.stdout, /linted 1 file\(s\)/, "the guard must still run");
197
+ }
198
+ {
199
+ stubbedStepRun(0, "papers/a papers/b");
200
+ assert.deepEqual(
201
+ readFileSync(join(TMP, "npx-args"), "utf8").trim().split("\n"),
202
+ [
203
+ "paperlint",
204
+ "lint",
205
+ "papers/a",
206
+ "papers/b",
207
+ "--max-warnings=-1",
208
+ "--json",
209
+ ],
210
+ "named paths are handed to the CLI one argument each",
211
+ );
212
+ }
207
213
 
208
214
  // ── II. BEHAVIOUR of the guard — both halves, on fixtures ─────────────────────────────────────
209
215
  const fixture = (name, body) => {
@@ -225,6 +231,18 @@ const fixture = (name, body) => {
225
231
  );
226
232
  assert.match(lines.join("\n"), /linted ZERO files/);
227
233
  }
234
+ // With no paths given, the guard names where the scope came from instead of printing `paths=`.
235
+ {
236
+ const { lines } = guard(fixture("empty2.json", "[]"), 0, {
237
+ paths: "",
238
+ config: "paperlint.json",
239
+ });
240
+ assert.match(
241
+ lines.join("\n"),
242
+ /paths=\(none: the papersDir of paperlint\.json\)/,
243
+ "an empty paths value must be named as the papersDir, not printed blank",
244
+ );
245
+ }
228
246
  // FIRES: the report is absent or unparsable — nothing was measured either way.
229
247
  assert.equal(
230
248
  guard(join(TMP, "absent.json"), 0).code,
@@ -283,5 +301,5 @@ assert.equal(
283
301
  }
284
302
 
285
303
  console.log(
286
- "✓ action.yml shape (parsed, not grepped) + guard behaviour, both halves — 20 assertions",
304
+ "✓ action.yml shape (parsed, not grepped) + guard behaviour, both halves",
287
305
  );
package/action.yml CHANGED
@@ -7,11 +7,12 @@
7
7
  # which is the one place it has to hold. The same bypass also meant the consumer's settings were never read and
8
8
  # the caller still had to keep an ESLint flat config — the exact thing the CLI exists to remove.
9
9
  #
10
- # WHY AN ACTION AND NOT A DOCUMENTED `run:` BLOCK. Two steps have to happen in this order and
11
- # neither is guessable from the outside: `texcount` must exist on PATH before linting starts, and
12
- # the scope has to be checked before any install spends minutes on a call that was already wrong.
13
- # A consumer who copies only the last step gets a green job over rules that silently degraded —
14
- # see the `texcount` note below.
10
+ # WHY AN ACTION AND NOT A DOCUMENTED `run:` BLOCK. `texcount` must exist on PATH before linting
11
+ # starts, and that is not guessable from the outside. A consumer who copies only the last step gets
12
+ # a green job over rules that silently degraded — see the `texcount` note below.
13
+ #
14
+ # CALL IT AS `uses: ./node_modules/paperlint`, after `npm ci`: the action and the CLI it runs are
15
+ # then one revision, pinned by the consumer's lockfile.
15
16
  #
16
17
  # 🔴 THE GREEN-ZERO GUARD IS PART OF THIS ACTION, NOT AN OPTIONAL EXTRA. `eslint` prints findings
17
18
  # and exits 0 when there are none — and "no findings" is byte-identical to "not one rule was handed
@@ -33,11 +34,12 @@ inputs:
33
34
  default: ""
34
35
  paths:
35
36
  description: >-
36
- What to lint, as ESLint would take it on the command line. REQUIRED, and deliberately
37
- without a default: the previous default was "." — the whole checkout — so a caller who
38
- never thought about scope still got a green job, over whatever happened to be in the
39
- repository. Scope is the one thing this action cannot guess.
40
- required: true
37
+ What to lint, as `paperlint lint` takes it on the command line. Optional: empty — the
38
+ default — runs `paperlint lint` with no path, and the CLI lints the `papersDir` its root
39
+ `paperlint.json` declares (default `papers`), and fails when that directory holds no paper.
40
+ Name paths only to lint less than that.
41
+ required: false
42
+ default: ""
41
43
  max-warnings:
42
44
  description: >-
43
45
  Passed through to ESLint. The default -1 means warnings never fail the job: in this rule set
@@ -62,23 +64,6 @@ inputs:
62
64
  runs:
63
65
  using: composite
64
66
  steps:
65
- # 🔴 `required: true` ABOVE IS A DECLARATION, NOT AN ENFORCEMENT. GitHub does not enforce
66
- # required inputs for COMPOSITE actions — a caller who omits `paths` reaches this step with
67
- # an empty string and no error of any kind. So the contract is checked here, where it can
68
- # actually fail, rather than trusted where it is merely written down. Same reasoning as the
69
- # green-zero guard below: the declaration and the check are different things.
70
- - name: paths was actually given
71
- shell: bash
72
- env:
73
- PAPERLINT_PATHS: ${{ inputs.paths }}
74
- run: |
75
- if [ -z "${PAPERLINT_PATHS// /}" ]; then
76
- echo "::error::input \`paths\` is required and was empty. Name what to lint, e.g." \
77
- "\`paths: papers\`. There is no default on purpose: linting the whole checkout" \
78
- "by accident produces a green job over a scope nobody chose."
79
- exit 1
80
- fi
81
-
82
67
  # texlive-extra-utils is what carries /usr/bin/texcount. Cached, because the apt fetch is the
83
68
  # only network hop in this action and a slow mirror once cost a caller 14 minutes.
84
69
  - name: texcount (for a CONSUMER's texcount/* rules — this package ships none)
package/bin/paperlint.mjs CHANGED
@@ -40,4 +40,8 @@ const { run, isMain } = await import("../dist/cli.js");
40
40
  // The question is about THIS file, not `dist/cli.js`: `bin` is the target of a symlink from
41
41
  // `node_modules/.bin`, and `isMain` can compare it to the real path. For `cli.js` itself
42
42
  // the answer is now always "no" — it is imported, not invoked.
43
- if (isMain(import.meta.url)) process.exit(await run(process.argv.slice(2)));
43
+ // Not process.exit(): on macOS stdout into a pipe is written asynchronously, and exit() drops
44
+ // whatever has not drained yet, cutting `lint --json` at the 64 KiB pipe buffer. Setting exitCode
45
+ // lets Node exit once the output has drained — what the Node docs recommend over exit().
46
+ if (isMain(import.meta.url))
47
+ process.exitCode = await run(process.argv.slice(2));
@@ -7,6 +7,10 @@ import type { ParsedTex } from "./parse.ts";
7
7
  * is used, and nothing here expands macros.
8
8
  */
9
9
  export declare const includesOf: (t: ParsedTex) => readonly Include[];
10
- /** The span of the `document` environment's body, or null when the source has none. */
10
+ /**
11
+ * The span of the `document` environment's body, or null when the source has none. A macro's own
12
+ * position ends at its name, so its place is taken with its arguments: a body ending in
13
+ * `\input{sections/a}` ends at the closing brace.
14
+ */
11
15
  export declare const documentBodyOf: (t: ParsedTex) => Span | null;
12
16
  //# sourceMappingURL=includes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAYzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA6B5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,SAAS,KAAG,SAAS,OAAO,EAGU,CAAC;AAKrE,uFAAuF;AACvF,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,KAAG,IAAI,GAAG,IAOhD,CAAC"}
1
+ {"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAYzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA6B5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,SAAS,KAAG,SAAS,OAAO,EAGU,CAAC;AAKrE;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,KAAG,IAAI,GAAG,IAWhD,CAAC"}
@@ -35,8 +35,14 @@ export const includesOf = (t) => visited(t.root, isDefinition)
35
35
  .filter(isNode)
36
36
  .flatMap((n) => (n.type === "macro" ? includeOf(t.src, n) : []));
37
37
  const isDocument = (n) => n.type === "environment" && n.env === "document";
38
- /** The span of the `document` environment's body, or null when the source has none. */
38
+ /**
39
+ * The span of the `document` environment's body, or null when the source has none. A macro's own
40
+ * position ends at its name, so its place is taken with its arguments: a body ending in
41
+ * `\input{sections/a}` ends at the closing brace.
42
+ */
39
43
  export const documentBodyOf = (t) => (t.root.content.find(isDocument)?.content ?? [])
40
- .flatMap((n) => inPlace(placeOf(n), (span) => [span]))
44
+ .flatMap((n) => inPlace(n.type === "macro" ? macroPlace(n) : placeOf(n), (span) => [
45
+ span,
46
+ ]))
41
47
  .reduce((body, span) => body === null ? span : { start: body.start, end: span.end }, null);
42
48
  //# sourceMappingURL=includes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"includes.js","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAIA,OAAO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C,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAC7D,IAAI,CACL,CAAC"}
@@ -28,6 +28,7 @@ export { outlineOf } from "./outline.ts";
28
28
  export { parseLatex, type ParsedTex } from "./parse.ts";
29
29
  export { bodyProse } from "./prose.ts";
30
30
  export { renderedRuns } from "./rendered.ts";
31
+ export { layoutOverridesOf } from "./layout.ts";
31
32
  /** The `LatexReader` port over unified-latex: each call parses its source once. */
32
33
  export declare const latexReader: LatexReader;
33
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAYxD,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,mFAAmF;AACnF,eAAO,MAAM,WAAW,EAAE,WASzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAaxD,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,mFAAmF;AACnF,eAAO,MAAM,WAAW,EAAE,WAUzB,CAAC"}
@@ -4,6 +4,7 @@ import { outlineOf } from "./outline.js";
4
4
  import { parseLatex } from "./parse.js";
5
5
  import { bodyProse } from "./prose.js";
6
6
  import { renderedRuns } from "./rendered.js";
7
+ import { layoutOverridesOf } from "./layout.js";
7
8
  export { documentClassOf, parseTemplate, replaceDocumentClass, } from "./document-class.js";
8
9
  export { collapse, inPlace, macroPlace, mandatory, optional, placeOf, textOf, } from "./nodes.js";
9
10
  export { documentBodyOf, includesOf } from "./includes.js";
@@ -11,6 +12,7 @@ export { outlineOf } from "./outline.js";
11
12
  export { parseLatex } from "./parse.js";
12
13
  export { bodyProse } from "./prose.js";
13
14
  export { renderedRuns } from "./rendered.js";
15
+ export { layoutOverridesOf } from "./layout.js";
14
16
  /** The `LatexReader` port over unified-latex: each call parses its source once. */
15
17
  export const latexReader = {
16
18
  documentClass: (src) => documentClassOf(parseLatex(src)),
@@ -21,5 +23,6 @@ export const latexReader = {
21
23
  documentBody: (src) => documentBodyOf(parseLatex(src)),
22
24
  template: parseTemplate,
23
25
  withDocumentClass: (src, want) => replaceDocumentClass(parseLatex(src), want),
26
+ layoutOverrides: (src) => layoutOverridesOf(parseLatex(src)),
24
27
  };
25
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAkB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACxD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC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OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAkB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACxD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5C,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACpD,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9C,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9C,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtD,QAAQ,EAAE,aAAa;IACvB,iBAAiB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IAC7E,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;CAC7D,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Where a source changes the page layout its class sets for the whole document — the input of
3
+ * `format/layout-override`. Read from the parse tree, never the text: a command in a comment is not
4
+ * a command.
5
+ *
6
+ * What counts, each by its node:
7
+ *
8
+ * \usepackage{geometry} · \RequirePackage{…,geometry} the package that re-sets the margins
9
+ * \geometry{…} · \newgeometry{…} its commands
10
+ * \setlength / \addtolength on a layout length \textheight \textwidth \topmargin …
11
+ * \linespread{…} · \renewcommand{\baselinestretch} the line spacing
12
+ *
13
+ * Local spacing — a negative `\vspace` or `\vskip` around one float — is not a layout the template
14
+ * sets, and no venue's call names it; it is not read.
15
+ *
16
+ * A comment and a `comment` environment are not read — the parser hands both back as text, not
17
+ * macros. Everything else is — the bibliography, math, floats — and a macro definition too: a
18
+ * `\newcommand` whose body sets a layout length does so wherever it is used. Conditionals are not
19
+ * evaluated.
20
+ */
21
+ import type { LayoutOverride } from "../../domain/tex-document.ts";
22
+ import type { ParsedTex } from "./parse.ts";
23
+ /** The lengths the class sets for the page and the line; changing one changes the venue's layout. */
24
+ export declare const LAYOUT_LENGTHS: ReadonlySet<string>;
25
+ /** Every layout override in the source, in document order. */
26
+ export declare function layoutOverridesOf(t: ParsedTex): readonly LayoutOverride[];
27
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAUnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,qGAAqG;AACrG,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAW7C,CAAC;AAkDH,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,cAAc,EAAE,CAUzE"}
@@ -0,0 +1,62 @@
1
+ import { collapse, isList, macroPlace, mandatory, textOf, visited, } from "./nodes.js";
2
+ /** The lengths the class sets for the page and the line; changing one changes the venue's layout. */
3
+ export const LAYOUT_LENGTHS = new Set([
4
+ "textheight",
5
+ "textwidth",
6
+ "topmargin",
7
+ "oddsidemargin",
8
+ "evensidemargin",
9
+ "columnsep",
10
+ "headsep",
11
+ "headheight",
12
+ "footskip",
13
+ "baselineskip",
14
+ ]);
15
+ /** The macro a mandatory argument holds first, or undefined: `{\textheight}` → `textheight`. */
16
+ function firstMacro(m, i) {
17
+ const first = mandatory(m)[i]?.content.find((n) => n.type !== "whitespace");
18
+ return first?.type === "macro" ? first.content : undefined;
19
+ }
20
+ const argText = (m, i) => collapse(textOf(mandatory(m)[i]?.content));
21
+ const usesGeometry = (m) => argText(m, 0)
22
+ .split(",")
23
+ .map((p) => p.trim())
24
+ .includes("geometry")
25
+ ? `\\${m.content}{geometry}`
26
+ : null;
27
+ const setsLayoutLength = (m) => {
28
+ const length = firstMacro(m, 0);
29
+ return length !== undefined && LAYOUT_LENGTHS.has(length)
30
+ ? `\\${m.content}{\\${length}}`
31
+ : null;
32
+ };
33
+ /** Each macro that may override the layout, and how to tell whether this use of it does. */
34
+ const OVERRIDES = new Map([
35
+ ["usepackage", usesGeometry],
36
+ ["RequirePackage", usesGeometry],
37
+ ["geometry", (m) => `\\${m.content}`],
38
+ ["newgeometry", (m) => `\\${m.content}`],
39
+ ["linespread", (m) => `\\linespread{${argText(m, 0)}}`],
40
+ ["setlength", setsLayoutLength],
41
+ ["addtolength", setsLayoutLength],
42
+ [
43
+ "renewcommand",
44
+ (m) => firstMacro(m, 0) === "baselinestretch"
45
+ ? "\\renewcommand{\\baselinestretch}"
46
+ : null,
47
+ ],
48
+ ]);
49
+ /** How a message names a macro that overrides the layout, or null when it does not. */
50
+ const overrideOf = (m) => OVERRIDES.get(m.content)?.(m) ?? null;
51
+ /** Every layout override in the source, in document order. */
52
+ export function layoutOverridesOf(t) {
53
+ // Nothing is pruned: a comment, and a `comment` environment, reach the tree as leaves of text.
54
+ const lists = visited(t.root, () => false).filter(isList);
55
+ return lists.flatMap((list) => list.flatMap((n) => {
56
+ if (n.type !== "macro")
57
+ return [];
58
+ const command = overrideOf(n);
59
+ return command === null ? [] : [{ command, place: macroPlace(n) }];
60
+ }));
61
+ }
62
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/adapters/latex/layout.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,EACT,MAAM,EACN,OAAO,GAER,MAAM,YAAY,CAAC;AAGpB,qGAAqG;AACrG,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,YAAY;IACZ,WAAW;IACX,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,WAAW;IACX,SAAS;IACT,YAAY;IACZ,UAAU;IACV,cAAc;CACf,CAAC,CAAC;AAEH,gGAAgG;AAChG,SAAS,UAAU,CAAC,CAAQ,EAAE,CAAS;IACrC,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;IAC5E,OAAO,KAAK,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,CAAQ,EAAE,CAAS,EAAU,EAAE,CAC9C,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAK7C,MAAM,YAAY,GAAU,CAAC,CAAC,EAAE,EAAE,CAChC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;KACV,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;KACpB,QAAQ,CAAC,UAAU,CAAC;I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27,17 @@ const NONE = { kind: "none" };
27
27
  */
28
28
  const SHOWN_ARGUMENT = new Map([
29
29
  ["texorpdfstring", { kind: "argument", at: 0 }],
30
- ...["color", "fontsize", "vspace", "hspace", "setlength", "addtolength"].map((m) => [m, NONE]),
30
+ ...[
31
+ "color",
32
+ "fontsize",
33
+ "vspace",
34
+ "hspace",
35
+ "setlength",
36
+ "addtolength",
37
+ "linespread",
38
+ "geometry",
39
+ "newgeometry",
40
+ ].map((m) => [m, NONE]),
31
41
  ]);
32
42
  /** The text a (non-key) macro typesets: see `SHOWN_ARGUMENT`. */
33
43
  function shownText(m) {
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../../src/adapters/latex/nodes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAexD,uDAAuD;AACvD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAa,EAAS,EAAE,CAC9C,CAAC,CAAC,QAAQ,KAAK,SAAS;IACtB,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE;IACtB,CAAC,CAAC;QACE,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE;KACrE,CAAC;AAER,2FAA2F;AAC3F,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,CAAQ,EACR,CAA+B,EACjB,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AA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 -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAU/D,oGAAoG;AACpG,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAgB9C,CAAC;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB9C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAGnD,CAAC;AAUH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAWhD,CAAC;AAOH,QAAA,MAAM,MAAM,eAAsB,CAAC;AAEnC,0GAA0G;AAC1G,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;IACxB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;CACzB;AAcD,iCAAiC;AACjC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,SAIvC,CAAC"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAU/D,oGAAoG;AACpG,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAgB9C,CAAC;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB9C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAGnD,CAAC;AAcH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAWhD,CAAC;AAOH,QAAA,MAAM,MAAM,eAAsB,CAAC;AAEnC,0GAA0G;AAC1G,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;IACxB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;CACzB;AAcD,iCAAiC;AACjC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,SAIvC,CAAC"}
@@ -55,7 +55,11 @@ const LINK_SIGNATURES = Object.fromEntries(signed(["href"], "m m"));
55
55
  * Declarations unified-latex has no signature for: signed so their arguments (sizes, not text)
56
56
  * attach to them instead of standing beside them as groups a reader would seem to see.
57
57
  */
58
- const DECLARATION_SIGNATURES = Object.fromEntries(signed(["fontsize"], "m m"));
58
+ const DECLARATION_SIGNATURES = Object.fromEntries([
59
+ ...signed(["fontsize"], "m m"),
60
+ // The layout commands `format/layout-override` reads: a spacing factor, geometry's key list.
61
+ ...signed(["linespread", "geometry", "newgeometry"], "m"),
62
+ ]);
59
63
  /**
60
64
  * Macros that define other macros or environments. A heading in a body is no section where it is
61
65
  * written, so the outline skips these; the rendered text reads a body as written, since nothing here
@@ -1 +1 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,MAAM,GAAG,CACb,KAAwB,EACxB,SAAiB,EAC+C,EAAE,CAClE,KAAK,CAAC,GAAG,CAA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