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.
- package/dist/ast/djot.js +23 -0
- package/dist/ast/djot.js.map +1 -1
- package/dist/ast/index.d.ts +1 -0
- package/dist/ast/index.js +1 -0
- package/dist/ast/index.js.map +1 -1
- package/dist/ast/nodes.d.ts +59 -5
- package/dist/ast/nodes.js.map +1 -1
- package/dist/ast/table.d.ts +27 -0
- package/dist/ast/table.js +32 -0
- package/dist/ast/table.js.map +1 -0
- package/dist/browser.js +2420 -0
- package/dist/citations/index.d.ts +1 -1
- package/dist/citations/index.js +1 -1
- package/dist/citations/index.js.map +1 -1
- package/dist/citations/project.d.ts +12 -2
- package/dist/citations/project.js +21 -7
- package/dist/citations/project.js.map +1 -1
- package/dist/colour/images.d.ts +11 -2
- package/dist/colour/images.js +53 -3
- package/dist/colour/images.js.map +1 -1
- package/dist/colour/ink-limit.d.ts +2 -2
- package/dist/colour/ink-limit.js +6 -0
- package/dist/colour/ink-limit.js.map +1 -1
- package/dist/colour/previews.d.ts +8 -4
- package/dist/colour/previews.js +11 -8
- package/dist/colour/previews.js.map +1 -1
- package/dist/config/config.d.ts +91 -3
- package/dist/config/config.js +200 -3
- package/dist/config/config.js.map +1 -1
- package/dist/config/project-schema.d.ts +0 -8
- package/dist/config/project-schema.js +207 -12
- package/dist/config/project-schema.js.map +1 -1
- package/dist/config/schema.js +10 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/config/secrets.d.ts +11 -0
- package/dist/config/secrets.js +19 -0
- package/dist/config/secrets.js.map +1 -0
- package/dist/csl/project.d.ts +19 -4
- package/dist/csl/project.js +23 -10
- package/dist/csl/project.js.map +1 -1
- package/dist/fonts/index.d.ts +1 -1
- package/dist/fonts/index.js +1 -1
- package/dist/fonts/index.js.map +1 -1
- package/dist/fonts/lint.d.ts +51 -0
- package/dist/fonts/lint.js +101 -16
- package/dist/fonts/lint.js.map +1 -1
- package/dist/fonts/walk.d.ts +13 -0
- package/dist/fonts/walk.js +50 -33
- package/dist/fonts/walk.js.map +1 -1
- package/dist/html/css.d.ts +4 -0
- package/dist/html/css.js +11 -3
- package/dist/html/css.js.map +1 -1
- package/dist/html/dom.d.ts +6 -1
- package/dist/html/dom.js +28 -6
- package/dist/html/dom.js.map +1 -1
- package/dist/html/generated.d.ts +17 -0
- package/dist/html/generated.js +21 -0
- package/dist/html/generated.js.map +1 -0
- package/dist/html/images.d.ts +18 -0
- package/dist/html/images.js +49 -2
- package/dist/html/images.js.map +1 -1
- package/dist/html/index.d.ts +1 -0
- package/dist/html/index.js +1 -0
- package/dist/html/index.js.map +1 -1
- package/dist/html/render.d.ts +5 -4
- package/dist/html/render.js +24 -6
- package/dist/html/render.js.map +1 -1
- package/dist/hyphenation/exceptions.d.ts +5 -0
- package/dist/hyphenation/exceptions.js +11 -0
- package/dist/hyphenation/exceptions.js.map +1 -1
- package/dist/hyphenation/index.d.ts +1 -1
- package/dist/hyphenation/index.js +1 -1
- package/dist/hyphenation/index.js.map +1 -1
- package/dist/import/convert.d.ts +21 -0
- package/dist/import/convert.js +65 -0
- package/dist/import/convert.js.map +1 -0
- package/dist/incremental/cache.d.ts +59 -0
- package/dist/incremental/cache.js +64 -0
- package/dist/incremental/cache.js.map +1 -0
- package/dist/incremental/index.d.ts +3 -0
- package/dist/incremental/index.js +4 -0
- package/dist/incremental/index.js.map +1 -0
- package/dist/incremental/keys.d.ts +27 -0
- package/dist/incremental/keys.js +89 -0
- package/dist/incremental/keys.js.map +1 -0
- package/dist/incremental/session.d.ts +180 -0
- package/dist/incremental/session.js +401 -0
- package/dist/incremental/session.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/indexes/layout.d.ts +8 -2
- package/dist/indexes/layout.js +6 -4
- package/dist/indexes/layout.js.map +1 -1
- package/dist/layout/cache.d.ts +174 -0
- package/dist/layout/cache.js +150 -0
- package/dist/layout/cache.js.map +1 -0
- package/dist/layout/converge.d.ts +28 -0
- package/dist/layout/converge.js +102 -9
- package/dist/layout/converge.js.map +1 -1
- package/dist/layout/counters.d.ts +4 -0
- package/dist/layout/counters.js +15 -0
- package/dist/layout/counters.js.map +1 -1
- package/dist/layout/index.d.ts +5 -2
- package/dist/layout/index.js +3 -0
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/lists.d.ts +52 -3
- package/dist/layout/lists.js +513 -46
- package/dist/layout/lists.js.map +1 -1
- package/dist/layout/lookahead.d.ts +151 -0
- package/dist/layout/lookahead.js +581 -0
- package/dist/layout/lookahead.js.map +1 -0
- package/dist/layout/margin-boxes.d.ts +11 -1
- package/dist/layout/margin-boxes.js +24 -1
- package/dist/layout/margin-boxes.js.map +1 -1
- package/dist/layout/page-rules.d.ts +6 -1
- package/dist/layout/page-rules.js +42 -1
- package/dist/layout/page-rules.js.map +1 -1
- package/dist/layout/page.js +4 -2
- package/dist/layout/page.js.map +1 -1
- package/dist/layout/pagebuilder.d.ts +248 -3
- package/dist/layout/pagebuilder.js +512 -19
- package/dist/layout/pagebuilder.js.map +1 -1
- package/dist/layout/pages.d.ts +108 -1
- package/dist/layout/pages.js +1362 -159
- package/dist/layout/pages.js.map +1 -1
- package/dist/layout/paragraph.d.ts +14 -0
- package/dist/layout/paragraph.js +304 -31
- package/dist/layout/paragraph.js.map +1 -1
- package/dist/layout/pre.js +4 -0
- package/dist/layout/pre.js.map +1 -1
- package/dist/layout/protrusion.d.ts +26 -0
- package/dist/layout/protrusion.js +39 -0
- package/dist/layout/protrusion.js.map +1 -0
- package/dist/layout/ranges.d.ts +2 -0
- package/dist/layout/ranges.js +22 -0
- package/dist/layout/ranges.js.map +1 -0
- package/dist/layout/region.d.ts +2 -1
- package/dist/layout/region.js +9 -5
- package/dist/layout/region.js.map +1 -1
- package/dist/layout/templates.d.ts +71 -0
- package/dist/layout/templates.js +290 -0
- package/dist/layout/templates.js.map +1 -0
- package/dist/layout/vlist.d.ts +3 -3
- package/dist/linebreak/items.d.ts +27 -2
- package/dist/linebreak/items.js +10 -3
- package/dist/linebreak/items.js.map +1 -1
- package/dist/linebreak/knuth-plass.d.ts +20 -0
- package/dist/linebreak/knuth-plass.js +68 -16
- package/dist/linebreak/knuth-plass.js.map +1 -1
- package/dist/lint/book.d.ts +13 -0
- package/dist/lint/book.js +52 -0
- package/dist/lint/book.js.map +1 -0
- package/dist/lint/config.d.ts +9 -0
- package/dist/lint/config.js +40 -6
- package/dist/lint/config.js.map +1 -1
- package/dist/lint/linter.js +1 -0
- package/dist/lint/linter.js.map +1 -1
- package/dist/lint/project.js +1 -1
- package/dist/lint/project.js.map +1 -1
- package/dist/lint/rules/layout.d.ts +3 -1
- package/dist/lint/rules/layout.js +8 -6
- package/dist/lint/rules/layout.js.map +1 -1
- package/dist/lint/rules/source.js +1 -1
- package/dist/lint/rules/source.js.map +1 -1
- package/dist/lint/testing.js +1 -0
- package/dist/lint/testing.js.map +1 -1
- package/dist/measure/bidi-data.d.ts +14 -0
- package/dist/measure/bidi-data.js +69 -0
- package/dist/measure/bidi-data.js.map +1 -0
- package/dist/measure/bidi.d.ts +70 -0
- package/dist/measure/bidi.js +225 -0
- package/dist/measure/bidi.js.map +1 -0
- package/dist/measure/css.d.ts +5 -0
- package/dist/measure/css.js +2 -0
- package/dist/measure/css.js.map +1 -1
- package/dist/measure/measurer.d.ts +36 -2
- package/dist/measure/measurer.js +220 -22
- package/dist/measure/measurer.js.map +1 -1
- package/dist/measure/model.d.ts +20 -2
- package/dist/measure/model.js +13 -6
- package/dist/measure/model.js.map +1 -1
- package/dist/measure/script-data.d.ts +6 -0
- package/dist/measure/script-data.js +34 -0
- package/dist/measure/script-data.js.map +1 -0
- package/dist/measure/scripts.d.ts +36 -0
- package/dist/measure/scripts.js +293 -0
- package/dist/measure/scripts.js.map +1 -0
- package/dist/output/output.d.ts +35 -3
- package/dist/output/output.js +26 -4
- package/dist/output/output.js.map +1 -1
- package/dist/paint/backgrounds.js +7 -20
- package/dist/paint/backgrounds.js.map +1 -1
- package/dist/paint/blend.d.ts +33 -13
- package/dist/paint/blend.js +73 -21
- package/dist/paint/blend.js.map +1 -1
- package/dist/paint/cache.d.ts +80 -0
- package/dist/paint/cache.js +537 -0
- package/dist/paint/cache.js.map +1 -0
- package/dist/paint/canvas.d.ts +4 -13
- package/dist/paint/canvas.js +45 -5
- package/dist/paint/canvas.js.map +1 -1
- package/dist/paint/context.d.ts +2 -0
- package/dist/paint/emphasis.js +1 -1
- package/dist/paint/emphasis.js.map +1 -1
- package/dist/paint/flatten.d.ts +24 -2
- package/dist/paint/flatten.js +55 -12
- package/dist/paint/flatten.js.map +1 -1
- package/dist/paint/forms.d.ts +64 -0
- package/dist/paint/forms.js +319 -0
- package/dist/paint/forms.js.map +1 -0
- package/dist/paint/images.d.ts +4 -1
- package/dist/paint/images.js +13 -2
- package/dist/paint/images.js.map +1 -1
- package/dist/paint/layers.d.ts +64 -0
- package/dist/paint/layers.js +137 -0
- package/dist/paint/layers.js.map +1 -0
- package/dist/paint/painter.d.ts +19 -6
- package/dist/paint/painter.js +15 -135
- package/dist/paint/painter.js.map +1 -1
- package/dist/paint/stacking.d.ts +1 -1
- package/dist/paint/stacking.js +9 -2
- package/dist/paint/stacking.js.map +1 -1
- package/dist/paint/text.d.ts +14 -3
- package/dist/paint/text.js +25 -4
- package/dist/paint/text.js.map +1 -1
- package/dist/paint/vertical.js +2 -2
- package/dist/paint/vertical.js.map +1 -1
- package/dist/pdf/encoded.d.ts +16 -0
- package/dist/pdf/encoded.js +35 -0
- package/dist/pdf/encoded.js.map +1 -0
- package/dist/pdf/include/colour.d.ts +105 -0
- package/dist/pdf/include/colour.js +349 -0
- package/dist/pdf/include/colour.js.map +1 -0
- package/dist/pdf/include/functions.d.ts +17 -0
- package/dist/pdf/include/functions.js +389 -0
- package/dist/pdf/include/functions.js.map +1 -0
- package/dist/pdf/include/pages.d.ts +14 -0
- package/dist/pdf/include/pages.js +27 -0
- package/dist/pdf/include/pages.js.map +1 -0
- package/dist/pdf/include/pdfjs/LICENSE +177 -0
- package/dist/pdf/include/pdfjs/pdf.min.mjs +27 -0
- package/dist/pdf/include/pdfjs/pdf.worker.min.mjs +27 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/pdf/include/pdfjs/wasm/LICENSE_JBIG2 +196 -0
- package/dist/pdf/include/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
- package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
- package/dist/pdf/include/pdfjs/wasm/LICENSE_QCMS +21 -0
- package/dist/pdf/include/pdfjs/wasm/jbig2.wasm +0 -0
- package/dist/pdf/include/pdfjs/wasm/openjpeg.wasm +0 -0
- package/dist/pdf/include/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/dist/pdf/include/pdfjs/wasm/quickjs-eval.wasm +0 -0
- package/dist/pdf/include/prepare.d.ts +58 -0
- package/dist/pdf/include/prepare.js +266 -0
- package/dist/pdf/include/prepare.js.map +1 -0
- package/dist/pdf/include/preview.d.ts +38 -0
- package/dist/pdf/include/preview.js +101 -0
- package/dist/pdf/include/preview.js.map +1 -0
- package/dist/pdf/include/rewrite.d.ts +57 -0
- package/dist/pdf/include/rewrite.js +803 -0
- package/dist/pdf/include/rewrite.js.map +1 -0
- package/dist/pdf/include/serialize.d.ts +32 -0
- package/dist/pdf/include/serialize.js +158 -0
- package/dist/pdf/include/serialize.js.map +1 -0
- package/dist/pdf/include/testing.d.ts +26 -0
- package/dist/pdf/include/testing.js +50 -0
- package/dist/pdf/include/testing.js.map +1 -0
- package/dist/pdf/index.d.ts +1 -0
- package/dist/pdf/index.js +1 -0
- package/dist/pdf/index.js.map +1 -1
- package/dist/pdf/structure/annotations.d.ts +33 -0
- package/dist/pdf/structure/annotations.js +112 -0
- package/dist/pdf/structure/annotations.js.map +1 -0
- package/dist/pdf/structure/forms.d.ts +10 -0
- package/dist/pdf/structure/forms.js +46 -0
- package/dist/pdf/structure/forms.js.map +1 -0
- package/dist/pdf/structure/index.d.ts +41 -5
- package/dist/pdf/structure/index.js +40 -5
- package/dist/pdf/structure/index.js.map +1 -1
- package/dist/pdf/structure/links.d.ts +2 -0
- package/dist/pdf/structure/links.js +1 -1
- package/dist/pdf/structure/links.js.map +1 -1
- package/dist/pdf/structure/presentation.d.ts +28 -0
- package/dist/pdf/structure/presentation.js +79 -0
- package/dist/pdf/structure/presentation.js.map +1 -0
- package/dist/pdf/structure/tags.d.ts +34 -2
- package/dist/pdf/structure/tags.js +117 -14
- package/dist/pdf/structure/tags.js.map +1 -1
- package/dist/pdf/types.d.ts +357 -11
- package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +44 -2
- package/dist/pdf/wasm/pulpweaver4_pdf.js +191 -2
- package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
- package/dist/pdf/writer.d.ts +13 -1
- package/dist/pdf/writer.js +26 -1
- package/dist/pdf/writer.js.map +1 -1
- package/dist/plugin/define.d.ts +200 -15
- package/dist/plugin/define.js +124 -15
- package/dist/plugin/define.js.map +1 -1
- package/dist/plugin/failure.d.ts +1 -1
- package/dist/plugin/index.d.ts +5 -4
- package/dist/plugin/index.js +5 -4
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/reference.d.ts +38 -0
- package/dist/plugin/reference.js +287 -0
- package/dist/plugin/reference.js.map +1 -0
- package/dist/plugin/register.d.ts +39 -7
- package/dist/plugin/register.js +83 -2
- package/dist/plugin/register.js.map +1 -1
- package/dist/preflight/index.d.ts +1 -1
- package/dist/preflight/index.js +1 -1
- package/dist/preflight/index.js.map +1 -1
- package/dist/preflight/pdfx.d.ts +35 -0
- package/dist/preflight/pdfx.js +33 -2
- package/dist/preflight/pdfx.js.map +1 -1
- package/dist/preflight/reader.d.ts +10 -3
- package/dist/preflight/reader.js +86 -5
- package/dist/preflight/reader.js.map +1 -1
- package/dist/print/impose.d.ts +66 -0
- package/dist/print/impose.js +331 -0
- package/dist/print/impose.js.map +1 -0
- package/dist/print/output.js +400 -50
- package/dist/print/output.js.map +1 -1
- package/dist/problem.js +4 -3
- package/dist/problem.js.map +1 -1
- package/dist/profile/index.d.ts +1 -0
- package/dist/profile/index.js +1 -0
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/lint.d.ts +1 -1
- package/dist/profile/lint.js +29 -1
- package/dist/profile/lint.js.map +1 -1
- package/dist/profile/list-table.d.ts +51 -0
- package/dist/profile/list-table.js +137 -0
- package/dist/profile/list-table.js.map +1 -0
- package/dist/profile/metadata.js +3 -0
- package/dist/profile/metadata.js.map +1 -1
- package/dist/profile/profile.d.ts +3 -0
- package/dist/profile/profile.js +9 -1
- package/dist/profile/profile.js.map +1 -1
- package/dist/project.js +3 -0
- package/dist/project.js.map +1 -1
- package/dist/qpdf/index.d.ts +2 -0
- package/dist/qpdf/index.js +3 -0
- package/dist/qpdf/index.js.map +1 -0
- package/dist/qpdf/qpdf.d.ts +125 -0
- package/dist/qpdf/qpdf.js +205 -0
- package/dist/qpdf/qpdf.js.map +1 -0
- package/dist/qpdf/testing.d.ts +12 -0
- package/dist/qpdf/testing.js +9 -0
- package/dist/qpdf/testing.js.map +1 -0
- package/dist/qpdf/wasm/LICENSE-qpdf +202 -0
- package/dist/qpdf/wasm/LICENSE-zlib +22 -0
- package/dist/qpdf/wasm/NOTICE-qpdf.md +42 -0
- package/dist/qpdf/wasm/qpdf.wasm +0 -0
- package/dist/render/index.d.ts +3 -0
- package/dist/render/index.js +2 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/render.d.ts +98 -0
- package/dist/render/render.js +243 -0
- package/dist/render/render.js.map +1 -0
- package/dist/reproducible/clock.d.ts +4 -5
- package/dist/reproducible/clock.js +4 -5
- package/dist/reproducible/clock.js.map +1 -1
- package/dist/spike/spike-page.chromium.json +4 -4
- package/dist/style/colours.d.ts +7 -2
- package/dist/style/colours.js +24 -2
- package/dist/style/colours.js.map +1 -1
- package/dist/style/compile.js +1 -1
- package/dist/style/compile.js.map +1 -1
- package/dist/style/defaults.d.ts +9 -3
- package/dist/style/defaults.js +14 -2
- package/dist/style/defaults.js.map +1 -1
- package/dist/style/gcpm.d.ts +1 -1
- package/dist/style/gcpm.js +17 -5
- package/dist/style/gcpm.js.map +1 -1
- package/dist/style/properties.js +84 -0
- package/dist/style/properties.js.map +1 -1
- package/dist/test/book.d.ts +22 -2
- package/dist/test/book.js +35 -2
- package/dist/test/book.js.map +1 -1
- package/dist/test/build.d.ts +23 -0
- package/dist/test/build.js +86 -33
- package/dist/test/build.js.map +1 -1
- package/dist/test/layout.js +128 -19
- package/dist/test/layout.js.map +1 -1
- package/dist/test/limits.d.ts +8 -0
- package/dist/test/limits.js +9 -0
- package/dist/test/limits.js.map +1 -0
- package/dist/test/pipeline.d.ts +23 -0
- package/dist/test/pipeline.js.map +1 -1
- package/dist/test/render.d.ts +26 -3
- package/dist/test/render.js +151 -23
- package/dist/test/render.js.map +1 -1
- package/dist/test/runner.d.ts +6 -3
- package/dist/test/runner.js +172 -105
- package/dist/test/runner.js.map +1 -1
- package/dist/test/text.js +2 -2
- package/dist/test/text.js.map +1 -1
- package/dist/text/output.js +2 -2
- package/dist/text/output.js.map +1 -1
- package/dist/text/render.d.ts +4 -3
- package/dist/text/render.js +126 -4
- package/dist/text/render.js.map +1 -1
- package/dist/transform/index.d.ts +1 -1
- package/dist/transform/index.js +1 -1
- package/dist/transform/index.js.map +1 -1
- package/dist/transform/run.d.ts +2 -0
- package/dist/transform/run.js +32 -16
- package/dist/transform/run.js.map +1 -1
- package/dist/web/output.js +116 -10
- package/dist/web/output.js.map +1 -1
- package/dist/web/runtime/justify.js.txt +2 -2
- package/dist/web/site.d.ts +2 -0
- package/dist/web/site.js +8 -1
- package/dist/web/site.js.map +1 -1
- package/docs/README.md +6 -1
- package/docs/manual/chapters/front.dj +34 -0
- package/docs/manual/chapters/guides/citations.dj +426 -0
- package/docs/manual/chapters/guides/colour-and-prepress.dj +261 -0
- package/docs/manual/chapters/guides/editions.dj +329 -0
- package/docs/manual/chapters/guides/in-a-web-page.dj +143 -0
- package/docs/manual/chapters/guides/lines-and-pages.dj +681 -0
- package/docs/manual/chapters/guides/lint-rules.dj +355 -0
- package/docs/manual/chapters/guides/pdfs.dj +501 -0
- package/docs/manual/chapters/guides/plugins.dj +425 -0
- package/docs/manual/chapters/guides/testing.dj +264 -0
- package/docs/manual/chapters/guides/writing-in-djot.dj +537 -0
- package/docs/manual/chapters/start/for-latex-users.dj +256 -0
- package/docs/manual/chapters/start/getting-started.dj +167 -0
- package/docs/manual/chapters/start/your-first-book.dj +426 -0
- package/docs/manual/fonts/CrimsonPro-Italic-VF.ttf +0 -0
- package/docs/manual/fonts/CrimsonPro-VF.ttf +0 -0
- package/docs/manual/fonts/JetBrainsMono-Regular.otf +0 -0
- package/docs/manual/fonts/NotoSansSymbols2-Boxes.ttf +0 -0
- package/docs/manual/fonts/OFL.txt +95 -0
- package/docs/manual/pulpweaver4.toml +39 -0
- package/docs/manual/styles/manual.css +137 -0
- package/docs/reference/css-properties/index.md +9 -0
- package/docs/reference/css-properties/pw-expansion.md +31 -0
- package/docs/reference/css-properties/pw-flow-into.md +31 -0
- package/docs/reference/css-properties/pw-knockout.md +26 -0
- package/docs/reference/css-properties/pw-layer.md +24 -0
- package/docs/reference/css-properties/pw-page-breaking.md +30 -0
- package/docs/reference/css-properties/pw-page-duration.md +28 -0
- package/docs/reference/css-properties/pw-page-rotate.md +29 -0
- package/docs/reference/css-properties/pw-page-transition.md +29 -0
- package/docs/reference/css-properties/pw-protrusion.md +31 -0
- package/docs/reference/lint-rules/ibid-across-page.md +2 -2
- package/docs/reference/plugin-api/capabilities.md +2 -2
- package/docs/reference/plugin-api/claim-kind.md +1 -1
- package/docs/reference/plugin-api/combine-exceptions.md +19 -0
- package/docs/reference/plugin-api/element-break-context.md +34 -0
- package/docs/reference/plugin-api/element-break-item.md +24 -0
- package/docs/reference/plugin-api/element-breaker.md +24 -0
- package/docs/reference/plugin-api/flow-definition.md +30 -0
- package/docs/reference/plugin-api/generated-reference.md +32 -0
- package/docs/reference/plugin-api/index-definition.md +32 -0
- package/docs/reference/plugin-api/index-titles.md +18 -0
- package/docs/reference/plugin-api/index.md +27 -3
- package/docs/reference/plugin-api/insert-class-definition.md +46 -0
- package/docs/reference/plugin-api/insert-placement.md +22 -0
- package/docs/reference/plugin-api/insert-placements.md +18 -0
- package/docs/reference/plugin-api/layout-definition.md +9 -5
- package/docs/reference/plugin-api/layout-slot.md +6 -16
- package/docs/reference/plugin-api/lint-context.md +3 -1
- package/docs/reference/plugin-api/lint-definition.md +1 -1
- package/docs/reference/plugin-api/lint-edition.md +2 -0
- package/docs/reference/plugin-api/page-builder-event.md +22 -0
- package/docs/reference/plugin-api/page-builder-hook.md +7 -3
- package/docs/reference/plugin-api/page-builder-page-event.md +30 -0
- package/docs/reference/plugin-api/page-template-definition.md +34 -0
- package/docs/reference/plugin-api/page-template-region-definition.md +46 -0
- package/docs/reference/plugin-api/plugin-definition.md +5 -1
- package/docs/reference/plugin-api/plugin-reference-options.md +32 -0
- package/docs/reference/plugin-api/plugin-reference.md +22 -0
- package/docs/reference/plugin-api/plugin-registry.md +15 -5
- package/docs/reference/plugin-api/plugin-stage.md +1 -1
- package/docs/reference/plugin-api/plugin.md +9 -2
- package/docs/reference/plugin-api/reference-page.md +34 -0
- package/docs/reference/plugin-api/render-reference-page.md +18 -0
- package/docs/reference/plugin-api/renderers.md +1 -1
- package/docs/reference/pulpweaver4-toml/editions.md +239 -2
- package/docs/reference/pulpweaver4-toml/index.md +44 -1
- package/docs/reference/pulpweaver4-toml/inks.md +15 -4
- package/docs/reference/pulpweaver4-toml/lint.md +1 -1
- 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` | ``, drawn as vectors, and `figure.pdf#page=2` for another page ([PDFs as images](#pdf-images)) |
|
|
193
|
+
| `pdfpages`’ `\includepdf[pages=-]{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.
|