pulpweaver4 0.0.91 → 0.0.185

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 (502) hide show
  1. package/dist/ast/djot.js +23 -0
  2. package/dist/ast/djot.js.map +1 -1
  3. package/dist/ast/index.d.ts +1 -0
  4. package/dist/ast/index.js +1 -0
  5. package/dist/ast/index.js.map +1 -1
  6. package/dist/ast/nodes.d.ts +59 -5
  7. package/dist/ast/nodes.js.map +1 -1
  8. package/dist/ast/table.d.ts +27 -0
  9. package/dist/ast/table.js +32 -0
  10. package/dist/ast/table.js.map +1 -0
  11. package/dist/browser.js +2420 -0
  12. package/dist/citations/index.d.ts +1 -1
  13. package/dist/citations/index.js +1 -1
  14. package/dist/citations/index.js.map +1 -1
  15. package/dist/citations/project.d.ts +12 -2
  16. package/dist/citations/project.js +21 -7
  17. package/dist/citations/project.js.map +1 -1
  18. package/dist/colour/images.d.ts +11 -2
  19. package/dist/colour/images.js +53 -3
  20. package/dist/colour/images.js.map +1 -1
  21. package/dist/colour/ink-limit.d.ts +2 -2
  22. package/dist/colour/ink-limit.js +6 -0
  23. package/dist/colour/ink-limit.js.map +1 -1
  24. package/dist/colour/previews.d.ts +8 -4
  25. package/dist/colour/previews.js +11 -8
  26. package/dist/colour/previews.js.map +1 -1
  27. package/dist/config/config.d.ts +91 -3
  28. package/dist/config/config.js +200 -3
  29. package/dist/config/config.js.map +1 -1
  30. package/dist/config/project-schema.d.ts +0 -8
  31. package/dist/config/project-schema.js +207 -12
  32. package/dist/config/project-schema.js.map +1 -1
  33. package/dist/config/schema.js +10 -0
  34. package/dist/config/schema.js.map +1 -1
  35. package/dist/config/secrets.d.ts +11 -0
  36. package/dist/config/secrets.js +19 -0
  37. package/dist/config/secrets.js.map +1 -0
  38. package/dist/csl/project.d.ts +19 -4
  39. package/dist/csl/project.js +23 -10
  40. package/dist/csl/project.js.map +1 -1
  41. package/dist/fonts/index.d.ts +1 -1
  42. package/dist/fonts/index.js +1 -1
  43. package/dist/fonts/index.js.map +1 -1
  44. package/dist/fonts/lint.d.ts +51 -0
  45. package/dist/fonts/lint.js +101 -16
  46. package/dist/fonts/lint.js.map +1 -1
  47. package/dist/fonts/walk.d.ts +13 -0
  48. package/dist/fonts/walk.js +50 -33
  49. package/dist/fonts/walk.js.map +1 -1
  50. package/dist/html/css.d.ts +4 -0
  51. package/dist/html/css.js +11 -3
  52. package/dist/html/css.js.map +1 -1
  53. package/dist/html/dom.d.ts +6 -1
  54. package/dist/html/dom.js +28 -6
  55. package/dist/html/dom.js.map +1 -1
  56. package/dist/html/generated.d.ts +17 -0
  57. package/dist/html/generated.js +21 -0
  58. package/dist/html/generated.js.map +1 -0
  59. package/dist/html/images.d.ts +18 -0
  60. package/dist/html/images.js +49 -2
  61. package/dist/html/images.js.map +1 -1
  62. package/dist/html/index.d.ts +1 -0
  63. package/dist/html/index.js +1 -0
  64. package/dist/html/index.js.map +1 -1
  65. package/dist/html/render.d.ts +5 -4
  66. package/dist/html/render.js +24 -6
  67. package/dist/html/render.js.map +1 -1
  68. package/dist/hyphenation/exceptions.d.ts +5 -0
  69. package/dist/hyphenation/exceptions.js +11 -0
  70. package/dist/hyphenation/exceptions.js.map +1 -1
  71. package/dist/hyphenation/index.d.ts +1 -1
  72. package/dist/hyphenation/index.js +1 -1
  73. package/dist/hyphenation/index.js.map +1 -1
  74. package/dist/import/convert.d.ts +21 -0
  75. package/dist/import/convert.js +65 -0
  76. package/dist/import/convert.js.map +1 -0
  77. package/dist/incremental/cache.d.ts +59 -0
  78. package/dist/incremental/cache.js +64 -0
  79. package/dist/incremental/cache.js.map +1 -0
  80. package/dist/incremental/index.d.ts +3 -0
  81. package/dist/incremental/index.js +4 -0
  82. package/dist/incremental/index.js.map +1 -0
  83. package/dist/incremental/keys.d.ts +27 -0
  84. package/dist/incremental/keys.js +89 -0
  85. package/dist/incremental/keys.js.map +1 -0
  86. package/dist/incremental/session.d.ts +180 -0
  87. package/dist/incremental/session.js +401 -0
  88. package/dist/incremental/session.js.map +1 -0
  89. package/dist/index.d.ts +6 -0
  90. package/dist/index.js +6 -0
  91. package/dist/index.js.map +1 -1
  92. package/dist/indexes/layout.d.ts +8 -2
  93. package/dist/indexes/layout.js +6 -4
  94. package/dist/indexes/layout.js.map +1 -1
  95. package/dist/layout/cache.d.ts +174 -0
  96. package/dist/layout/cache.js +150 -0
  97. package/dist/layout/cache.js.map +1 -0
  98. package/dist/layout/converge.d.ts +28 -0
  99. package/dist/layout/converge.js +102 -9
  100. package/dist/layout/converge.js.map +1 -1
  101. package/dist/layout/counters.d.ts +4 -0
  102. package/dist/layout/counters.js +15 -0
  103. package/dist/layout/counters.js.map +1 -1
  104. package/dist/layout/index.d.ts +5 -2
  105. package/dist/layout/index.js +3 -0
  106. package/dist/layout/index.js.map +1 -1
  107. package/dist/layout/lists.d.ts +52 -3
  108. package/dist/layout/lists.js +513 -46
  109. package/dist/layout/lists.js.map +1 -1
  110. package/dist/layout/lookahead.d.ts +151 -0
  111. package/dist/layout/lookahead.js +581 -0
  112. package/dist/layout/lookahead.js.map +1 -0
  113. package/dist/layout/margin-boxes.d.ts +11 -1
  114. package/dist/layout/margin-boxes.js +24 -1
  115. package/dist/layout/margin-boxes.js.map +1 -1
  116. package/dist/layout/page-rules.d.ts +6 -1
  117. package/dist/layout/page-rules.js +42 -1
  118. package/dist/layout/page-rules.js.map +1 -1
  119. package/dist/layout/page.js +4 -2
  120. package/dist/layout/page.js.map +1 -1
  121. package/dist/layout/pagebuilder.d.ts +248 -3
  122. package/dist/layout/pagebuilder.js +512 -19
  123. package/dist/layout/pagebuilder.js.map +1 -1
  124. package/dist/layout/pages.d.ts +108 -1
  125. package/dist/layout/pages.js +1362 -159
  126. package/dist/layout/pages.js.map +1 -1
  127. package/dist/layout/paragraph.d.ts +14 -0
  128. package/dist/layout/paragraph.js +304 -31
  129. package/dist/layout/paragraph.js.map +1 -1
  130. package/dist/layout/pre.js +4 -0
  131. package/dist/layout/pre.js.map +1 -1
  132. package/dist/layout/protrusion.d.ts +26 -0
  133. package/dist/layout/protrusion.js +39 -0
  134. package/dist/layout/protrusion.js.map +1 -0
  135. package/dist/layout/ranges.d.ts +2 -0
  136. package/dist/layout/ranges.js +22 -0
  137. package/dist/layout/ranges.js.map +1 -0
  138. package/dist/layout/region.d.ts +2 -1
  139. package/dist/layout/region.js +9 -5
  140. package/dist/layout/region.js.map +1 -1
  141. package/dist/layout/templates.d.ts +71 -0
  142. package/dist/layout/templates.js +290 -0
  143. package/dist/layout/templates.js.map +1 -0
  144. package/dist/layout/vlist.d.ts +3 -3
  145. package/dist/linebreak/items.d.ts +27 -2
  146. package/dist/linebreak/items.js +10 -3
  147. package/dist/linebreak/items.js.map +1 -1
  148. package/dist/linebreak/knuth-plass.d.ts +20 -0
  149. package/dist/linebreak/knuth-plass.js +68 -16
  150. package/dist/linebreak/knuth-plass.js.map +1 -1
  151. package/dist/lint/book.d.ts +13 -0
  152. package/dist/lint/book.js +52 -0
  153. package/dist/lint/book.js.map +1 -0
  154. package/dist/lint/config.d.ts +9 -0
  155. package/dist/lint/config.js +40 -6
  156. package/dist/lint/config.js.map +1 -1
  157. package/dist/lint/linter.js +1 -0
  158. package/dist/lint/linter.js.map +1 -1
  159. package/dist/lint/project.js +1 -1
  160. package/dist/lint/project.js.map +1 -1
  161. package/dist/lint/rules/layout.d.ts +3 -1
  162. package/dist/lint/rules/layout.js +8 -6
  163. package/dist/lint/rules/layout.js.map +1 -1
  164. package/dist/lint/rules/source.js +1 -1
  165. package/dist/lint/rules/source.js.map +1 -1
  166. package/dist/lint/testing.js +1 -0
  167. package/dist/lint/testing.js.map +1 -1
  168. package/dist/measure/bidi-data.d.ts +14 -0
  169. package/dist/measure/bidi-data.js +69 -0
  170. package/dist/measure/bidi-data.js.map +1 -0
  171. package/dist/measure/bidi.d.ts +70 -0
  172. package/dist/measure/bidi.js +225 -0
  173. package/dist/measure/bidi.js.map +1 -0
  174. package/dist/measure/css.d.ts +5 -0
  175. package/dist/measure/css.js +2 -0
  176. package/dist/measure/css.js.map +1 -1
  177. package/dist/measure/measurer.d.ts +36 -2
  178. package/dist/measure/measurer.js +220 -22
  179. package/dist/measure/measurer.js.map +1 -1
  180. package/dist/measure/model.d.ts +20 -2
  181. package/dist/measure/model.js +13 -6
  182. package/dist/measure/model.js.map +1 -1
  183. package/dist/measure/script-data.d.ts +6 -0
  184. package/dist/measure/script-data.js +34 -0
  185. package/dist/measure/script-data.js.map +1 -0
  186. package/dist/measure/scripts.d.ts +36 -0
  187. package/dist/measure/scripts.js +293 -0
  188. package/dist/measure/scripts.js.map +1 -0
  189. package/dist/output/output.d.ts +35 -3
  190. package/dist/output/output.js +26 -4
  191. package/dist/output/output.js.map +1 -1
  192. package/dist/paint/backgrounds.js +7 -20
  193. package/dist/paint/backgrounds.js.map +1 -1
  194. package/dist/paint/blend.d.ts +33 -13
  195. package/dist/paint/blend.js +73 -21
  196. package/dist/paint/blend.js.map +1 -1
  197. package/dist/paint/cache.d.ts +80 -0
  198. package/dist/paint/cache.js +537 -0
  199. package/dist/paint/cache.js.map +1 -0
  200. package/dist/paint/canvas.d.ts +4 -13
  201. package/dist/paint/canvas.js +45 -5
  202. package/dist/paint/canvas.js.map +1 -1
  203. package/dist/paint/context.d.ts +2 -0
  204. package/dist/paint/emphasis.js +1 -1
  205. package/dist/paint/emphasis.js.map +1 -1
  206. package/dist/paint/flatten.d.ts +24 -2
  207. package/dist/paint/flatten.js +55 -12
  208. package/dist/paint/flatten.js.map +1 -1
  209. package/dist/paint/forms.d.ts +64 -0
  210. package/dist/paint/forms.js +319 -0
  211. package/dist/paint/forms.js.map +1 -0
  212. package/dist/paint/images.d.ts +4 -1
  213. package/dist/paint/images.js +13 -2
  214. package/dist/paint/images.js.map +1 -1
  215. package/dist/paint/layers.d.ts +64 -0
  216. package/dist/paint/layers.js +137 -0
  217. package/dist/paint/layers.js.map +1 -0
  218. package/dist/paint/painter.d.ts +19 -6
  219. package/dist/paint/painter.js +15 -135
  220. package/dist/paint/painter.js.map +1 -1
  221. package/dist/paint/stacking.d.ts +1 -1
  222. package/dist/paint/stacking.js +9 -2
  223. package/dist/paint/stacking.js.map +1 -1
  224. package/dist/paint/text.d.ts +14 -3
  225. package/dist/paint/text.js +25 -4
  226. package/dist/paint/text.js.map +1 -1
  227. package/dist/paint/vertical.js +2 -2
  228. package/dist/paint/vertical.js.map +1 -1
  229. package/dist/pdf/encoded.d.ts +16 -0
  230. package/dist/pdf/encoded.js +35 -0
  231. package/dist/pdf/encoded.js.map +1 -0
  232. package/dist/pdf/include/colour.d.ts +105 -0
  233. package/dist/pdf/include/colour.js +349 -0
  234. package/dist/pdf/include/colour.js.map +1 -0
  235. package/dist/pdf/include/functions.d.ts +17 -0
  236. package/dist/pdf/include/functions.js +389 -0
  237. package/dist/pdf/include/functions.js.map +1 -0
  238. package/dist/pdf/include/pages.d.ts +14 -0
  239. package/dist/pdf/include/pages.js +27 -0
  240. package/dist/pdf/include/pages.js.map +1 -0
  241. package/dist/pdf/include/pdfjs/LICENSE +177 -0
  242. package/dist/pdf/include/pdfjs/pdf.min.mjs +27 -0
  243. package/dist/pdf/include/pdfjs/pdf.worker.min.mjs +27 -0
  244. package/dist/pdf/include/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  245. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  246. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  247. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  248. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  249. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  250. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  251. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  252. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  253. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  254. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  255. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  256. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  257. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  258. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  259. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  260. package/dist/pdf/include/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  261. package/dist/pdf/include/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  262. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  263. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  264. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  265. package/dist/pdf/include/pdfjs/wasm/LICENSE_QCMS +21 -0
  266. package/dist/pdf/include/pdfjs/wasm/jbig2.wasm +0 -0
  267. package/dist/pdf/include/pdfjs/wasm/openjpeg.wasm +0 -0
  268. package/dist/pdf/include/pdfjs/wasm/qcms_bg.wasm +0 -0
  269. package/dist/pdf/include/pdfjs/wasm/quickjs-eval.wasm +0 -0
  270. package/dist/pdf/include/prepare.d.ts +58 -0
  271. package/dist/pdf/include/prepare.js +266 -0
  272. package/dist/pdf/include/prepare.js.map +1 -0
  273. package/dist/pdf/include/preview.d.ts +38 -0
  274. package/dist/pdf/include/preview.js +101 -0
  275. package/dist/pdf/include/preview.js.map +1 -0
  276. package/dist/pdf/include/rewrite.d.ts +57 -0
  277. package/dist/pdf/include/rewrite.js +803 -0
  278. package/dist/pdf/include/rewrite.js.map +1 -0
  279. package/dist/pdf/include/serialize.d.ts +32 -0
  280. package/dist/pdf/include/serialize.js +158 -0
  281. package/dist/pdf/include/serialize.js.map +1 -0
  282. package/dist/pdf/include/testing.d.ts +26 -0
  283. package/dist/pdf/include/testing.js +50 -0
  284. package/dist/pdf/include/testing.js.map +1 -0
  285. package/dist/pdf/index.d.ts +1 -0
  286. package/dist/pdf/index.js +1 -0
  287. package/dist/pdf/index.js.map +1 -1
  288. package/dist/pdf/structure/annotations.d.ts +33 -0
  289. package/dist/pdf/structure/annotations.js +112 -0
  290. package/dist/pdf/structure/annotations.js.map +1 -0
  291. package/dist/pdf/structure/forms.d.ts +10 -0
  292. package/dist/pdf/structure/forms.js +46 -0
  293. package/dist/pdf/structure/forms.js.map +1 -0
  294. package/dist/pdf/structure/index.d.ts +41 -5
  295. package/dist/pdf/structure/index.js +40 -5
  296. package/dist/pdf/structure/index.js.map +1 -1
  297. package/dist/pdf/structure/links.d.ts +2 -0
  298. package/dist/pdf/structure/links.js +1 -1
  299. package/dist/pdf/structure/links.js.map +1 -1
  300. package/dist/pdf/structure/presentation.d.ts +28 -0
  301. package/dist/pdf/structure/presentation.js +79 -0
  302. package/dist/pdf/structure/presentation.js.map +1 -0
  303. package/dist/pdf/structure/tags.d.ts +34 -2
  304. package/dist/pdf/structure/tags.js +117 -14
  305. package/dist/pdf/structure/tags.js.map +1 -1
  306. package/dist/pdf/types.d.ts +357 -11
  307. package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +44 -2
  308. package/dist/pdf/wasm/pulpweaver4_pdf.js +191 -2
  309. package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
  310. package/dist/pdf/writer.d.ts +13 -1
  311. package/dist/pdf/writer.js +26 -1
  312. package/dist/pdf/writer.js.map +1 -1
  313. package/dist/plugin/define.d.ts +200 -15
  314. package/dist/plugin/define.js +124 -15
  315. package/dist/plugin/define.js.map +1 -1
  316. package/dist/plugin/failure.d.ts +1 -1
  317. package/dist/plugin/index.d.ts +5 -4
  318. package/dist/plugin/index.js +5 -4
  319. package/dist/plugin/index.js.map +1 -1
  320. package/dist/plugin/reference.d.ts +38 -0
  321. package/dist/plugin/reference.js +287 -0
  322. package/dist/plugin/reference.js.map +1 -0
  323. package/dist/plugin/register.d.ts +39 -7
  324. package/dist/plugin/register.js +83 -2
  325. package/dist/plugin/register.js.map +1 -1
  326. package/dist/preflight/index.d.ts +1 -1
  327. package/dist/preflight/index.js +1 -1
  328. package/dist/preflight/index.js.map +1 -1
  329. package/dist/preflight/pdfx.d.ts +35 -0
  330. package/dist/preflight/pdfx.js +33 -2
  331. package/dist/preflight/pdfx.js.map +1 -1
  332. package/dist/preflight/reader.d.ts +10 -3
  333. package/dist/preflight/reader.js +86 -5
  334. package/dist/preflight/reader.js.map +1 -1
  335. package/dist/print/impose.d.ts +66 -0
  336. package/dist/print/impose.js +331 -0
  337. package/dist/print/impose.js.map +1 -0
  338. package/dist/print/output.js +400 -50
  339. package/dist/print/output.js.map +1 -1
  340. package/dist/problem.js +4 -3
  341. package/dist/problem.js.map +1 -1
  342. package/dist/profile/index.d.ts +1 -0
  343. package/dist/profile/index.js +1 -0
  344. package/dist/profile/index.js.map +1 -1
  345. package/dist/profile/lint.d.ts +1 -1
  346. package/dist/profile/lint.js +29 -1
  347. package/dist/profile/lint.js.map +1 -1
  348. package/dist/profile/list-table.d.ts +51 -0
  349. package/dist/profile/list-table.js +137 -0
  350. package/dist/profile/list-table.js.map +1 -0
  351. package/dist/profile/metadata.js +3 -0
  352. package/dist/profile/metadata.js.map +1 -1
  353. package/dist/profile/profile.d.ts +3 -0
  354. package/dist/profile/profile.js +9 -1
  355. package/dist/profile/profile.js.map +1 -1
  356. package/dist/project.js +3 -0
  357. package/dist/project.js.map +1 -1
  358. package/dist/qpdf/index.d.ts +2 -0
  359. package/dist/qpdf/index.js +3 -0
  360. package/dist/qpdf/index.js.map +1 -0
  361. package/dist/qpdf/qpdf.d.ts +125 -0
  362. package/dist/qpdf/qpdf.js +205 -0
  363. package/dist/qpdf/qpdf.js.map +1 -0
  364. package/dist/qpdf/testing.d.ts +12 -0
  365. package/dist/qpdf/testing.js +9 -0
  366. package/dist/qpdf/testing.js.map +1 -0
  367. package/dist/qpdf/wasm/LICENSE-qpdf +202 -0
  368. package/dist/qpdf/wasm/LICENSE-zlib +22 -0
  369. package/dist/qpdf/wasm/NOTICE-qpdf.md +42 -0
  370. package/dist/qpdf/wasm/qpdf.wasm +0 -0
  371. package/dist/render/index.d.ts +3 -0
  372. package/dist/render/index.js +2 -0
  373. package/dist/render/index.js.map +1 -0
  374. package/dist/render/render.d.ts +98 -0
  375. package/dist/render/render.js +243 -0
  376. package/dist/render/render.js.map +1 -0
  377. package/dist/reproducible/clock.d.ts +4 -5
  378. package/dist/reproducible/clock.js +4 -5
  379. package/dist/reproducible/clock.js.map +1 -1
  380. package/dist/spike/spike-page.chromium.json +4 -4
  381. package/dist/style/colours.d.ts +7 -2
  382. package/dist/style/colours.js +24 -2
  383. package/dist/style/colours.js.map +1 -1
  384. package/dist/style/compile.js +1 -1
  385. package/dist/style/compile.js.map +1 -1
  386. package/dist/style/defaults.d.ts +9 -3
  387. package/dist/style/defaults.js +14 -2
  388. package/dist/style/defaults.js.map +1 -1
  389. package/dist/style/gcpm.d.ts +1 -1
  390. package/dist/style/gcpm.js +17 -5
  391. package/dist/style/gcpm.js.map +1 -1
  392. package/dist/style/properties.js +84 -0
  393. package/dist/style/properties.js.map +1 -1
  394. package/dist/test/book.d.ts +22 -2
  395. package/dist/test/book.js +35 -2
  396. package/dist/test/book.js.map +1 -1
  397. package/dist/test/build.d.ts +23 -0
  398. package/dist/test/build.js +86 -33
  399. package/dist/test/build.js.map +1 -1
  400. package/dist/test/layout.js +128 -19
  401. package/dist/test/layout.js.map +1 -1
  402. package/dist/test/limits.d.ts +8 -0
  403. package/dist/test/limits.js +9 -0
  404. package/dist/test/limits.js.map +1 -0
  405. package/dist/test/pipeline.d.ts +23 -0
  406. package/dist/test/pipeline.js.map +1 -1
  407. package/dist/test/render.d.ts +26 -3
  408. package/dist/test/render.js +151 -23
  409. package/dist/test/render.js.map +1 -1
  410. package/dist/test/runner.d.ts +6 -3
  411. package/dist/test/runner.js +172 -105
  412. package/dist/test/runner.js.map +1 -1
  413. package/dist/test/text.js +2 -2
  414. package/dist/test/text.js.map +1 -1
  415. package/dist/text/output.js +2 -2
  416. package/dist/text/output.js.map +1 -1
  417. package/dist/text/render.d.ts +4 -3
  418. package/dist/text/render.js +126 -4
  419. package/dist/text/render.js.map +1 -1
  420. package/dist/transform/index.d.ts +1 -1
  421. package/dist/transform/index.js +1 -1
  422. package/dist/transform/index.js.map +1 -1
  423. package/dist/transform/run.d.ts +2 -0
  424. package/dist/transform/run.js +32 -16
  425. package/dist/transform/run.js.map +1 -1
  426. package/dist/web/output.js +116 -10
  427. package/dist/web/output.js.map +1 -1
  428. package/dist/web/runtime/justify.js.txt +2 -2
  429. package/dist/web/site.d.ts +2 -0
  430. package/dist/web/site.js +8 -1
  431. package/dist/web/site.js.map +1 -1
  432. package/docs/README.md +6 -1
  433. package/docs/manual/chapters/front.dj +34 -0
  434. package/docs/manual/chapters/guides/citations.dj +426 -0
  435. package/docs/manual/chapters/guides/colour-and-prepress.dj +261 -0
  436. package/docs/manual/chapters/guides/editions.dj +329 -0
  437. package/docs/manual/chapters/guides/in-a-web-page.dj +143 -0
  438. package/docs/manual/chapters/guides/lines-and-pages.dj +681 -0
  439. package/docs/manual/chapters/guides/lint-rules.dj +355 -0
  440. package/docs/manual/chapters/guides/pdfs.dj +501 -0
  441. package/docs/manual/chapters/guides/plugins.dj +425 -0
  442. package/docs/manual/chapters/guides/testing.dj +264 -0
  443. package/docs/manual/chapters/guides/writing-in-djot.dj +537 -0
  444. package/docs/manual/chapters/start/for-latex-users.dj +256 -0
  445. package/docs/manual/chapters/start/getting-started.dj +167 -0
  446. package/docs/manual/chapters/start/your-first-book.dj +426 -0
  447. package/docs/manual/fonts/CrimsonPro-Italic-VF.ttf +0 -0
  448. package/docs/manual/fonts/CrimsonPro-VF.ttf +0 -0
  449. package/docs/manual/fonts/JetBrainsMono-Regular.otf +0 -0
  450. package/docs/manual/fonts/NotoSansSymbols2-Boxes.ttf +0 -0
  451. package/docs/manual/fonts/OFL.txt +95 -0
  452. package/docs/manual/pulpweaver4.toml +39 -0
  453. package/docs/manual/styles/manual.css +137 -0
  454. package/docs/reference/css-properties/index.md +9 -0
  455. package/docs/reference/css-properties/pw-expansion.md +31 -0
  456. package/docs/reference/css-properties/pw-flow-into.md +31 -0
  457. package/docs/reference/css-properties/pw-knockout.md +26 -0
  458. package/docs/reference/css-properties/pw-layer.md +24 -0
  459. package/docs/reference/css-properties/pw-page-breaking.md +30 -0
  460. package/docs/reference/css-properties/pw-page-duration.md +28 -0
  461. package/docs/reference/css-properties/pw-page-rotate.md +29 -0
  462. package/docs/reference/css-properties/pw-page-transition.md +29 -0
  463. package/docs/reference/css-properties/pw-protrusion.md +31 -0
  464. package/docs/reference/lint-rules/ibid-across-page.md +2 -2
  465. package/docs/reference/plugin-api/capabilities.md +2 -2
  466. package/docs/reference/plugin-api/claim-kind.md +1 -1
  467. package/docs/reference/plugin-api/combine-exceptions.md +19 -0
  468. package/docs/reference/plugin-api/element-break-context.md +34 -0
  469. package/docs/reference/plugin-api/element-break-item.md +24 -0
  470. package/docs/reference/plugin-api/element-breaker.md +24 -0
  471. package/docs/reference/plugin-api/flow-definition.md +30 -0
  472. package/docs/reference/plugin-api/generated-reference.md +32 -0
  473. package/docs/reference/plugin-api/index-definition.md +32 -0
  474. package/docs/reference/plugin-api/index-titles.md +18 -0
  475. package/docs/reference/plugin-api/index.md +27 -3
  476. package/docs/reference/plugin-api/insert-class-definition.md +46 -0
  477. package/docs/reference/plugin-api/insert-placement.md +22 -0
  478. package/docs/reference/plugin-api/insert-placements.md +18 -0
  479. package/docs/reference/plugin-api/layout-definition.md +9 -5
  480. package/docs/reference/plugin-api/layout-slot.md +6 -16
  481. package/docs/reference/plugin-api/lint-context.md +3 -1
  482. package/docs/reference/plugin-api/lint-definition.md +1 -1
  483. package/docs/reference/plugin-api/lint-edition.md +2 -0
  484. package/docs/reference/plugin-api/page-builder-event.md +22 -0
  485. package/docs/reference/plugin-api/page-builder-hook.md +7 -3
  486. package/docs/reference/plugin-api/page-builder-page-event.md +30 -0
  487. package/docs/reference/plugin-api/page-template-definition.md +34 -0
  488. package/docs/reference/plugin-api/page-template-region-definition.md +46 -0
  489. package/docs/reference/plugin-api/plugin-definition.md +5 -1
  490. package/docs/reference/plugin-api/plugin-reference-options.md +32 -0
  491. package/docs/reference/plugin-api/plugin-reference.md +22 -0
  492. package/docs/reference/plugin-api/plugin-registry.md +15 -5
  493. package/docs/reference/plugin-api/plugin-stage.md +1 -1
  494. package/docs/reference/plugin-api/plugin.md +9 -2
  495. package/docs/reference/plugin-api/reference-page.md +34 -0
  496. package/docs/reference/plugin-api/render-reference-page.md +18 -0
  497. package/docs/reference/plugin-api/renderers.md +1 -1
  498. package/docs/reference/pulpweaver4-toml/editions.md +239 -2
  499. package/docs/reference/pulpweaver4-toml/index.md +44 -1
  500. package/docs/reference/pulpweaver4-toml/inks.md +15 -4
  501. package/docs/reference/pulpweaver4-toml/lint.md +1 -1
  502. package/package.json +5 -1
@@ -0,0 +1,256 @@
1
+ ``` =meta
2
+ description = 'What you know from LaTeX — \tolerance, geometry, fancyhdr, pdfx, \newcommand, biblatex, \index and the rest — and its pulpweaver4 equivalent, or what has none yet.'
3
+ ```
4
+
5
+ {#for-latex-users}
6
+ # For LaTeX users
7
+
8
+ pulpweaver4 breaks lines and pages with TeX’s own algorithms, so a LaTeX
9
+ user’s knowledge carries over: the same box, glue and penalty model, the same
10
+ parameters under the same names. What changes is where you say things. The
11
+ source is [Djot](#writing-in-djot), with no macros and no raw TeX; the
12
+ design is CSS, with TeX’s parameters as custom properties; and the book’s
13
+ settings, its editions, bibliography and plugins, are in `pulpweaver4.toml`.
14
+
15
+ This chapter maps what you know to its equivalent, and says plainly where
16
+ there is none yet. pulpweaver4 is still being built: “not yet” here means
17
+ planned, with the issue that builds it where there is one.
18
+
19
+ {#for-latex-users-the-document}
20
+ ## The document
21
+
22
+ | In LaTeX | In pulpweaver4 |
23
+ |----|----|
24
+ | `\documentclass{book}` | A project: `pw new` makes one, with the `book` theme |
25
+ | `\title`, `\author`, `\date` | `title` and `date` in `pulpweaver4.toml`; there is no author key yet |
26
+ | `\usepackage[english]{babel}` | `language = "en-US"`: hyphenation, quotation marks, the citation style’s terms |
27
+ | `\include{intro}`, `\input` | `chapters = ["chapters/*.dj"]`, in order |
28
+ | `\chapter{Introduction}\label{intro}` | `{#intro}` on the line before `# Introduction` |
29
+ | `\section`, `\subsection` | `##`, `###` |
30
+ | `\chapter*`, `\section*` | `{.unnumbered}` before the heading |
31
+ | `\appendix` | `{.appendix}` before the first appendix’s `#` heading |
32
+ | `\ref{fig:glue}`, `\autoref` | `[](#fig:glue)`, which reads “Figure 1.2” |
33
+ | `\pageref{intro}` | `[](#intro){.page}`, in print |
34
+ | `\footnote{…}` | `[^name]`, and `[^name]: …` after the paragraph |
35
+ | `\emph`, `\textbf` | `_…_`, `*…*` |
36
+ | `figure`, `\caption`, `\includegraphics` | `::: figure` holding an image and its caption |
37
+ | `tabular` in `table` | A Djot table, with `^ caption` after it |
38
+ | `\multicolumn`, `\multirow`, a `p{…}` column | A `::: list-table`, its cells `{colspan=2}`, `{rowspan=2}` |
39
+ | `equation`, `$…$` | ``$$`…` `` and ``$`…` ``, in TeX’s notation, set by MathJax |
40
+ | `verse` | `::: verse`, each source line a line |
41
+ | `% a comment` | `{% a comment %}` |
42
+ | `\iffalse`, `comment`, `\ifprint` | `{.print-only}`, `{.screen-only}`, `{.edition-<name>}` |
43
+ | `latexmk`, running twice for `.aux` | Nothing: page references converge in one build |
44
+ | `\tableofcontents`, `tocdepth` | `::: contents`, with `{depth=2}`; in print with leaders and pages, as the book class sets it |
45
+ | `\addcontentsline`, a section left out | Every section with a heading is listed, numbered or not; `{.unlisted}` leaves one out |
46
+ | `\selectlanguage`, `otherlanguage` for a chapter | `language = "la"` in the file’s ```` ``` =meta```` block |
47
+
48
+ {#for-latex-users-lines}
49
+ ## Lines
50
+
51
+ TeX’s paragraph parameters are CSS custom properties, with TeX’s names and
52
+ TeX’s defaults, so they cascade: set one on `:root` for the whole book, on
53
+ an element for its paragraphs, or in a media query for one edition.
54
+
55
+ | In LaTeX | In pulpweaver4 | Default |
56
+ |----|----|----|
57
+ | `\tolerance` | `--pw-tolerance` | 200 |
58
+ | `\pretolerance` | `--pw-pretolerance` | 100 |
59
+ | `\emergencystretch` | `--pw-emergency-stretch` | 0 |
60
+ | `\looseness` | `--pw-looseness` | 0 |
61
+ | `\linepenalty` | `--pw-line-penalty` | 10 |
62
+ | `\hyphenpenalty`, `\exhyphenpenalty` | `--pw-hyphen-penalty`, `--pw-ex-hyphen-penalty` | 50, 50 |
63
+ | `\adjdemerits` | `--pw-adj-demerits` | 10000 |
64
+ | `\doublehyphendemerits`, `\finalhyphendemerits` | `--pw-double-hyphen-demerits`, `--pw-final-hyphen-demerits` | 10000, 5000 |
65
+ | The interword glue (`\fontdimen2`--`4`) | `--pw-word-space` | `0.333em plus 0.167em minus 0.111em` |
66
+ | `\frenchspacing` / `\nonfrenchspacing` | `--pw-xspace` unset (French spacing, the default) / set to the space after a sentence | unset |
67
+ | `\lefthyphenmin`, `\righthyphenmin` | `--pw-left-hyphen-min`, `--pw-right-hyphen-min` | the language’s |
68
+ | `\hyphenation{man-u-script}` | `hyphenation.txt` in the project, in the same notation | |
69
+ | `\-`, `\nohyphens` | A soft hyphen (U+00AD) under `hyphens: manual`; `hyphens: none` | |
70
+ | `\dotfill`, `\hfill`, `\leaders` | `--pw-leader: "."` (or `none`) on a span | |
71
+ | `\raggedright` | `text-align: left` | |
72
+ | `\parindent`, `\parskip` | `text-indent`, `margin` | |
73
+
74
+ A line’s badness, the passes at `--pw-pretolerance` and `--pw-tolerance`,
75
+ then `--pw-emergency-stretch`: it is TeX’s algorithm, step for step, checked
76
+ against TeX’s own `\tracingparagraphs`. An overfull line is a lint warning,
77
+ `overfull-line`, never a stopped build. [Lines and pages](#lines-and-pages)
78
+ has the details.
79
+
80
+ {project=latex}
81
+ ``` css
82
+ @media print and (--paperback) {
83
+ :root { --pw-tolerance: 400; } /* \tolerance=400 for the narrow paperback */
84
+ }
85
+ ```
86
+
87
+ {#for-latex-users-pages}
88
+ ## Pages
89
+
90
+ | In LaTeX | In pulpweaver4 |
91
+ |----|----|
92
+ | `\clearpage`, `\newpage` | `break-before: page` |
93
+ | `\cleardoublepage` | `break-before: right`, which adds a blank page when it must |
94
+ | `\nopagebreak`, `\samepage` | `break-after: avoid`, `break-inside: avoid` |
95
+ | `\widowpenalty`, `\clubpenalty` | `--pw-widow-penalty`, `--pw-club-penalty` (150, 150), or CSS’s `widows` and `orphans` |
96
+ | `\brokenpenalty`, `\interlinepenalty` | `--pw-broken-penalty` (100), `--pw-inter-line-penalty` (0) |
97
+ | `\penalty-50` before an element | `--pw-penalty-before: -50` (and `--pw-penalty-after`) |
98
+ | `\vspace`, `\addvspace` | `margin`, or `--pw-space-before` and `--pw-space-after` with `plus` and `minus` |
99
+ | `\topskip`, `\maxdepth` | `--pw-top-skip`, `--pw-max-depth` (both 0) |
100
+ | `\skip\footins` | `--pw-footnote-skip` (`12pt plus 4pt minus 4pt`) |
101
+ | `\footnoterule` | `.pw-footnote-rule`, styled |
102
+ | `figure` with `[t]`, `[b]` | `float: top`, `float: bottom` |
103
+ | `figure` with `[h]` | No float: a figure stays where it is, kept whole |
104
+ | `minipage`, `\vbox` | `--pw-box: minipage`, with its own footnotes |
105
+ | `\begin{multicols}{2}` | `columns: 2`, broken across pages and balanced on the last, as `multicols` |
106
+ | `wrapfigure` | CSS’s `float: left` and `float: right`: the text flows around it, each line set to the measure it leaves, as `\parshape` |
107
+ | `lettrine` | A floated `::first-letter`: `p.opening::first-letter { float: left; font-size: 40pt; }` ([Text around floats](#text-around-floats)) |
108
+ | `\marginpar` | *Not yet*: sidenotes need plugins’ insert classes, which do nothing yet ([#138](https://gitlab.com/inkylabs/pulpweaver4/-/issues/138)) |
109
+
110
+ {#the-page-and-its-furniture}
111
+ ## The page and its furniture
112
+
113
+ | In LaTeX | In pulpweaver4 |
114
+ |----|----|
115
+ | `geometry`, `paperwidth`/`paperheight` | `page = "5.5in 8.5in"` (or `letter`, `A5`, ...) on the edition |
116
+ | `geometry`’s margins | `@page { margin: 0.75in 0.6in 0.9in; }`, and `@page :left` and `:right` for the inner and outer margins |
117
+ | `\newgeometry`, `\thispagestyle` | Named pages: `page: plate` on an element, and `@page plate { … }`; `@page :first` and `:blank` |
118
+ | `fancyhdr`’s heads and feet | `@page`’s margin boxes, `@top-center { content: … }` and the rest |
119
+ | `\markboth`, `\leftmark` | `string-set: chapter content()` on the heading, and `string(chapter)` in a margin box |
120
+ | A head set from a box | `position: running(title)` on the element, and `element(title)` in a margin box |
121
+ | `\thepage` | `counter(page)`, and `counter(pages)` for the last |
122
+ | `\pagenumbering{roman}` | `counter(page, lower-roman)` on the front matter’s named page, and `counter-reset: page 1` where the main matter starts; the PDF’s page labels follow |
123
+ | `crop`, bleed | `bleed = "0.125in"` and `marks = "crop"` (or `"crop cross"`) on the edition, or CSS’s `bleed` and `marks` in `@page` |
124
+ | `\twoside`, `\openright` | Pages have sides: `break-before: right` starts a chapter on a recto |
125
+ | Booklets with `pdfpages` or pdftk | `impose = "booklet"` on the edition, and `n-up = "2x1"` for two to a sheet ([Booklets and n-up](#booklets)) |
126
+
127
+ {#for-latex-users-fonts}
128
+ ## Fonts
129
+
130
+ | In LaTeX | In pulpweaver4 |
131
+ |----|----|
132
+ | `fontspec`’s `\setmainfont` | `@font-face` naming a `.ttf` or `.otf` in the project, and `font-family` |
133
+ | `\addfontfeatures{Numbers=OldStyle}` | `font-variant-numeric: oldstyle-nums`, or `font-feature-settings` |
134
+ | `microtype`’s protrusion and expansion | `--pw-protrusion: 1` and `--pw-expansion: 20`, in the line breaker and the painter alike ([Microtypography](#microtypography)) |
135
+ | A missing glyph, logged | An error in print, naming the character and where it is |
136
+
137
+ pulpweaver4 never uses fonts installed on the system in print, so a book
138
+ sets the same on any machine. Type 1 fonts aren’t read: use their OpenType
139
+ versions (TeX Gyre, Latin Modern).
140
+
141
+ {#bibliographies-and-citations}
142
+ ## Bibliographies and citations
143
+
144
+ | In LaTeX | In pulpweaver4 |
145
+ |----|----|
146
+ | `biblatex`’s `\addbibresource{sources.bib}` | `bibliography = "sources.bib"` (BibLaTeX, BibTeX, CSL-JSON or CSL-YAML) |
147
+ | `style=chicago-notes` (biblatex-chicago) | The default, Chicago notes and bibliography, pulpweaver4’s own CSL style, with “Ibid.” |
148
+ | `style=authoryear` | `citation-style = "chicago-author-date"`, or any CSL style, by its id (`"apa"`, fetched from the CSL repository once and cached) or as a file |
149
+ | `\autocite[15]{bauckham}`, `\footcite` | `[@bauckham, p. 15]`: under a note style, a footnote by itself |
150
+ | `\autocite[see][15]{bauckham}` | `[see @bauckham, p. 15]` |
151
+ | `\cites{a}{b}` | `[@a; @b]` |
152
+ | `\autocite*` | `[-@bauckham]` |
153
+ | `\textcite{bauckham}` | `[=@bauckham]`: “Bauckham (2006)”, or under a note style “Richard Bauckham¹” |
154
+ | `\nocite{hays}`, `\nocite{*}` | `[~@hays]` in the text, or `nocite = ["hays"]` (`["*"]`) in `pulpweaver4.toml` |
155
+ | `\printbibliography` | `::: bibliography` ... `:::` |
156
+ | `backref` | `{.back-references}` on the bibliography, in print |
157
+ | `ibidtracker=constrict` | Always, in print: no ibid. points across a page |
158
+ | `pagetracker=spread` | `citation-ibid = "spread"`: an ibid. may point to the facing page |
159
+ | `citereset=chapter` | `citation-reset = "chapter"` |
160
+ | `natbib`, `bibtex` styles (`.bst`) | No: styles are CSL |
161
+
162
+ [Citations](#citations) has the rest.
163
+
164
+ {#indexes}
165
+ ## Indexes
166
+
167
+ | In LaTeX | In pulpweaver4 |
168
+ |----|----|
169
+ | `\index{Cru}`, `\index{parachurch!revenues}` | `[text]{index="Cru; parachurch!revenues"}`, over the span the term covers |
170
+ | `\index` on the word itself | `[tithing]{.xi}` |
171
+ | `\index{tithing\|(}` ... `\index{tithing\|)}` | `[]{index="tithing\|("}` ... `[]{index="tithing\|)"}`; `\|see{…}` and `\|seealso{…}` as makeindex reads them |
172
+ | `\printindex`, `makeidx`, `imakeidx` | `::: index` ... `:::`: the entries sorted in the book’s language, with their pages, ranges and cross-references |
173
+
174
+ {#for-latex-users-pdfs}
175
+ ## PDFs
176
+
177
+ | In LaTeX | In pulpweaver4 |
178
+ |----|----|
179
+ | `hyperref`’s links and bookmarks | Always: cross-references and URLs are links, headings are bookmarks |
180
+ | `\hypersetup{pdftitle=…, pdflang=…}` | `title` and `language` |
181
+ | `xcolor` | CSS colours, in any syntax |
182
+ | `xcolor`’s `cmyk` model | `device-cmyk(0 0 0 1)` in CSS, in a CMYK edition |
183
+ | `pdfx`’s `[x-4]` | `color = "cmyk"`, `output-intent = "GRACoL2013"`, `pdf-standard = "PDF/X-4"`, and a `date` |
184
+ | `pdfx`’s `[x-1a]` | The same with `pdf-standard = "PDF/X-1a"` and a version 2 profile, `output-intent = "FOGRA39"` |
185
+ | `pdfx`’s `[a-2b]` | `pdf-standard = "PDF/A-2b"` |
186
+ | `tagpdf`, `\DocumentMetadata{pdfstandard=ua-1}` | Every PDF is tagged; `pdf-standard = "PDF/UA-1"` claims it |
187
+ | Spot colours (`spotcolor`) | `[inks]` in `pulpweaver4.toml`, used as `var(--ink-<name>)` |
188
+ | Overprint (`pdfoverprint`) | `--pw-overprint: on` |
189
+ | Mixed spot inks, two-colour work (DeviceN) | `[inks.<name>] mix = { teal = 0.6, black = 0.4 }` ([Mixing inks](#mixing-inks)) |
190
+ | Knockout groups (`pgf`’s `transparency group=knockout`) | `--pw-knockout: on` |
191
+ | `\pdfinfoomitdate`, `SOURCE_DATE_EPOCH` | No date unless the project has a `date` or the build has `SOURCE_DATE_EPOCH`: builds are reproducible |
192
+ | `\includegraphics{figure.pdf}`, `page=2` | `![A figure.](figure.pdf)`, drawn as vectors, and `figure.pdf#page=2` for another page ([PDFs as images](#pdf-images)) |
193
+ | `pdfpages`’ `\includepdf[pages=-]{form.pdf}` | `![A form.](form.pdf){.pages}`, alone in its paragraph: each page a page of the book, and `#page=1-3,5` for some of them |
194
+ | `hyperref`’s forms | A form control on the page is a fillable field ([Form fields](#form-fields)) |
195
+ | `ocgx2` layers | `--pw-layer: <name>`, `hidden` to start hidden ([Layers](#pdf-layers)) |
196
+ | `pdfcomment`, `todonotes` | `[text]{comment="…"}` ([Comments and attached files](#comments-and-attachments)) |
197
+ | `attachfile` | `[text]{attach="data/days.csv"}`; `attachfile2` and `embedfile`, an edition’s `attachments` |
198
+ | `pdfx`’s `.xmpdata`, custom XMP | `[editions.<name>.xmp.<prefix>]` ([Custom XMP](#custom-xmp)) |
199
+ | `beamer`’s `\transduration`, `\trans…`; `pdflscape` | `--pw-page-duration`, `--pw-page-transition`, `--pw-page-rotate` on `@page` ([Slides](#slides-and-viewer-settings)) |
200
+ | `hyperref`’s `pdfpagemode`, `pdfstartpage`, `pdfstartview`, `pdfdisplaydoctitle` | `page-mode`, `start-page`, `start-view`, `[editions.<name>.viewer]` |
201
+ | `insdljs`, document JavaScript | `javascript = ["scripts/open.js"]` in the edition ([JavaScript](#pdf-javascript)) |
202
+ | `\pdfprotect`, encryption | `encryption = { user-password = "…" }` on the edition, with `owner-password` and `permissions` ([Encryption](#encryption)) |
203
+
204
+ [PDFs](#pdfs) and [Colour and prepress](#colour-and-prepress)
205
+ say what each standard needs.
206
+
207
+ {#macros}
208
+ ## Macros
209
+
210
+ There is no macro language, and no raw TeX: a chapter is inert text that any
211
+ Djot tool can read, and every construct is a parse rule with a place in the
212
+ source that an error can point to. What macros did, you do in one of three
213
+ ways:
214
+
215
+ | In LaTeX | In pulpweaver4 |
216
+ |----|----|
217
+ | `\newcommand{\term}[1]{\emph{#1}}`, for looks | A span with a class, `[grace]{.term}`, and CSS: `.term { font-style: italic }` |
218
+ | `\newenvironment{note}`, for looks | A div, `::: note`, and CSS for `.note` |
219
+ | `\newcommand` that computes, numbers or looks things up | A [plugin](#plugins), in TypeScript, with tests: it can claim `::: questions` or `{.v}`, transform the document and render its own nodes |
220
+ | `\renewcommand` of a package’s macro | Nothing overrides another plugin: each name has one owner, and a second claim is an error |
221
+ | The order of `\usepackage` lines | Plugins are a set: their order in `pulpweaver4.toml` changes nothing |
222
+ | `\def\@makechapterhead` | CSS for `h1`, in the stylesheet, per edition with media queries |
223
+
224
+ {#tooling}
225
+ ## Tooling
226
+
227
+ | In LaTeX | In pulpweaver4 |
228
+ |----|----|
229
+ | `pdflatex book.tex`, `latexmk` | `pw build`, every edition at once |
230
+ | The `.log`’s overfull boxes | `pw build`’s warnings, with file, line and column |
231
+ | `chktex`, `lacheck` | `pw lint`, and lint rules on the finished pages |
232
+ | Checking a proof by eye | `pw test`: facts about the book, checked on every build |
233
+ | `\tracingparagraphs`, `\showbox` | Not from the command line yet |
234
+ | `tlmgr install` | Plugins are npm packages: `pw add <plugin>` installs one and names it in `[plugins]` ([Loading plugins](#loading-plugins)) |
235
+ | Converting a `.tex` book | `pw convert book.tex`: a new project whose chapter is the book in Djot ([below](#converting-a-latex-book)) |
236
+
237
+ {#converting-a-latex-book}
238
+ ## Converting a LaTeX book
239
+
240
+ `pw convert` starts a project from a LaTeX, Word or Markdown file, as
241
+ `pw new` does, with that file as its one chapter, converted to Djot:
242
+
243
+ {.untested}
244
+ ``` sh
245
+ pw convert book.tex
246
+ ```
247
+
248
+ The project is a folder beside the file, named after it (`book/`, with
249
+ the title “Book” and the chapter `chapters/01-book.dj`), or the folder you
250
+ name after the file: `pw convert book.tex ~/books/dorean`. The conversion is
251
+ Pandoc’s, compiled to WebAssembly and loaded only for `pw convert`, so what
252
+ Pandoc’s LaTeX reader understands comes over, the structure and the text,
253
+ and the design doesn’t. It reads the one file: convert a book split into
254
+ `\include`d files a file at a time. It is a start, not a finished book:
255
+ read the chapter through, split it into chapters, and move its design into
256
+ the stylesheet.
@@ -0,0 +1,167 @@
1
+ ``` =meta
2
+ description = 'Install pulpweaver4’s command line, start a book with pw new, and build its PDFs, web edition and text with pw build.'
3
+ ```
4
+
5
+ {#getting-started}
6
+ # Getting started
7
+
8
+ pulpweaver4 typesets books: you write in [Djot](https://djot.net), style the
9
+ book with CSS, and it lays out the pages with TeX’s algorithms. Its command
10
+ line, `pw`, builds every edition of a book at once: PDFs for print, a web
11
+ site, and plain text. This chapter takes you from nothing to a PDF in a few
12
+ minutes; [Your first book](#your-first-book) then walks through what you
13
+ made.
14
+
15
+ This manual documents pulpweaver4 0.0.185, the release it comes with: it
16
+ ships in the release's `pulpweaver4` package, and the site's examples run
17
+ that release.
18
+
19
+ {#what-you-need}
20
+ ## What you need
21
+
22
+ - *[Node.js](https://nodejs.org) 24 or later*, with the npm that comes
23
+ with it. `node --version` says which you have.
24
+ - *About 650 MB of disk*: some 230 MB for pulpweaver4 and its
25
+ dependencies, and 400 MB for the Chromium it lays pages out in.
26
+ - *A shell.* The commands below are for Linux and macOS (bash or zsh).
27
+ pulpweaver4 is tested on Linux; it should run wherever Playwright’s
28
+ Chromium does, but macOS and Windows aren’t tested yet.
29
+
30
+ Nothing else: no TeX, no fonts installed on the system (a book carries its
31
+ own), and no account anywhere.
32
+
33
+ {#install-pw}
34
+ ## Install pw
35
+
36
+ 1. Install pw, pulpweaver4’s command line, from npm, with the core it
37
+ runs:
38
+
39
+ {.untested}
40
+ ``` sh
41
+ npm install --global pulpweaver4-cli
42
+ ```
43
+
44
+ That installs the latest release. This manual documents 0.0.185; to
45
+ install that one, name it: `npm install --global pulpweaver4-cli@0.0.185`.
46
+ npm puts `pw` on your path; `pw --help` lists the commands. npm may
47
+ warn that `esbuild` has an install script it didn’t run; pw doesn’t
48
+ need it.
49
+
50
+ 2. Download the Chromium that pw lays pages out in. pw always uses the same
51
+ build, so that the same book gives the same PDF on any machine:
52
+
53
+ {.untested}
54
+ ``` sh
55
+ npx playwright@1.63.0 install --no-shell chromium
56
+ ```
57
+
58
+ (`--no-shell` leaves out a second, smaller browser that pw never uses.)
59
+
60
+ {#start-a-book}
61
+ ## Start a book
62
+
63
+ `pw new` makes a project, a folder with everything a book needs, titled
64
+ after the folder’s name:
65
+
66
+ {project=start}
67
+ ``` sh
68
+ cd ~
69
+ pw new my-first-book
70
+ ```
71
+
72
+ {project=start .output}
73
+ ``` text
74
+ pw new: made my-first-book, with 10 files:
75
+ .gitignore
76
+ chapters/01-beginning.dj
77
+ chapters/02-writing.dj
78
+ fonts/CrimsonPro-Italic-VF.ttf
79
+ fonts/CrimsonPro-VF.ttf
80
+ fonts/NotoSansSymbols2-Boxes.ttf
81
+ fonts/OFL.txt
82
+ pulpweaver4.toml
83
+ styles/book.css
84
+ tests/book.test.ts
85
+
86
+ Then: cd my-first-book, and pw build, pw lint, pw test.
87
+ ```
88
+
89
+ {#build-it}
90
+ ## Build it
91
+
92
+ {project=start}
93
+ ``` sh
94
+ cd my-first-book
95
+ pw build
96
+ ```
97
+
98
+ {project=start .output}
99
+ ``` text
100
+ pw build: web: dist/web/ (6 files)
101
+ pw build: paperback: dist/paperback/paperback.pdf
102
+ pw build: letter: dist/letter/letter.pdf
103
+ pw build: text: dist/text/book.txt
104
+ ```
105
+
106
+ Each of the book’s four editions is written to its own folder in `dist/`:
107
+
108
+ - *`dist/paperback/paperback.pdf`*, a 5.5 × 8.5 in paperback, each
109
+ chapter opening on a right-hand page.
110
+ - *`dist/letter/letter.pdf`*, the same book on US Letter pages, to print
111
+ at home or at the office.
112
+ - *`dist/web/`*, the web edition: open `dist/web/index.html` in a
113
+ browser.
114
+ - *`dist/text/book.txt`*, plain text.
115
+
116
+ {#print-it}
117
+ ## Print it
118
+
119
+ Open `dist/letter/letter.pdf` and print it, at *actual size* (100%, not
120
+ “fit to page”), so the margins stay as the book set them. The paperback’s
121
+ PDF is for a printer that trims to 5.5 × 8.5 in, such as a print-on-demand
122
+ service; printed on Letter or A4 paper at actual size, it sits in the middle
123
+ of each sheet.
124
+
125
+ You’ve built and printed a book. [Your first book](#your-first-book) goes
126
+ through the project’s files, to change it into your own: chapters, styles,
127
+ editions and tests.
128
+
129
+ {#if-something-goes-wrong}
130
+ ## If something goes wrong
131
+
132
+ - *`pw: command not found`*: npm’s global folder isn’t on your path.
133
+ `npm prefix --global` says where it is; add its `bin` to your path.
134
+ - *`EACCES` from `npm install --global`*: your npm’s global folder
135
+ belongs to root. Install Node.js with a version manager such as
136
+ [nvm](https://github.com/nvm-sh/nvm), or give npm a folder of your own
137
+ ([npm’s guide](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally)),
138
+ rather than `sudo`.
139
+ - *`Chromium 153.0.8010.12 isn't installed`*: step 2 didn’t run, or it
140
+ was interrupted. Run it again.
141
+ - *An error with a file, a line and a column* is a problem with the
142
+ book, not with pw: it says what is wrong and, usually, how to fix it.
143
+ pw lists every problem it finds, not only the first.
144
+
145
+ {#following-along}
146
+ ## Following along
147
+
148
+ - *The code* is [inkylabs/pulpweaver4](https://gitlab.com/inkylabs/pulpweaver4)
149
+ on GitLab, public and CC0 licensed: no rights reserved. Its
150
+ [issues](https://gitlab.com/inkylabs/pulpweaver4/-/issues) are the place
151
+ for a bug or a question.
152
+ - *The releases* are on npm:
153
+ [`pulpweaver4`](https://www.npmjs.com/package/pulpweaver4), the core, and
154
+ [`pulpweaver4-cli`](https://www.npmjs.com/package/pulpweaver4-cli), pw.
155
+ From 0.0.92 on, pulpweaver4’s GitLab CI publishes them with
156
+ [npm provenance](https://docs.npmjs.com/generating-provenance-statements),
157
+ so npm shows the commit and pipeline each was built from
158
+ (`npm audit signatures` checks it); 0.0.88 and 0.0.91 were published by
159
+ hand and have none.
160
+ - *The plan* is [pulpweaver](https://plans.inkylabs.com/pulpweaver) on
161
+ Inky Labs’ plans site: what pulpweaver4 is for, how it works, and the
162
+ phases it is built in.
163
+ - *The work* is in the project’s
164
+ [milestones](https://gitlab.com/inkylabs/pulpweaver4/-/milestones), one for
165
+ each phase. pulpweaver4’s first two phases, the core and editions, are
166
+ done: what this manual describes works today, and it says where
167
+ something planned isn’t built yet.