pulpweaver4 0.0.0-stage → 0.0.91
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.d.ts +124 -0
- package/dist/ast/djot.js +464 -0
- package/dist/ast/djot.js.map +1 -0
- package/dist/ast/index.d.ts +10 -0
- package/dist/ast/index.js +11 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/ast/locator.d.ts +27 -0
- package/dist/ast/locator.js +77 -0
- package/dist/ast/locator.js.map +1 -0
- package/dist/ast/nodes.d.ts +543 -0
- package/dist/ast/nodes.js +56 -0
- package/dist/ast/nodes.js.map +1 -0
- package/dist/ast/position.d.ts +88 -0
- package/dist/ast/position.js +98 -0
- package/dist/ast/position.js.map +1 -0
- package/dist/ast/traverse.d.ts +12 -0
- package/dist/ast/traverse.js +37 -0
- package/dist/ast/traverse.js.map +1 -0
- package/dist/bibliography/biblatex.d.ts +13 -0
- package/dist/bibliography/biblatex.js +849 -0
- package/dist/bibliography/biblatex.js.map +1 -0
- package/dist/bibliography/bibtex.d.ts +39 -0
- package/dist/bibliography/bibtex.js +259 -0
- package/dist/bibliography/bibtex.js.map +1 -0
- package/dist/bibliography/csl.d.ts +9 -0
- package/dist/bibliography/csl.js +241 -0
- package/dist/bibliography/csl.js.map +1 -0
- package/dist/bibliography/dates.d.ts +33 -0
- package/dist/bibliography/dates.js +223 -0
- package/dist/bibliography/dates.js.map +1 -0
- package/dist/bibliography/index.d.ts +8 -0
- package/dist/bibliography/index.js +9 -0
- package/dist/bibliography/index.js.map +1 -0
- package/dist/bibliography/item.d.ts +142 -0
- package/dist/bibliography/item.js +181 -0
- package/dist/bibliography/item.js.map +1 -0
- package/dist/bibliography/latex.d.ts +21 -0
- package/dist/bibliography/latex.js +586 -0
- package/dist/bibliography/latex.js.map +1 -0
- package/dist/bibliography/names.d.ts +23 -0
- package/dist/bibliography/names.js +244 -0
- package/dist/bibliography/names.js.map +1 -0
- package/dist/bibliography/read.d.ts +24 -0
- package/dist/bibliography/read.js +50 -0
- package/dist/bibliography/read.js.map +1 -0
- package/dist/citations/book.d.ts +93 -0
- package/dist/citations/book.js +217 -0
- package/dist/citations/book.js.map +1 -0
- package/dist/citations/collect.d.ts +56 -0
- package/dist/citations/collect.js +129 -0
- package/dist/citations/collect.js.map +1 -0
- package/dist/citations/hast.d.ts +12 -0
- package/dist/citations/hast.js +49 -0
- package/dist/citations/hast.js.map +1 -0
- package/dist/citations/index.d.ts +14 -0
- package/dist/citations/index.js +15 -0
- package/dist/citations/index.js.map +1 -0
- package/dist/citations/lint.d.ts +70 -0
- package/dist/citations/lint.js +92 -0
- package/dist/citations/lint.js.map +1 -0
- package/dist/citations/notes.d.ts +11 -0
- package/dist/citations/notes.js +163 -0
- package/dist/citations/notes.js.map +1 -0
- package/dist/citations/positions.d.ts +34 -0
- package/dist/citations/positions.js +90 -0
- package/dist/citations/positions.js.map +1 -0
- package/dist/citations/project.d.ts +7 -0
- package/dist/citations/project.js +24 -0
- package/dist/citations/project.js.map +1 -0
- package/dist/colour/cmyk.d.ts +71 -0
- package/dist/colour/cmyk.js +210 -0
- package/dist/colour/cmyk.js.map +1 -0
- package/dist/colour/images.d.ts +36 -0
- package/dist/colour/images.js +106 -0
- package/dist/colour/images.js.map +1 -0
- package/dist/colour/index.d.ts +7 -0
- package/dist/colour/index.js +8 -0
- package/dist/colour/index.js.map +1 -0
- package/dist/colour/ink-limit.d.ts +68 -0
- package/dist/colour/ink-limit.js +109 -0
- package/dist/colour/ink-limit.js.map +1 -0
- package/dist/colour/intents.d.ts +145 -0
- package/dist/colour/intents.js +193 -0
- package/dist/colour/intents.js.map +1 -0
- package/dist/colour/lcms.d.ts +79 -0
- package/dist/colour/lcms.js +229 -0
- package/dist/colour/lcms.js.map +1 -0
- package/dist/colour/previews.d.ts +49 -0
- package/dist/colour/previews.js +116 -0
- package/dist/colour/previews.js.map +1 -0
- package/dist/colour/wasm/LICENSE-lcms2 +22 -0
- package/dist/colour/wasm/lcms2.wasm +0 -0
- package/dist/config/config.d.ts +114 -0
- package/dist/config/config.js +309 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/page.d.ts +42 -0
- package/dist/config/page.js +95 -0
- package/dist/config/page.js.map +1 -0
- package/dist/config/project-schema.d.ts +23 -0
- package/dist/config/project-schema.js +223 -0
- package/dist/config/project-schema.js.map +1 -0
- package/dist/config/schema.d.ts +68 -0
- package/dist/config/schema.js +333 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/toml.d.ts +54 -0
- package/dist/config/toml.js +238 -0
- package/dist/config/toml.js.map +1 -0
- package/dist/contents/index.d.ts +8 -0
- package/dist/contents/index.js +9 -0
- package/dist/contents/index.js.map +1 -0
- package/dist/contents/transform.d.ts +64 -0
- package/dist/contents/transform.js +149 -0
- package/dist/contents/transform.js.map +1 -0
- package/dist/csl/affix.d.ts +16 -0
- package/dist/csl/affix.js +74 -0
- package/dist/csl/affix.js.map +1 -0
- package/dist/csl/data/chicago-author-date.d.ts +2 -0
- package/dist/csl/data/chicago-author-date.js +3 -0
- package/dist/csl/data/chicago-author-date.js.map +1 -0
- package/dist/csl/data/chicago-notes-bibliography.d.ts +2 -0
- package/dist/csl/data/chicago-notes-bibliography.js +3 -0
- package/dist/csl/data/chicago-notes-bibliography.js.map +1 -0
- package/dist/csl/data/locales-en-GB.d.ts +2 -0
- package/dist/csl/data/locales-en-GB.js +3 -0
- package/dist/csl/data/locales-en-GB.js.map +1 -0
- package/dist/csl/data/locales-en-US.d.ts +2 -0
- package/dist/csl/data/locales-en-US.js +3 -0
- package/dist/csl/data/locales-en-US.js.map +1 -0
- package/dist/csl/dates.d.ts +30 -0
- package/dist/csl/dates.js +223 -0
- package/dist/csl/dates.js.map +1 -0
- package/dist/csl/format.d.ts +29 -0
- package/dist/csl/format.js +157 -0
- package/dist/csl/format.js.map +1 -0
- package/dist/csl/index.d.ts +26 -0
- package/dist/csl/index.js +16 -0
- package/dist/csl/index.js.map +1 -0
- package/dist/csl/ir.d.ts +103 -0
- package/dist/csl/ir.js +549 -0
- package/dist/csl/ir.js.map +1 -0
- package/dist/csl/load.d.ts +98 -0
- package/dist/csl/load.js +163 -0
- package/dist/csl/load.js.map +1 -0
- package/dist/csl/locale.d.ts +90 -0
- package/dist/csl/locale.js +251 -0
- package/dist/csl/locale.js.map +1 -0
- package/dist/csl/names.d.ts +41 -0
- package/dist/csl/names.js +203 -0
- package/dist/csl/names.js.map +1 -0
- package/dist/csl/numbers.d.ts +48 -0
- package/dist/csl/numbers.js +170 -0
- package/dist/csl/numbers.js.map +1 -0
- package/dist/csl/processor.d.ts +179 -0
- package/dist/csl/processor.js +765 -0
- package/dist/csl/processor.js.map +1 -0
- package/dist/csl/project.d.ts +21 -0
- package/dist/csl/project.js +85 -0
- package/dist/csl/project.js.map +1 -0
- package/dist/csl/render.d.ts +130 -0
- package/dist/csl/render.js +748 -0
- package/dist/csl/render.js.map +1 -0
- package/dist/csl/style.d.ts +168 -0
- package/dist/csl/style.js +262 -0
- package/dist/csl/style.js.map +1 -0
- package/dist/csl/xml.d.ts +28 -0
- package/dist/csl/xml.js +162 -0
- package/dist/csl/xml.js.map +1 -0
- package/dist/djot/djot.js/LICENSE +20 -0
- package/dist/djot/djot.js/src/ast.d.ts +327 -0
- package/dist/djot/djot.js/src/ast.js +68 -0
- package/dist/djot/djot.js/src/ast.js.map +1 -0
- package/dist/djot/djot.js/src/attributes.d.ts +31 -0
- package/dist/djot/djot.js/src/attributes.js +300 -0
- package/dist/djot/djot.js/src/attributes.js.map +1 -0
- package/dist/djot/djot.js/src/block.d.ts +87 -0
- package/dist/djot/djot.js/src/block.js +1201 -0
- package/dist/djot/djot.js/src/block.js.map +1 -0
- package/dist/djot/djot.js/src/djot-renderer.d.ts +8 -0
- package/dist/djot/djot.js/src/djot-renderer.js +755 -0
- package/dist/djot/djot.js/src/djot-renderer.js.map +1 -0
- package/dist/djot/djot.js/src/event.d.ts +6 -0
- package/dist/djot/djot.js/src/event.js +2 -0
- package/dist/djot/djot.js/src/event.js.map +1 -0
- package/dist/djot/djot.js/src/filter.d.ts +13 -0
- package/dist/djot/djot.js/src/filter.js +159 -0
- package/dist/djot/djot.js/src/filter.js.map +1 -0
- package/dist/djot/djot.js/src/find.d.ts +7 -0
- package/dist/djot/djot.js/src/find.js +33 -0
- package/dist/djot/djot.js/src/find.js.map +1 -0
- package/dist/djot/djot.js/src/html.d.ts +40 -0
- package/dist/djot/djot.js/src/html.js +657 -0
- package/dist/djot/djot.js/src/html.js.map +1 -0
- package/dist/djot/djot.js/src/index.d.ts +9 -0
- package/dist/djot/djot.js/src/index.js +9 -0
- package/dist/djot/djot.js/src/index.js.map +1 -0
- package/dist/djot/djot.js/src/inline.d.ts +62 -0
- package/dist/djot/djot.js/src/inline.js +1032 -0
- package/dist/djot/djot.js/src/inline.js.map +1 -0
- package/dist/djot/djot.js/src/options.d.ts +13 -0
- package/dist/djot/djot.js/src/options.js +27 -0
- package/dist/djot/djot.js/src/options.js.map +1 -0
- package/dist/djot/djot.js/src/pandoc.d.ts +20 -0
- package/dist/djot/djot.js/src/pandoc.js +1110 -0
- package/dist/djot/djot.js/src/pandoc.js.map +1 -0
- package/dist/djot/djot.js/src/parse.d.ts +19 -0
- package/dist/djot/djot.js/src/parse.js +1445 -0
- package/dist/djot/djot.js/src/parse.js.map +1 -0
- package/dist/djot/djot.js/src/version.d.ts +1 -0
- package/dist/djot/djot.js/src/version.js +2 -0
- package/dist/djot/djot.js/src/version.js.map +1 -0
- package/dist/djot/index.d.ts +5 -0
- package/dist/djot/index.js +6 -0
- package/dist/djot/index.js.map +1 -0
- package/dist/djot/read.d.ts +57 -0
- package/dist/djot/read.js +146 -0
- package/dist/djot/read.js.map +1 -0
- package/dist/fonts/css.d.ts +82 -0
- package/dist/fonts/css.js +329 -0
- package/dist/fonts/css.js.map +1 -0
- package/dist/fonts/faces.d.ts +101 -0
- package/dist/fonts/faces.js +226 -0
- package/dist/fonts/faces.js.map +1 -0
- package/dist/fonts/index.d.ts +12 -0
- package/dist/fonts/index.js +13 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/lint.d.ts +58 -0
- package/dist/fonts/lint.js +209 -0
- package/dist/fonts/lint.js.map +1 -0
- package/dist/fonts/match.d.ts +36 -0
- package/dist/fonts/match.js +104 -0
- package/dist/fonts/match.js.map +1 -0
- package/dist/fonts/names.d.ts +9 -0
- package/dist/fonts/names.js +50 -0
- package/dist/fonts/names.js.map +1 -0
- package/dist/fonts/subset.d.ts +72 -0
- package/dist/fonts/subset.js +169 -0
- package/dist/fonts/subset.js.map +1 -0
- package/dist/fonts/walk.d.ts +33 -0
- package/dist/fonts/walk.js +120 -0
- package/dist/fonts/walk.js.map +1 -0
- package/dist/fonts/wasm/LICENSE-harfbuzzjs +19 -0
- package/dist/fonts/wasm/harfbuzz-subset.wasm +0 -0
- package/dist/html/check.d.ts +62 -0
- package/dist/html/check.js +186 -0
- package/dist/html/check.js.map +1 -0
- package/dist/html/counters.d.ts +32 -0
- package/dist/html/counters.js +72 -0
- package/dist/html/counters.js.map +1 -0
- package/dist/html/css.d.ts +33 -0
- package/dist/html/css.js +72 -0
- package/dist/html/css.js.map +1 -0
- package/dist/html/dom.d.ts +28 -0
- package/dist/html/dom.js +162 -0
- package/dist/html/dom.js.map +1 -0
- package/dist/html/editions.d.ts +26 -0
- package/dist/html/editions.js +57 -0
- package/dist/html/editions.js.map +1 -0
- package/dist/html/images.d.ts +13 -0
- package/dist/html/images.js +62 -0
- package/dist/html/images.js.map +1 -0
- package/dist/html/index.d.ts +14 -0
- package/dist/html/index.js +15 -0
- package/dist/html/index.js.map +1 -0
- package/dist/html/registry.d.ts +120 -0
- package/dist/html/registry.js +48 -0
- package/dist/html/registry.js.map +1 -0
- package/dist/html/render.d.ts +99 -0
- package/dist/html/render.js +694 -0
- package/dist/html/render.js.map +1 -0
- package/dist/hyphenation/NOTICE +429 -0
- package/dist/hyphenation/exceptions.d.ts +60 -0
- package/dist/hyphenation/exceptions.js +79 -0
- package/dist/hyphenation/exceptions.js.map +1 -0
- package/dist/hyphenation/hyphenator.d.ts +66 -0
- package/dist/hyphenation/hyphenator.js +245 -0
- package/dist/hyphenation/hyphenator.js.map +1 -0
- package/dist/hyphenation/index.d.ts +4 -0
- package/dist/hyphenation/index.js +5 -0
- package/dist/hyphenation/index.js.map +1 -0
- package/dist/hyphenation/languages.d.ts +20 -0
- package/dist/hyphenation/languages.js +75 -0
- package/dist/hyphenation/languages.js.map +1 -0
- package/dist/hyphenation/patterns/af.wasm +0 -0
- package/dist/hyphenation/patterns/as.wasm +0 -0
- package/dist/hyphenation/patterns/be.wasm +0 -0
- package/dist/hyphenation/patterns/bg.wasm +0 -0
- package/dist/hyphenation/patterns/bn.wasm +0 -0
- package/dist/hyphenation/patterns/ca.wasm +0 -0
- package/dist/hyphenation/patterns/cy.wasm +0 -0
- package/dist/hyphenation/patterns/da.wasm +0 -0
- package/dist/hyphenation/patterns/de.wasm +0 -0
- package/dist/hyphenation/patterns/el-monoton.wasm +0 -0
- package/dist/hyphenation/patterns/el-polyton.wasm +0 -0
- package/dist/hyphenation/patterns/en-gb.wasm +0 -0
- package/dist/hyphenation/patterns/en-us.wasm +0 -0
- package/dist/hyphenation/patterns/eo.wasm +0 -0
- package/dist/hyphenation/patterns/es.wasm +0 -0
- package/dist/hyphenation/patterns/et.wasm +0 -0
- package/dist/hyphenation/patterns/eu.wasm +0 -0
- package/dist/hyphenation/patterns/fi-x-school.wasm +0 -0
- package/dist/hyphenation/patterns/fr.wasm +0 -0
- package/dist/hyphenation/patterns/fur.wasm +0 -0
- package/dist/hyphenation/patterns/ga.wasm +0 -0
- package/dist/hyphenation/patterns/gl.wasm +0 -0
- package/dist/hyphenation/patterns/gu.wasm +0 -0
- package/dist/hyphenation/patterns/hi.wasm +0 -0
- package/dist/hyphenation/patterns/hr.wasm +0 -0
- package/dist/hyphenation/patterns/hsb.wasm +0 -0
- package/dist/hyphenation/patterns/ia.wasm +0 -0
- package/dist/hyphenation/patterns/is.wasm +0 -0
- package/dist/hyphenation/patterns/it.wasm +0 -0
- package/dist/hyphenation/patterns/ka.wasm +0 -0
- package/dist/hyphenation/patterns/kmr.wasm +0 -0
- package/dist/hyphenation/patterns/kn.wasm +0 -0
- package/dist/hyphenation/patterns/la.wasm +0 -0
- package/dist/hyphenation/patterns/lt.wasm +0 -0
- package/dist/hyphenation/patterns/ml.wasm +0 -0
- package/dist/hyphenation/patterns/mn-cyrl.wasm +0 -0
- package/dist/hyphenation/patterns/mr.wasm +0 -0
- package/dist/hyphenation/patterns/nb.wasm +0 -0
- package/dist/hyphenation/patterns/nl.wasm +0 -0
- package/dist/hyphenation/patterns/nn.wasm +0 -0
- package/dist/hyphenation/patterns/no.wasm +0 -0
- package/dist/hyphenation/patterns/oc.wasm +0 -0
- package/dist/hyphenation/patterns/or.wasm +0 -0
- package/dist/hyphenation/patterns/pa.wasm +0 -0
- package/dist/hyphenation/patterns/pi.wasm +0 -0
- package/dist/hyphenation/patterns/pl.wasm +0 -0
- package/dist/hyphenation/patterns/pms.wasm +0 -0
- package/dist/hyphenation/patterns/pt.wasm +0 -0
- package/dist/hyphenation/patterns/rm.wasm +0 -0
- package/dist/hyphenation/patterns/ru.wasm +0 -0
- package/dist/hyphenation/patterns/sh-cyrl.wasm +0 -0
- package/dist/hyphenation/patterns/sh-latn.wasm +0 -0
- package/dist/hyphenation/patterns/sk.wasm +0 -0
- package/dist/hyphenation/patterns/sl.wasm +0 -0
- package/dist/hyphenation/patterns/sq.wasm +0 -0
- package/dist/hyphenation/patterns/sv.wasm +0 -0
- package/dist/hyphenation/patterns/ta.wasm +0 -0
- package/dist/hyphenation/patterns/te.wasm +0 -0
- package/dist/hyphenation/patterns/th.wasm +0 -0
- package/dist/hyphenation/patterns/tk.wasm +0 -0
- package/dist/hyphenation/patterns/tr.wasm +0 -0
- package/dist/hyphenation/patterns/uk.wasm +0 -0
- package/dist/hyphenation/patterns/zh-latn-pinyin.wasm +0 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes/index.d.ts +10 -0
- package/dist/indexes/index.js +11 -0
- package/dist/indexes/index.js.map +1 -0
- package/dist/indexes/layout.d.ts +30 -0
- package/dist/indexes/layout.js +83 -0
- package/dist/indexes/layout.js.map +1 -0
- package/dist/indexes/locators.d.ts +33 -0
- package/dist/indexes/locators.js +51 -0
- package/dist/indexes/locators.js.map +1 -0
- package/dist/indexes/terms.d.ts +97 -0
- package/dist/indexes/terms.js +211 -0
- package/dist/indexes/terms.js.map +1 -0
- package/dist/indexes/transform.d.ts +90 -0
- package/dist/indexes/transform.js +154 -0
- package/dist/indexes/transform.js.map +1 -0
- package/dist/layout/calibrate.d.ts +12 -0
- package/dist/layout/calibrate.js +50 -0
- package/dist/layout/calibrate.js.map +1 -0
- package/dist/layout/converge.d.ts +31 -0
- package/dist/layout/converge.js +84 -0
- package/dist/layout/converge.js.map +1 -0
- package/dist/layout/counters.d.ts +16 -0
- package/dist/layout/counters.js +62 -0
- package/dist/layout/counters.js.map +1 -0
- package/dist/layout/first-letter.d.ts +34 -0
- package/dist/layout/first-letter.js +183 -0
- package/dist/layout/first-letter.js.map +1 -0
- package/dist/layout/fonts.d.ts +67 -0
- package/dist/layout/fonts.js +110 -0
- package/dist/layout/fonts.js.map +1 -0
- package/dist/layout/generated.d.ts +9 -0
- package/dist/layout/generated.js +83 -0
- package/dist/layout/generated.js.map +1 -0
- package/dist/layout/glue.d.ts +18 -0
- package/dist/layout/glue.js +48 -0
- package/dist/layout/glue.js.map +1 -0
- package/dist/layout/index.d.ts +17 -0
- package/dist/layout/index.js +18 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/lists.d.ts +91 -0
- package/dist/layout/lists.js +1068 -0
- package/dist/layout/lists.js.map +1 -0
- package/dist/layout/margin-boxes.d.ts +114 -0
- package/dist/layout/margin-boxes.js +429 -0
- package/dist/layout/margin-boxes.js.map +1 -0
- package/dist/layout/minipage.d.ts +85 -0
- package/dist/layout/minipage.js +83 -0
- package/dist/layout/minipage.js.map +1 -0
- package/dist/layout/page-box.d.ts +34 -0
- package/dist/layout/page-box.js +112 -0
- package/dist/layout/page-box.js.map +1 -0
- package/dist/layout/page-rules.d.ts +49 -0
- package/dist/layout/page-rules.js +205 -0
- package/dist/layout/page-rules.js.map +1 -0
- package/dist/layout/page.d.ts +51 -0
- package/dist/layout/page.js +133 -0
- package/dist/layout/page.js.map +1 -0
- package/dist/layout/pagebuilder.d.ts +243 -0
- package/dist/layout/pagebuilder.js +591 -0
- package/dist/layout/pagebuilder.js.map +1 -0
- package/dist/layout/pages.d.ts +77 -0
- package/dist/layout/pages.js +772 -0
- package/dist/layout/pages.js.map +1 -0
- package/dist/layout/paragraph.d.ts +194 -0
- package/dist/layout/paragraph.js +1148 -0
- package/dist/layout/paragraph.js.map +1 -0
- package/dist/layout/pre.d.ts +8 -0
- package/dist/layout/pre.js +151 -0
- package/dist/layout/pre.js.map +1 -0
- package/dist/layout/region.d.ts +66 -0
- package/dist/layout/region.js +200 -0
- package/dist/layout/region.js.map +1 -0
- package/dist/layout/vlist.d.ts +218 -0
- package/dist/layout/vlist.js +72 -0
- package/dist/layout/vlist.js.map +1 -0
- package/dist/linebreak/items.d.ts +69 -0
- package/dist/linebreak/items.js +44 -0
- package/dist/linebreak/items.js.map +1 -0
- package/dist/linebreak/knuth-plass.d.ts +149 -0
- package/dist/linebreak/knuth-plass.js +461 -0
- package/dist/linebreak/knuth-plass.js.map +1 -0
- package/dist/lint/config.d.ts +48 -0
- package/dist/lint/config.js +185 -0
- package/dist/lint/config.js.map +1 -0
- package/dist/lint/context.d.ts +64 -0
- package/dist/lint/context.js +37 -0
- package/dist/lint/context.js.map +1 -0
- package/dist/lint/fix.d.ts +40 -0
- package/dist/lint/fix.js +86 -0
- package/dist/lint/fix.js.map +1 -0
- package/dist/lint/index.d.ts +14 -0
- package/dist/lint/index.js +15 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/lint/linter.d.ts +59 -0
- package/dist/lint/linter.js +239 -0
- package/dist/lint/linter.js.map +1 -0
- package/dist/lint/presets.d.ts +20 -0
- package/dist/lint/presets.js +65 -0
- package/dist/lint/presets.js.map +1 -0
- package/dist/lint/project.d.ts +31 -0
- package/dist/lint/project.js +100 -0
- package/dist/lint/project.js.map +1 -0
- package/dist/lint/rules/html.d.ts +30 -0
- package/dist/lint/rules/html.js +163 -0
- package/dist/lint/rules/html.js.map +1 -0
- package/dist/lint/rules/layout.d.ts +42 -0
- package/dist/lint/rules/layout.js +428 -0
- package/dist/lint/rules/layout.js.map +1 -0
- package/dist/lint/rules/source.d.ts +67 -0
- package/dist/lint/rules/source.js +339 -0
- package/dist/lint/rules/source.js.map +1 -0
- package/dist/lint/testing.d.ts +7 -0
- package/dist/lint/testing.js +77 -0
- package/dist/lint/testing.js.map +1 -0
- package/dist/math/hast.d.ts +46 -0
- package/dist/math/hast.js +297 -0
- package/dist/math/hast.js.map +1 -0
- package/dist/math/index.d.ts +9 -0
- package/dist/math/index.js +10 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/mathjax/LICENSE-mathjax +202 -0
- package/dist/math/mathjax/LICENSE-speech-rule-engine +177 -0
- package/dist/math/mathjax/sre/af.json +146 -0
- package/dist/math/mathjax/sre/base.json +140 -0
- package/dist/math/mathjax/sre/ca.json +140 -0
- package/dist/math/mathjax/sre/da.json +140 -0
- package/dist/math/mathjax/sre/de.json +146 -0
- package/dist/math/mathjax/sre/en.json +158 -0
- package/dist/math/mathjax/sre/es.json +140 -0
- package/dist/math/mathjax/sre/euro.json +32 -0
- package/dist/math/mathjax/sre/fr.json +146 -0
- package/dist/math/mathjax/sre/hi.json +146 -0
- package/dist/math/mathjax/sre/it.json +146 -0
- package/dist/math/mathjax/sre/ko.json +146 -0
- package/dist/math/mathjax/sre/nb.json +146 -0
- package/dist/math/mathjax/sre/nemeth.json +125 -0
- package/dist/math/mathjax/sre/nn.json +146 -0
- package/dist/math/mathjax/sre/sv.json +146 -0
- package/dist/math/mathjax/svg/PUA.json +1 -0
- package/dist/math/mathjax/svg/accents-b-i.json +1 -0
- package/dist/math/mathjax/svg/accents.json +1 -0
- package/dist/math/mathjax/svg/arabic.json +1 -0
- package/dist/math/mathjax/svg/arrows.json +1 -0
- package/dist/math/mathjax/svg/braille-d.json +1 -0
- package/dist/math/mathjax/svg/braille.json +1 -0
- package/dist/math/mathjax/svg/calligraphic.json +1 -0
- package/dist/math/mathjax/svg/cherokee.json +1 -0
- package/dist/math/mathjax/svg/cyrillic-ss.json +1 -0
- package/dist/math/mathjax/svg/cyrillic.json +1 -0
- package/dist/math/mathjax/svg/devanagari.json +1 -0
- package/dist/math/mathjax/svg/double-struck.json +1 -0
- package/dist/math/mathjax/svg/fraktur.json +1 -0
- package/dist/math/mathjax/svg/greek-ss.json +1 -0
- package/dist/math/mathjax/svg/greek.json +1 -0
- package/dist/math/mathjax/svg/hebrew.json +1 -0
- package/dist/math/mathjax/svg/latin-b.json +1 -0
- package/dist/math/mathjax/svg/latin-bi.json +1 -0
- package/dist/math/mathjax/svg/latin-i.json +1 -0
- package/dist/math/mathjax/svg/latin.json +1 -0
- package/dist/math/mathjax/svg/marrows.json +1 -0
- package/dist/math/mathjax/svg/math.json +1 -0
- package/dist/math/mathjax/svg/monospace-ex.json +1 -0
- package/dist/math/mathjax/svg/monospace-l.json +1 -0
- package/dist/math/mathjax/svg/monospace.json +1 -0
- package/dist/math/mathjax/svg/mshapes.json +1 -0
- package/dist/math/mathjax/svg/phonetics-ss.json +1 -0
- package/dist/math/mathjax/svg/phonetics.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-b.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-bi.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-ex.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-i.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-r.json +1 -0
- package/dist/math/mathjax/svg/sans-serif.json +1 -0
- package/dist/math/mathjax/svg/script.json +1 -0
- package/dist/math/mathjax/svg/shapes.json +1 -0
- package/dist/math/mathjax/svg/symbols-b-i.json +1 -0
- package/dist/math/mathjax/svg/symbols.json +1 -0
- package/dist/math/mathjax/svg/variants.json +1 -0
- package/dist/math/mathjax.d.ts +67 -0
- package/dist/math/mathjax.js +162 -0
- package/dist/math/mathjax.js.map +1 -0
- package/dist/math/speech.d.ts +27 -0
- package/dist/math/speech.js +87 -0
- package/dist/math/speech.js.map +1 -0
- package/dist/math/typeset.d.ts +75 -0
- package/dist/math/typeset.js +108 -0
- package/dist/math/typeset.js.map +1 -0
- package/dist/measure/css.d.ts +44 -0
- package/dist/measure/css.js +158 -0
- package/dist/measure/css.js.map +1 -0
- package/dist/measure/index.d.ts +3 -0
- package/dist/measure/index.js +4 -0
- package/dist/measure/index.js.map +1 -0
- package/dist/measure/measurer.d.ts +159 -0
- package/dist/measure/measurer.js +300 -0
- package/dist/measure/measurer.js.map +1 -0
- package/dist/measure/model.d.ts +46 -0
- package/dist/measure/model.js +47 -0
- package/dist/measure/model.js.map +1 -0
- package/dist/output/assets.d.ts +10 -0
- package/dist/output/assets.js +65 -0
- package/dist/output/assets.js.map +1 -0
- package/dist/output/index.d.ts +4 -0
- package/dist/output/index.js +5 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/output.d.ts +103 -0
- package/dist/output/output.js +86 -0
- package/dist/output/output.js.map +1 -0
- package/dist/output/stylesheets.d.ts +45 -0
- package/dist/output/stylesheets.js +50 -0
- package/dist/output/stylesheets.js.map +1 -0
- package/dist/paint/backgrounds.d.ts +56 -0
- package/dist/paint/backgrounds.js +261 -0
- package/dist/paint/backgrounds.js.map +1 -0
- package/dist/paint/blend.d.ts +61 -0
- package/dist/paint/blend.js +157 -0
- package/dist/paint/blend.js.map +1 -0
- package/dist/paint/border-image.d.ts +13 -0
- package/dist/paint/border-image.js +149 -0
- package/dist/paint/border-image.js.map +1 -0
- package/dist/paint/borders.d.ts +47 -0
- package/dist/paint/borders.js +329 -0
- package/dist/paint/borders.js.map +1 -0
- package/dist/paint/canvas.d.ts +52 -0
- package/dist/paint/canvas.js +274 -0
- package/dist/paint/canvas.js.map +1 -0
- package/dist/paint/colours.d.ts +55 -0
- package/dist/paint/colours.js +380 -0
- package/dist/paint/colours.js.map +1 -0
- package/dist/paint/columns.d.ts +11 -0
- package/dist/paint/columns.js +42 -0
- package/dist/paint/columns.js.map +1 -0
- package/dist/paint/context.d.ts +47 -0
- package/dist/paint/context.js +2 -0
- package/dist/paint/context.js.map +1 -0
- package/dist/paint/decoration.d.ts +97 -0
- package/dist/paint/decoration.js +280 -0
- package/dist/paint/decoration.js.map +1 -0
- package/dist/paint/effects.d.ts +64 -0
- package/dist/paint/effects.js +342 -0
- package/dist/paint/effects.js.map +1 -0
- package/dist/paint/emphasis.d.ts +13 -0
- package/dist/paint/emphasis.js +95 -0
- package/dist/paint/emphasis.js.map +1 -0
- package/dist/paint/flatten.d.ts +33 -0
- package/dist/paint/flatten.js +968 -0
- package/dist/paint/flatten.js.map +1 -0
- package/dist/paint/geometry.d.ts +62 -0
- package/dist/paint/geometry.js +170 -0
- package/dist/paint/geometry.js.map +1 -0
- package/dist/paint/gradients.d.ts +31 -0
- package/dist/paint/gradients.js +394 -0
- package/dist/paint/gradients.js.map +1 -0
- package/dist/paint/images.d.ts +17 -0
- package/dist/paint/images.js +80 -0
- package/dist/paint/images.js.map +1 -0
- package/dist/paint/lint.d.ts +46 -0
- package/dist/paint/lint.js +105 -0
- package/dist/paint/lint.js.map +1 -0
- package/dist/paint/overprint.d.ts +13 -0
- package/dist/paint/overprint.js +12 -0
- package/dist/paint/overprint.js.map +1 -0
- package/dist/paint/painter.d.ts +92 -0
- package/dist/paint/painter.js +281 -0
- package/dist/paint/painter.js.map +1 -0
- package/dist/paint/path.d.ts +9 -0
- package/dist/paint/path.js +173 -0
- package/dist/paint/path.js.map +1 -0
- package/dist/paint/raster.d.ts +32 -0
- package/dist/paint/raster.js +180 -0
- package/dist/paint/raster.js.map +1 -0
- package/dist/paint/shadows.d.ts +28 -0
- package/dist/paint/shadows.js +104 -0
- package/dist/paint/shadows.js.map +1 -0
- package/dist/paint/sources.d.ts +13 -0
- package/dist/paint/sources.js +17 -0
- package/dist/paint/sources.js.map +1 -0
- package/dist/paint/stacking.d.ts +75 -0
- package/dist/paint/stacking.js +327 -0
- package/dist/paint/stacking.js.map +1 -0
- package/dist/paint/svg-lint.d.ts +57 -0
- package/dist/paint/svg-lint.js +119 -0
- package/dist/paint/svg-lint.js.map +1 -0
- package/dist/paint/svg.d.ts +95 -0
- package/dist/paint/svg.js +728 -0
- package/dist/paint/svg.js.map +1 -0
- package/dist/paint/tables.d.ts +18 -0
- package/dist/paint/tables.js +178 -0
- package/dist/paint/tables.js.map +1 -0
- package/dist/paint/text-shadow.d.ts +26 -0
- package/dist/paint/text-shadow.js +187 -0
- package/dist/paint/text-shadow.js.map +1 -0
- package/dist/paint/text.d.ts +144 -0
- package/dist/paint/text.js +713 -0
- package/dist/paint/text.js.map +1 -0
- package/dist/paint/values.d.ts +24 -0
- package/dist/paint/values.js +160 -0
- package/dist/paint/values.js.map +1 -0
- package/dist/paint/vertical.d.ts +19 -0
- package/dist/paint/vertical.js +236 -0
- package/dist/paint/vertical.js.map +1 -0
- package/dist/pdf/index.d.ts +6 -0
- package/dist/pdf/index.js +7 -0
- package/dist/pdf/index.js.map +1 -0
- package/dist/pdf/pdfx.d.ts +30 -0
- package/dist/pdf/pdfx.js +18 -0
- package/dist/pdf/pdfx.js.map +1 -0
- package/dist/pdf/structure/index.d.ts +53 -0
- package/dist/pdf/structure/index.js +52 -0
- package/dist/pdf/structure/index.js.map +1 -0
- package/dist/pdf/structure/labels.d.ts +16 -0
- package/dist/pdf/structure/labels.js +45 -0
- package/dist/pdf/structure/labels.js.map +1 -0
- package/dist/pdf/structure/links.d.ts +49 -0
- package/dist/pdf/structure/links.js +136 -0
- package/dist/pdf/structure/links.js.map +1 -0
- package/dist/pdf/structure/tags.d.ts +79 -0
- package/dist/pdf/structure/tags.js +314 -0
- package/dist/pdf/structure/tags.js.map +1 -0
- package/dist/pdf/types.d.ts +551 -0
- package/dist/pdf/types.js +16 -0
- package/dist/pdf/types.js.map +1 -0
- package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +41 -0
- package/dist/pdf/wasm/pulpweaver4_pdf.js +286 -0
- package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
- package/dist/pdf/writer.d.ts +41 -0
- package/dist/pdf/writer.js +78 -0
- package/dist/pdf/writer.js.map +1 -0
- package/dist/plugin/attributes.d.ts +10 -0
- package/dist/plugin/attributes.js +63 -0
- package/dist/plugin/attributes.js.map +1 -0
- package/dist/plugin/define.d.ts +425 -0
- package/dist/plugin/define.js +311 -0
- package/dist/plugin/define.js.map +1 -0
- package/dist/plugin/failure.d.ts +80 -0
- package/dist/plugin/failure.js +97 -0
- package/dist/plugin/failure.js.map +1 -0
- package/dist/plugin/index.d.ts +11 -0
- package/dist/plugin/index.js +12 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/load.d.ts +105 -0
- package/dist/plugin/load.js +197 -0
- package/dist/plugin/load.js.map +1 -0
- package/dist/plugin/register.d.ts +166 -0
- package/dist/plugin/register.js +306 -0
- package/dist/plugin/register.js.map +1 -0
- package/dist/plugin/render.d.ts +4 -0
- package/dist/plugin/render.js +28 -0
- package/dist/plugin/render.js.map +1 -0
- package/dist/preflight/index.d.ts +3 -0
- package/dist/preflight/index.js +4 -0
- package/dist/preflight/index.js.map +1 -0
- package/dist/preflight/pdfx.d.ts +440 -0
- package/dist/preflight/pdfx.js +1781 -0
- package/dist/preflight/pdfx.js.map +1 -0
- package/dist/preflight/reader.d.ts +126 -0
- package/dist/preflight/reader.js +832 -0
- package/dist/preflight/reader.js.map +1 -0
- package/dist/preflight/xmp.d.ts +30 -0
- package/dist/preflight/xmp.js +145 -0
- package/dist/preflight/xmp.js.map +1 -0
- package/dist/print/index.d.ts +2 -0
- package/dist/print/index.js +3 -0
- package/dist/print/index.js.map +1 -0
- package/dist/print/output.d.ts +5 -0
- package/dist/print/output.js +215 -0
- package/dist/print/output.js.map +1 -0
- package/dist/problem.d.ts +142 -0
- package/dist/problem.js +234 -0
- package/dist/problem.js.map +1 -0
- package/dist/profile/index.d.ts +10 -0
- package/dist/profile/index.js +11 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/profile/lint.d.ts +69 -0
- package/dist/profile/lint.js +282 -0
- package/dist/profile/lint.js.map +1 -0
- package/dist/profile/metadata.d.ts +27 -0
- package/dist/profile/metadata.js +38 -0
- package/dist/profile/metadata.js.map +1 -0
- package/dist/profile/profile.d.ts +92 -0
- package/dist/profile/profile.js +282 -0
- package/dist/profile/profile.js.map +1 -0
- package/dist/project.d.ts +56 -0
- package/dist/project.js +137 -0
- package/dist/project.js.map +1 -0
- package/dist/reproducible/clock.d.ts +46 -0
- package/dist/reproducible/clock.js +173 -0
- package/dist/reproducible/clock.js.map +1 -0
- package/dist/reproducible/date.d.ts +42 -0
- package/dist/reproducible/date.js +82 -0
- package/dist/reproducible/date.js.map +1 -0
- package/dist/reproducible/index.d.ts +8 -0
- package/dist/reproducible/index.js +9 -0
- package/dist/reproducible/index.js.map +1 -0
- package/dist/spike/spike-page.chromium.json +330 -0
- package/dist/spike/spike.d.ts +75 -0
- package/dist/spike/spike.js +106 -0
- package/dist/spike/spike.js.map +1 -0
- package/dist/style/borders.d.ts +25 -0
- package/dist/style/borders.js +177 -0
- package/dist/style/borders.js.map +1 -0
- package/dist/style/colours.d.ts +34 -0
- package/dist/style/colours.js +138 -0
- package/dist/style/colours.js.map +1 -0
- package/dist/style/compile.d.ts +79 -0
- package/dist/style/compile.js +325 -0
- package/dist/style/compile.js.map +1 -0
- package/dist/style/defaults.d.ts +20 -0
- package/dist/style/defaults.js +45 -0
- package/dist/style/defaults.js.map +1 -0
- package/dist/style/gcpm.d.ts +22 -0
- package/dist/style/gcpm.js +86 -0
- package/dist/style/gcpm.js.map +1 -0
- package/dist/style/index.d.ts +4 -0
- package/dist/style/index.js +5 -0
- package/dist/style/index.js.map +1 -0
- package/dist/style/media.d.ts +22 -0
- package/dist/style/media.js +342 -0
- package/dist/style/media.js.map +1 -0
- package/dist/style/properties.d.ts +44 -0
- package/dist/style/properties.js +497 -0
- package/dist/style/properties.js.map +1 -0
- package/dist/style/scope.d.ts +6 -0
- package/dist/style/scope.js +134 -0
- package/dist/style/scope.js.map +1 -0
- package/dist/style/values.d.ts +45 -0
- package/dist/style/values.js +106 -0
- package/dist/style/values.js.map +1 -0
- package/dist/test/book.d.ts +180 -0
- package/dist/test/book.js +314 -0
- package/dist/test/book.js.map +1 -0
- package/dist/test/build.d.ts +58 -0
- package/dist/test/build.js +222 -0
- package/dist/test/build.js.map +1 -0
- package/dist/test/environment.d.ts +63 -0
- package/dist/test/environment.js +46 -0
- package/dist/test/environment.js.map +1 -0
- package/dist/test/index.d.ts +17 -0
- package/dist/test/index.js +18 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/indexes.d.ts +4 -0
- package/dist/test/indexes.js +48 -0
- package/dist/test/indexes.js.map +1 -0
- package/dist/test/layout.d.ts +8 -0
- package/dist/test/layout.js +121 -0
- package/dist/test/layout.js.map +1 -0
- package/dist/test/matchers.d.ts +80 -0
- package/dist/test/matchers.js +177 -0
- package/dist/test/matchers.js.map +1 -0
- package/dist/test/pipeline.d.ts +231 -0
- package/dist/test/pipeline.js +75 -0
- package/dist/test/pipeline.js.map +1 -0
- package/dist/test/plugins.d.ts +13 -0
- package/dist/test/plugins.js +22 -0
- package/dist/test/plugins.js.map +1 -0
- package/dist/test/render.d.ts +46 -0
- package/dist/test/render.js +149 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/runner.d.ts +61 -0
- package/dist/test/runner.js +256 -0
- package/dist/test/runner.js.map +1 -0
- package/dist/test/select.d.ts +54 -0
- package/dist/test/select.js +193 -0
- package/dist/test/select.js.map +1 -0
- package/dist/test/snapshot.d.ts +52 -0
- package/dist/test/snapshot.js +175 -0
- package/dist/test/snapshot.js.map +1 -0
- package/dist/test/text.d.ts +7 -0
- package/dist/test/text.js +46 -0
- package/dist/test/text.js.map +1 -0
- package/dist/test/vitest.d.ts +3 -0
- package/dist/test/vitest.js +39 -0
- package/dist/test/vitest.js.map +1 -0
- package/dist/text/index.d.ts +5 -0
- package/dist/text/index.js +6 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/output.d.ts +5 -0
- package/dist/text/output.js +39 -0
- package/dist/text/output.js.map +1 -0
- package/dist/text/render.d.ts +82 -0
- package/dist/text/render.js +583 -0
- package/dist/text/render.js.map +1 -0
- package/dist/text/width.d.ts +16 -0
- package/dist/text/width.js +90 -0
- package/dist/text/width.js.map +1 -0
- package/dist/text/wrap.d.ts +19 -0
- package/dist/text/wrap.js +151 -0
- package/dist/text/wrap.js.map +1 -0
- package/dist/transform/core.d.ts +19 -0
- package/dist/transform/core.js +22 -0
- package/dist/transform/core.js.map +1 -0
- package/dist/transform/index.d.ts +10 -0
- package/dist/transform/index.js +11 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/numbering.d.ts +47 -0
- package/dist/transform/numbering.js +142 -0
- package/dist/transform/numbering.js.map +1 -0
- package/dist/transform/references.d.ts +38 -0
- package/dist/transform/references.js +182 -0
- package/dist/transform/references.js.map +1 -0
- package/dist/transform/run.d.ts +32 -0
- package/dist/transform/run.js +210 -0
- package/dist/transform/run.js.map +1 -0
- package/dist/transform/store.d.ts +111 -0
- package/dist/transform/store.js +331 -0
- package/dist/transform/store.js.map +1 -0
- package/dist/transform/testing.d.ts +31 -0
- package/dist/transform/testing.js +76 -0
- package/dist/transform/testing.js.map +1 -0
- package/dist/transform/transform.d.ts +104 -0
- package/dist/transform/transform.js +89 -0
- package/dist/transform/transform.js.map +1 -0
- package/dist/vfs/fsa.d.ts +14 -0
- package/dist/vfs/fsa.js +123 -0
- package/dist/vfs/fsa.js.map +1 -0
- package/dist/vfs/index.d.ts +7 -0
- package/dist/vfs/index.js +8 -0
- package/dist/vfs/index.js.map +1 -0
- package/dist/vfs/memory.d.ts +15 -0
- package/dist/vfs/memory.js +101 -0
- package/dist/vfs/memory.js.map +1 -0
- package/dist/vfs/path.d.ts +30 -0
- package/dist/vfs/path.js +67 -0
- package/dist/vfs/path.js.map +1 -0
- package/dist/vfs/vfs.d.ts +66 -0
- package/dist/vfs/vfs.js +68 -0
- package/dist/vfs/vfs.js.map +1 -0
- package/dist/vfs/zip.d.ts +27 -0
- package/dist/vfs/zip.js +67 -0
- package/dist/vfs/zip.js.map +1 -0
- package/dist/web/css.d.ts +15 -0
- package/dist/web/css.js +80 -0
- package/dist/web/css.js.map +1 -0
- package/dist/web/hast.d.ts +44 -0
- package/dist/web/hast.js +175 -0
- package/dist/web/hast.js.map +1 -0
- package/dist/web/index.d.ts +11 -0
- package/dist/web/index.js +12 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/justify-main.d.ts +1 -0
- package/dist/web/justify-main.js +38 -0
- package/dist/web/justify-main.js.map +1 -0
- package/dist/web/justify.d.ts +46 -0
- package/dist/web/justify.js +147 -0
- package/dist/web/justify.js.map +1 -0
- package/dist/web/output.d.ts +28 -0
- package/dist/web/output.js +251 -0
- package/dist/web/output.js.map +1 -0
- package/dist/web/runtime/LICENSE-harfbuzzjs.txt +19 -0
- package/dist/web/runtime/NOTICE-patterns.txt +429 -0
- package/dist/web/runtime/harfbuzz.wasm +0 -0
- package/dist/web/runtime/justify.js.txt +2 -0
- package/dist/web/site.d.ts +53 -0
- package/dist/web/site.js +219 -0
- package/dist/web/site.js.map +1 -0
- package/docs/README.md +16 -0
- package/docs/reference/css-properties/index.md +94 -0
- package/docs/reference/css-properties/pw-adj-demerits.md +22 -0
- package/docs/reference/css-properties/pw-border-bottom-width.md +24 -0
- package/docs/reference/css-properties/pw-border-left-width.md +24 -0
- package/docs/reference/css-properties/pw-border-right-width.md +24 -0
- package/docs/reference/css-properties/pw-border-top-width.md +24 -0
- package/docs/reference/css-properties/pw-box.md +28 -0
- package/docs/reference/css-properties/pw-broken-penalty.md +22 -0
- package/docs/reference/css-properties/pw-club-penalty.md +24 -0
- package/docs/reference/css-properties/pw-column-rule-width.md +23 -0
- package/docs/reference/css-properties/pw-content-after.md +31 -0
- package/docs/reference/css-properties/pw-content-before.md +31 -0
- package/docs/reference/css-properties/pw-double-hyphen-demerits.md +23 -0
- package/docs/reference/css-properties/pw-emergency-stretch.md +28 -0
- package/docs/reference/css-properties/pw-ex-hyphen-penalty.md +22 -0
- package/docs/reference/css-properties/pw-final-hyphen-demerits.md +22 -0
- package/docs/reference/css-properties/pw-float-skip.md +22 -0
- package/docs/reference/css-properties/pw-float.md +33 -0
- package/docs/reference/css-properties/pw-footnote-max-height.md +22 -0
- package/docs/reference/css-properties/pw-footnote-skip.md +23 -0
- package/docs/reference/css-properties/pw-hyphen-penalty.md +24 -0
- package/docs/reference/css-properties/pw-inter-line-penalty.md +24 -0
- package/docs/reference/css-properties/pw-leader-space.md +22 -0
- package/docs/reference/css-properties/pw-leader.md +29 -0
- package/docs/reference/css-properties/pw-left-hyphen-min.md +23 -0
- package/docs/reference/css-properties/pw-line-breaking.md +29 -0
- package/docs/reference/css-properties/pw-line-penalty.md +23 -0
- package/docs/reference/css-properties/pw-list-indent.md +18 -0
- package/docs/reference/css-properties/pw-looseness.md +30 -0
- package/docs/reference/css-properties/pw-max-depth.md +22 -0
- package/docs/reference/css-properties/pw-minipage-footnotes.md +23 -0
- package/docs/reference/css-properties/pw-orphans.md +24 -0
- package/docs/reference/css-properties/pw-outline-width.md +23 -0
- package/docs/reference/css-properties/pw-overprint.md +26 -0
- package/docs/reference/css-properties/pw-padding-bottom.md +22 -0
- package/docs/reference/css-properties/pw-padding-left.md +22 -0
- package/docs/reference/css-properties/pw-padding-right.md +22 -0
- package/docs/reference/css-properties/pw-padding-top.md +22 -0
- package/docs/reference/css-properties/pw-page-prefix.md +28 -0
- package/docs/reference/css-properties/pw-page.md +32 -0
- package/docs/reference/css-properties/pw-penalty-after.md +23 -0
- package/docs/reference/css-properties/pw-penalty-before.md +30 -0
- package/docs/reference/css-properties/pw-pretolerance.md +23 -0
- package/docs/reference/css-properties/pw-right-hyphen-min.md +22 -0
- package/docs/reference/css-properties/pw-running.md +23 -0
- package/docs/reference/css-properties/pw-site-background.md +21 -0
- package/docs/reference/css-properties/pw-site-link.md +17 -0
- package/docs/reference/css-properties/pw-site-measure.md +17 -0
- package/docs/reference/css-properties/pw-site-muted.md +21 -0
- package/docs/reference/css-properties/pw-site-rule.md +17 -0
- package/docs/reference/css-properties/pw-site-text.md +22 -0
- package/docs/reference/css-properties/pw-space-after.md +23 -0
- package/docs/reference/css-properties/pw-space-before.md +29 -0
- package/docs/reference/css-properties/pw-string-set.md +32 -0
- package/docs/reference/css-properties/pw-tolerance.md +33 -0
- package/docs/reference/css-properties/pw-top-skip.md +22 -0
- package/docs/reference/css-properties/pw-widow-penalty.md +32 -0
- package/docs/reference/css-properties/pw-widows.md +24 -0
- package/docs/reference/css-properties/pw-word-space.md +22 -0
- package/docs/reference/css-properties/pw-xspace.md +22 -0
- package/docs/reference/index.md +17 -0
- package/docs/reference/lint-rules/black-text.md +31 -0
- package/docs/reference/lint-rules/blank-page.md +35 -0
- package/docs/reference/lint-rules/chapter-verso.md +34 -0
- package/docs/reference/lint-rules/citation-in-heading.md +24 -0
- package/docs/reference/lint-rules/consecutive-hyphens.md +34 -0
- package/docs/reference/lint-rules/empty-link.md +32 -0
- package/docs/reference/lint-rules/figure-distance.md +34 -0
- package/docs/reference/lint-rules/fonts.md +24 -0
- package/docs/reference/lint-rules/generated-text.md +24 -0
- package/docs/reference/lint-rules/heading-levels.md +30 -0
- package/docs/reference/lint-rules/ibid-across-page.md +30 -0
- package/docs/reference/lint-rules/image-alt.md +30 -0
- package/docs/reference/lint-rules/image-resolution.md +34 -0
- package/docs/reference/lint-rules/index.md +120 -0
- package/docs/reference/lint-rules/ink-limit.md +30 -0
- package/docs/reference/lint-rules/missing-field.md +37 -0
- package/docs/reference/lint-rules/orphan.md +34 -0
- package/docs/reference/lint-rules/overfull-line.md +28 -0
- package/docs/reference/lint-rules/profile.md +24 -0
- package/docs/reference/lint-rules/raw-html.md +30 -0
- package/docs/reference/lint-rules/signature.md +34 -0
- package/docs/reference/lint-rules/straight-quotes.md +33 -0
- package/docs/reference/lint-rules/svg-use-css.md +24 -0
- package/docs/reference/lint-rules/underfull-line.md +35 -0
- package/docs/reference/lint-rules/unknown-citation.md +30 -0
- package/docs/reference/lint-rules/unknown-label.md +31 -0
- package/docs/reference/lint-rules/unpaintable.md +24 -0
- package/docs/reference/lint-rules/unplaced-index.md +31 -0
- package/docs/reference/lint-rules/unused-entry.md +38 -0
- package/docs/reference/lint-rules/widow.md +34 -0
- package/docs/reference/plugin-api/assert-no-errors.md +18 -0
- package/docs/reference/plugin-api/asset-processor.md +28 -0
- package/docs/reference/plugin-api/attribute-problem.md +26 -0
- package/docs/reference/plugin-api/attribute-type.md +18 -0
- package/docs/reference/plugin-api/capabilities.md +18 -0
- package/docs/reference/plugin-api/capability.md +22 -0
- package/docs/reference/plugin-api/check-attributes.md +18 -0
- package/docs/reference/plugin-api/claim-kind.md +20 -0
- package/docs/reference/plugin-api/combine-penalties.md +17 -0
- package/docs/reference/plugin-api/command-context.md +30 -0
- package/docs/reference/plugin-api/command-definition.md +34 -0
- package/docs/reference/plugin-api/core-claims.md +18 -0
- package/docs/reference/plugin-api/define-plugin.md +20 -0
- package/docs/reference/plugin-api/define-rule.md +19 -0
- package/docs/reference/plugin-api/describe-error.md +14 -0
- package/docs/reference/plugin-api/describe-node.md +14 -0
- package/docs/reference/plugin-api/empty-registry.md +18 -0
- package/docs/reference/plugin-api/failed-on.md +32 -0
- package/docs/reference/plugin-api/fails-as.md +18 -0
- package/docs/reference/plugin-api/import-plugins.md +20 -0
- package/docs/reference/plugin-api/import-text.md +14 -0
- package/docs/reference/plugin-api/index.md +123 -0
- package/docs/reference/plugin-api/layout-definition.md +42 -0
- package/docs/reference/plugin-api/layout-slot.md +28 -0
- package/docs/reference/plugin-api/line-breaker.md +18 -0
- package/docs/reference/plugin-api/lint-context.md +48 -0
- package/docs/reference/plugin-api/lint-definition.md +32 -0
- package/docs/reference/plugin-api/lint-edition.md +38 -0
- package/docs/reference/plugin-api/lint-fix.md +36 -0
- package/docs/reference/plugin-api/lint-level.md +20 -0
- package/docs/reference/plugin-api/lint-preset.md +30 -0
- package/docs/reference/plugin-api/lint-rule.md +42 -0
- package/docs/reference/plugin-api/load-failure.md +32 -0
- package/docs/reference/plugin-api/load-plugins-options.md +32 -0
- package/docs/reference/plugin-api/load-plugins.md +20 -0
- package/docs/reference/plugin-api/loaded-plugin.md +32 -0
- package/docs/reference/plugin-api/node-claim.md +34 -0
- package/docs/reference/plugin-api/output-definition.md +28 -0
- package/docs/reference/plugin-api/owned.md +28 -0
- package/docs/reference/plugin-api/page-builder-hook.md +18 -0
- package/docs/reference/plugin-api/penalty-rule.md +34 -0
- package/docs/reference/plugin-api/plugin-api.md +18 -0
- package/docs/reference/plugin-api/plugin-definition.md +66 -0
- package/docs/reference/plugin-api/plugin-error.md +22 -0
- package/docs/reference/plugin-api/plugin-failure.md +30 -0
- package/docs/reference/plugin-api/plugin-importer.md +34 -0
- package/docs/reference/plugin-api/plugin-problem.md +30 -0
- package/docs/reference/plugin-api/plugin-registry.md +83 -0
- package/docs/reference/plugin-api/plugin-scope.md +15 -0
- package/docs/reference/plugin-api/plugin-stage.md +18 -0
- package/docs/reference/plugin-api/plugin-threw-problem.md +34 -0
- package/docs/reference/plugin-api/plugin-threw.md +21 -0
- package/docs/reference/plugin-api/plugin.md +69 -0
- package/docs/reference/plugin-api/project-with-plugins.md +36 -0
- package/docs/reference/plugin-api/read-context.md +30 -0
- package/docs/reference/plugin-api/read-failure.md +18 -0
- package/docs/reference/plugin-api/read-plugin-styles.md +22 -0
- package/docs/reference/plugin-api/reader.md +22 -0
- package/docs/reference/plugin-api/register-options.md +28 -0
- package/docs/reference/plugin-api/register-plugins.md +20 -0
- package/docs/reference/plugin-api/render-format.md +18 -0
- package/docs/reference/plugin-api/render-formats.md +18 -0
- package/docs/reference/plugin-api/renderer-registry.md +18 -0
- package/docs/reference/plugin-api/renderer-set.md +34 -0
- package/docs/reference/plugin-api/renderers.md +34 -0
- package/docs/reference/plugin-api/specifier-kind.md +14 -0
- package/docs/reference/plugin-api/style-source.md +18 -0
- package/docs/reference/plugin-api/text-context.md +28 -0
- package/docs/reference/plugin-api/text-edit.md +28 -0
- package/docs/reference/plugin-api/text-renderer.md +24 -0
- package/docs/reference/plugin-api/try-plugin-async.md +18 -0
- package/docs/reference/plugin-api/try-plugin.md +20 -0
- package/docs/reference/pulpweaver4-toml/editions.md +208 -0
- package/docs/reference/pulpweaver4-toml/index.md +195 -0
- package/docs/reference/pulpweaver4-toml/inks.md +50 -0
- package/docs/reference/pulpweaver4-toml/lint.md +36 -0
- package/docs/reference/test-matchers/index.md +33 -0
- package/docs/reference/test-matchers/to-be-recto.md +20 -0
- package/docs/reference/test-matchers/to-cite.md +22 -0
- package/docs/reference/test-matchers/to-fit-on-one-page.md +20 -0
- package/docs/reference/test-matchers/to-have-no-overfull-lines.md +20 -0
- package/docs/reference/test-matchers/to-match-html-snapshot.md +20 -0
- package/docs/reference/test-matchers/to-match-page-snapshot.md +20 -0
- package/docs/reference/test-matchers/to-match-text-snapshot.md +21 -0
- package/docs/reference/test-matchers/to-start-page.md +20 -0
- package/package.json +75 -4
- package/README.md +0 -3
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TeX's vertical list, as the engine builds it from the DOM and CSS
|
|
3
|
+
* (`lists.ts`) for the page builder to break into pages
|
|
4
|
+
* (https://plans.inkylabs.com/pulpweaver#the-box-glue-and-penalty-model-in-css).
|
|
5
|
+
* It is TeX's main vertical list after paragraphs are broken into lines:
|
|
6
|
+
*
|
|
7
|
+
* - **Boxes** stack, each `height` above its baseline and `depth` below, in
|
|
8
|
+
* CSS px. A line's baseline is where the browser put it, so consecutive
|
|
9
|
+
* lines need no interline glue: CSS's `line-height` is the
|
|
10
|
+
* `\baselineskip`. Every other box has its baseline at its bottom (depth
|
|
11
|
+
* 0) unless it ends in a line, as a TeX `\vbox` takes its last line's
|
|
12
|
+
* depth.
|
|
13
|
+
* - **Glue** is vertical space: `--pw-space-before` and `--pw-space-after`
|
|
14
|
+
* where set (`0.5em plus 2pt minus 1pt`), otherwise the margins, as fixed
|
|
15
|
+
* glue. Adjacent spaces collapse as CSS margins do (the largest positive
|
|
16
|
+
* plus the most negative), which is LaTeX's `\addvspace`, so there is one
|
|
17
|
+
* glue at each boundary between blocks. It is a breakpoint when what
|
|
18
|
+
* comes before it isn't discardable, as in TeX.
|
|
19
|
+
* - **Penalties** are breakpoints with a cost: between the lines of a
|
|
20
|
+
* paragraph or a `pre` (TeX's `\interlinepenalty`, `\clubpenalty`, `\widowpenalty`
|
|
21
|
+
* and `\brokenpenalty`, from `--pw-inter-line-penalty`, `orphans` and
|
|
22
|
+
* `--pw-club-penalty`, `widows` and `--pw-widow-penalty`, and
|
|
23
|
+
* `--pw-broken-penalty`), between table rows, and at a block's edges
|
|
24
|
+
* from `break-before` and `break-after` (−10000 forced, with the side a
|
|
25
|
+
* `left` or `right` break asks for; +10000 for `avoid`) and
|
|
26
|
+
* `--pw-penalty-before` and `--pw-penalty-after`. A penalty comes before
|
|
27
|
+
* the glue at its boundary, so the glue isn't a second breakpoint there,
|
|
28
|
+
* and a break discards the glue after it, as TeX's page builder does.
|
|
29
|
+
* - **Inserts** carry what floats to the page's foot or top: footnotes
|
|
30
|
+
* (`float: footnote`) and top and bottom floats (`float: top`, `float:
|
|
31
|
+
* bottom`), each with its own vertical list, laid out at the flow's
|
|
32
|
+
* measure. An insert from a paragraph follows the line that called it, as
|
|
33
|
+
* TeX's migrate out of a paragraph, so the page builder places the line
|
|
34
|
+
* and its note together.
|
|
35
|
+
* - **Marks** carry running heads: GCPM's `string-set`, its value resolved
|
|
36
|
+
* to text, and `position: running()`, the element itself. A block's marks
|
|
37
|
+
* come just before its first box, after the breakpoint before it, so a
|
|
38
|
+
* heading's mark is on the heading's page; a mark from inside a paragraph
|
|
39
|
+
* follows its line.
|
|
40
|
+
*
|
|
41
|
+
* Everything the engine doesn't break is a box: atomic content measured by
|
|
42
|
+
* the browser (`block`), elements kept whole by `break-inside: avoid`, with
|
|
43
|
+
* their own list (`vbox`: a figure, a stanza), minipages (`--pw-box:
|
|
44
|
+
* minipage`, `minipage.ts`), whose list the engine stacks itself, with
|
|
45
|
+
* their footnotes at their own foot, and a table's rows (`row`), between
|
|
46
|
+
* which a table may break. A container's border and padding are `edge`
|
|
47
|
+
* boxes, kept with its first and last content by +10000 penalties. A
|
|
48
|
+
* minipage set in a line (`inline-block`) or in a block the browser lays out
|
|
49
|
+
* (a flex row) is part of that box, which lists it in `minipages`. A multi-column
|
|
50
|
+
* element is a box too (`columns`), with its list at the columns' width,
|
|
51
|
+
* which the page layout breaks into rows of columns. A CSS float is a box
|
|
52
|
+
* (`float`) that the glue after it takes back out of the flow.
|
|
53
|
+
*
|
|
54
|
+
* Every box names its element, and the containers it sits in below the
|
|
55
|
+
* list's root, outermost first, which a page must rebuild around it: the
|
|
56
|
+
* page builder moves the elements onto pages and clones their containers,
|
|
57
|
+
* keeping their `data-pw-key` and `data-pw-in`. The elements stay where
|
|
58
|
+
* the conversion left them until it does: lines in their paragraphs, and
|
|
59
|
+
* what left the flow (inserts' content, running elements) in a `.pw-held`
|
|
60
|
+
* element after the flow.
|
|
61
|
+
*/
|
|
62
|
+
import type { GlueOrder } from '../linebreak/items.js';
|
|
63
|
+
import type { GlueSet } from './pagebuilder.js';
|
|
64
|
+
import type { ParagraphLayout } from './paragraph.js';
|
|
65
|
+
interface BoxBase {
|
|
66
|
+
readonly type: 'box';
|
|
67
|
+
/** Above and below the baseline, in px: the box is `height + depth` tall. */
|
|
68
|
+
readonly height: number;
|
|
69
|
+
readonly depth: number;
|
|
70
|
+
/** Its border box's width, and how far its left edge is right of the list's (TeX's shift amount), in px. */
|
|
71
|
+
readonly width: number;
|
|
72
|
+
readonly shift: number;
|
|
73
|
+
/** What it was made from: the line's element, the block, the row, the container whose edge it is. */
|
|
74
|
+
readonly element: HTMLElement;
|
|
75
|
+
/** The elements it sits in, below the list's root, outermost first. */
|
|
76
|
+
readonly containers: readonly HTMLElement[];
|
|
77
|
+
/** The minipages inside it the engine laid out, when it isn't one itself: those set in a line, or in a block the browser lays out. */
|
|
78
|
+
readonly minipages?: readonly MinipageBox[];
|
|
79
|
+
}
|
|
80
|
+
/** A line of a paragraph, as the engine set it: `.pw-line`. */
|
|
81
|
+
export interface LineBox extends BoxBase {
|
|
82
|
+
readonly kind: 'line';
|
|
83
|
+
readonly paragraph: ParagraphLayout;
|
|
84
|
+
/** Its index in the paragraph's lines. */
|
|
85
|
+
readonly line: number;
|
|
86
|
+
}
|
|
87
|
+
/** Something the browser lays out and the engine doesn't break: an image, SVG, display math, a flex or grid box, a line of a `pre` (`.pw-pre-line`, `pre.ts`). */
|
|
88
|
+
export interface BlockBox extends BoxBase {
|
|
89
|
+
readonly kind: 'block';
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* An element kept whole (`break-inside: avoid`): a figure, a stanza, a
|
|
93
|
+
* table that mustn't break. Its own list is what it holds, as TeX's
|
|
94
|
+
* `\vbox` does; its size is the browser's.
|
|
95
|
+
*/
|
|
96
|
+
export interface VBox extends BoxBase {
|
|
97
|
+
readonly kind: 'vbox';
|
|
98
|
+
readonly list: VItem[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A minipage (`--pw-box: minipage`): a box with its own measure and its own
|
|
102
|
+
* vertical list, which the engine stacks inside it as TeX's `\vbox` does,
|
|
103
|
+
* glue at its natural width, and, when its footnotes stay inside, its
|
|
104
|
+
* notes at its foot under their own rule, as LaTeX's `minipage` sets them
|
|
105
|
+
* (`minipage.ts`). Its size is the browser's, which is the list's.
|
|
106
|
+
*/
|
|
107
|
+
export interface MinipageBox extends BoxBase {
|
|
108
|
+
readonly kind: 'minipage';
|
|
109
|
+
/** Its content as stacked, glue and penalties at either end left out, as LaTeX's minipage leaves them. */
|
|
110
|
+
readonly list: VItem[];
|
|
111
|
+
/** Its notes, at its foot, `skip` below its content; none if it has none or they go out. */
|
|
112
|
+
readonly footnotes: readonly VInsert[];
|
|
113
|
+
/** Between its content and its notes, if it has notes: `--pw-footnote-skip` at its natural width. */
|
|
114
|
+
readonly skip?: VGlue;
|
|
115
|
+
}
|
|
116
|
+
/** A table row: tables break between rows. Header rows (`thead`) are repeated after a break. */
|
|
117
|
+
export interface RowBox extends BoxBase {
|
|
118
|
+
readonly kind: 'row';
|
|
119
|
+
readonly header: boolean;
|
|
120
|
+
}
|
|
121
|
+
/** A container's border and padding at its start or end. */
|
|
122
|
+
export interface EdgeBox extends BoxBase {
|
|
123
|
+
readonly kind: 'edge';
|
|
124
|
+
readonly side: 'start' | 'end';
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A multi-column element (`column-count` of 2 or more): its content as one
|
|
128
|
+
* vertical list at the columns' width, which the page layout breaks into
|
|
129
|
+
* columns side by side (`pages.ts`), as LaTeX's `multicols` does: as many
|
|
130
|
+
* rows of columns as it takes, each filling what is left of its page, the
|
|
131
|
+
* last balanced. As the conversion makes it, its height is the list's in
|
|
132
|
+
* one column; the page layout gives each row its own, with `columns` set.
|
|
133
|
+
*/
|
|
134
|
+
export interface ColumnsBox extends BoxBase {
|
|
135
|
+
readonly kind: 'columns';
|
|
136
|
+
readonly count: number;
|
|
137
|
+
/** Each column's width, and the gap between columns, in px. */
|
|
138
|
+
readonly columnWidth: number;
|
|
139
|
+
readonly gap: number;
|
|
140
|
+
/** The content, positions relative to a column. */
|
|
141
|
+
readonly list: VItem[];
|
|
142
|
+
/** A row of columns, once the page layout has broken the list: each column's part, set to the row's height. */
|
|
143
|
+
readonly columns?: readonly {
|
|
144
|
+
readonly items: readonly VItem[];
|
|
145
|
+
readonly glue: GlueSet;
|
|
146
|
+
}[];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A CSS float (`float: left` or `right`): its margin box, its own list what
|
|
150
|
+
* it holds, as a `\vbox`'s. It takes no room in the flow, so a glue of
|
|
151
|
+
* minus its height follows it, after a +10000 penalty, as LaTeX's
|
|
152
|
+
* `wrapfigure` hangs its figure beside the paragraph; the lines beside it
|
|
153
|
+
* are set to the measure it leaves them (`ParshapeLine`), and no page
|
|
154
|
+
* breaks between it and the last of them, so they go to a page together.
|
|
155
|
+
*/
|
|
156
|
+
export interface FloatBox extends BoxBase {
|
|
157
|
+
readonly kind: 'float';
|
|
158
|
+
readonly side: 'left' | 'right';
|
|
159
|
+
readonly list: VItem[];
|
|
160
|
+
}
|
|
161
|
+
export type VBoxItem = LineBox | BlockBox | VBox | MinipageBox | RowBox | EdgeBox | ColumnsBox | FloatBox;
|
|
162
|
+
/** Vertical space, as `width plus stretch minus shrink`, in px. */
|
|
163
|
+
export interface VGlue {
|
|
164
|
+
readonly type: 'glue';
|
|
165
|
+
readonly width: number;
|
|
166
|
+
readonly stretch: number;
|
|
167
|
+
readonly shrink: number;
|
|
168
|
+
/** The order of the stretch: 0 finite, 1 `fil`, 2 `fill`, 3 `filll`. */
|
|
169
|
+
readonly stretchOrder?: GlueOrder;
|
|
170
|
+
}
|
|
171
|
+
/** A breakpoint and its cost: −10000 or less forces a break, 10000 or more forbids one. */
|
|
172
|
+
export interface VPenalty {
|
|
173
|
+
readonly type: 'penalty';
|
|
174
|
+
readonly penalty: number;
|
|
175
|
+
/** A forced break that must start a left (verso) or right (recto) page. */
|
|
176
|
+
readonly side?: 'left' | 'right';
|
|
177
|
+
}
|
|
178
|
+
/** What floats out of the flow: a footnote, or a top or bottom float. */
|
|
179
|
+
export interface VInsert {
|
|
180
|
+
readonly type: 'insert';
|
|
181
|
+
/** Which insertion class, as TeX's `\insert` numbers them. */
|
|
182
|
+
readonly class: 'footnote' | 'top' | 'bottom';
|
|
183
|
+
/** The element floated: the note, the figure. It waits in `.pw-held`. */
|
|
184
|
+
readonly element: HTMLElement;
|
|
185
|
+
/** Its own vertical list, laid out at the flow's measure. */
|
|
186
|
+
readonly list: VItem[];
|
|
187
|
+
/** Its natural height, its last box's depth included, in px. */
|
|
188
|
+
readonly height: number;
|
|
189
|
+
}
|
|
190
|
+
/** A running head's value: GCPM's `string-set`, or an element in `position: running()`. */
|
|
191
|
+
export type VMark = {
|
|
192
|
+
readonly type: 'mark';
|
|
193
|
+
readonly kind: 'string';
|
|
194
|
+
/** The string's name: `chapter` in `string-set: chapter content()`. */
|
|
195
|
+
readonly name: string;
|
|
196
|
+
readonly text: string;
|
|
197
|
+
/** The element that set it. */
|
|
198
|
+
readonly element: HTMLElement;
|
|
199
|
+
} | {
|
|
200
|
+
readonly type: 'mark';
|
|
201
|
+
readonly kind: 'running';
|
|
202
|
+
/** The name in `running(header)`, which `element(header)` places. */
|
|
203
|
+
readonly name: string;
|
|
204
|
+
/** The element, out of the flow, waiting in `.pw-held`. */
|
|
205
|
+
readonly element: HTMLElement;
|
|
206
|
+
};
|
|
207
|
+
export type VItem = VBoxItem | VGlue | VPenalty | VInsert | VMark;
|
|
208
|
+
/** The forced break of TeX's page builder and the forbidden one. */
|
|
209
|
+
export declare const EJECT_PENALTY = -10000;
|
|
210
|
+
export declare const INFINITE_VPENALTY = 10000;
|
|
211
|
+
/** A list's natural height: its boxes and glue, the last box's depth included. */
|
|
212
|
+
export declare function naturalHeight(list: readonly VItem[]): number;
|
|
213
|
+
/**
|
|
214
|
+
* The list in a form like TeX's `\showlists`, one item a line, nested lists
|
|
215
|
+
* indented, lengths in px to 1/1000: for tests, and tracing a page builder.
|
|
216
|
+
*/
|
|
217
|
+
export declare function showList(list: readonly VItem[], indent?: string): string;
|
|
218
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** The forced break of TeX's page builder and the forbidden one. */
|
|
2
|
+
export const EJECT_PENALTY = -10000;
|
|
3
|
+
export const INFINITE_VPENALTY = 10000;
|
|
4
|
+
/** A list's natural height: its boxes and glue, the last box's depth included. */
|
|
5
|
+
export function naturalHeight(list) {
|
|
6
|
+
let h = 0;
|
|
7
|
+
for (const item of list) {
|
|
8
|
+
if (item.type === 'box')
|
|
9
|
+
h += item.height + item.depth;
|
|
10
|
+
else if (item.type === 'glue')
|
|
11
|
+
h += item.width;
|
|
12
|
+
}
|
|
13
|
+
return h;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The list in a form like TeX's `\showlists`, one item a line, nested lists
|
|
17
|
+
* indented, lengths in px to 1/1000: for tests, and tracing a page builder.
|
|
18
|
+
*/
|
|
19
|
+
export function showList(list, indent = '') {
|
|
20
|
+
const n = (v) => String(Math.round(v * 1000) / 1000);
|
|
21
|
+
const fil = (v, order = 0) => (order ? `${n(v)}${'fil'}${'l'.repeat(order - 1)}` : n(v));
|
|
22
|
+
const what = (el) => el.localName + (el.dataset.pwKey ? `#${el.dataset.pwKey}` : el.id ? `#${el.id}` : '');
|
|
23
|
+
const out = [];
|
|
24
|
+
for (const item of list) {
|
|
25
|
+
switch (item.type) {
|
|
26
|
+
case 'box': {
|
|
27
|
+
const size = `${n(item.height)}+${n(item.depth)}x${n(item.width)}` + (item.shift ? `, shifted ${n(item.shift)}` : '');
|
|
28
|
+
const where = item.kind === 'line'
|
|
29
|
+
? `${what(item.paragraph.lines[item.line].element.parentElement ?? item.element)} line ${item.line + 1}`
|
|
30
|
+
: item.kind === 'edge' ? `${what(item.element)} ${item.side}` : what(item.element);
|
|
31
|
+
out.push(`${indent}\\${item.kind} ${size} (${where})` + (item.kind === 'row' && item.header ? ' header' : ''));
|
|
32
|
+
if (item.kind === 'vbox' || item.kind === 'minipage' || item.kind === 'float')
|
|
33
|
+
out.push(showList(item.list, `${indent} `));
|
|
34
|
+
if (item.kind === 'minipage')
|
|
35
|
+
for (const note of item.footnotes)
|
|
36
|
+
out.push(showList([note], `${indent} `));
|
|
37
|
+
for (const m of item.minipages ?? [])
|
|
38
|
+
out.push(showList([m], `${indent} `));
|
|
39
|
+
if (item.kind === 'columns') {
|
|
40
|
+
if (!item.columns)
|
|
41
|
+
out.push(showList(item.list, `${indent} `));
|
|
42
|
+
for (const [i, c] of (item.columns ?? []).entries())
|
|
43
|
+
out.push(`${indent} column ${i + 1}`, showList(c.items, `${indent} `));
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 'glue': {
|
|
48
|
+
let s = `${indent}\\glue ${n(item.width)}`;
|
|
49
|
+
if (item.stretch)
|
|
50
|
+
s += ` plus ${fil(item.stretch, item.stretchOrder)}`;
|
|
51
|
+
if (item.shrink)
|
|
52
|
+
s += ` minus ${n(item.shrink)}`;
|
|
53
|
+
out.push(s);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
case 'penalty':
|
|
57
|
+
out.push(`${indent}\\penalty ${item.penalty}` + (item.side ? ` ${item.side}` : ''));
|
|
58
|
+
break;
|
|
59
|
+
case 'insert':
|
|
60
|
+
out.push(`${indent}\\insert ${item.class}, height ${n(item.height)} (${what(item.element)})`);
|
|
61
|
+
out.push(showList(item.list, `${indent} `));
|
|
62
|
+
break;
|
|
63
|
+
case 'mark':
|
|
64
|
+
out.push(item.kind === 'string'
|
|
65
|
+
? `${indent}\\mark ${item.name} ${JSON.stringify(item.text)}`
|
|
66
|
+
: `${indent}\\mark ${item.name} running (${what(item.element)})`);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return out.filter(Boolean).join('\n');
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=vlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vlist.js","sourceRoot":"","sources":["../../src/layout/vlist.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TeX's horizontal lists, as Knuth and Plass model them in "Breaking
|
|
3
|
+
* Paragraphs into Lines" (1981): a paragraph is a sequence of boxes, glue
|
|
4
|
+
* and penalties (https://plans.inkylabs.com/pulpweaver#the-box-glue-and-penalty-model-in-css).
|
|
5
|
+
* Widths are plain numbers in any unit; the engine uses CSS px. Integer
|
|
6
|
+
* units (TeX's sp, or 1/64 px) keep the arithmetic exact, as TeX's is.
|
|
7
|
+
*/
|
|
8
|
+
/** A penalty at or above this never breaks; at or below its negation, always breaks. */
|
|
9
|
+
export declare const INFINITE_PENALTY = 10000;
|
|
10
|
+
/**
|
|
11
|
+
* The order of infinity of a glue's stretch, as TeX's: 0 finite, 1 `fil`,
|
|
12
|
+
* 2 `fill`, 3 `filll`. Stretch of a higher order swallows all lower orders.
|
|
13
|
+
*/
|
|
14
|
+
export type GlueOrder = 0 | 1 | 2 | 3;
|
|
15
|
+
/** Something of fixed width the breaker doesn't look inside: a shaped run of text, an image. */
|
|
16
|
+
export interface Box {
|
|
17
|
+
readonly type: 'box';
|
|
18
|
+
readonly width: number;
|
|
19
|
+
}
|
|
20
|
+
/** Space that can stretch and shrink, such as a word space. Shrink is always finite, as TeX requires in a paragraph. */
|
|
21
|
+
export interface Glue {
|
|
22
|
+
readonly type: 'glue';
|
|
23
|
+
readonly width: number;
|
|
24
|
+
readonly stretch: number;
|
|
25
|
+
readonly shrink: number;
|
|
26
|
+
/** The order of {@link stretch}; 0 (finite) when absent. */
|
|
27
|
+
readonly stretchOrder?: GlueOrder;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A possible break and its cost. `width` is typeset only if the line breaks
|
|
31
|
+
* here (a hyphen). Flagged penalties are hyphens: two in a row cost
|
|
32
|
+
* `doubleHyphenDemerits`, and the renderer inserts the hyphen.
|
|
33
|
+
*/
|
|
34
|
+
export interface Penalty {
|
|
35
|
+
readonly type: 'penalty';
|
|
36
|
+
readonly width: number;
|
|
37
|
+
readonly penalty: number;
|
|
38
|
+
readonly flagged: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Found by automatic hyphenation. TeX hyphenates only from its second
|
|
41
|
+
* pass, so the first (pretolerance) pass ignores these; explicit hyphens
|
|
42
|
+
* and soft hyphens are not automatic.
|
|
43
|
+
*/
|
|
44
|
+
readonly auto?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** One item of a paragraph's list. */
|
|
47
|
+
export type Item = Box | Glue | Penalty;
|
|
48
|
+
/** A glue specification without the item tag: `\leftskip`, `\rightskip`, `\parfillskip`. */
|
|
49
|
+
export type GlueSpec = Omit<Glue, 'type'>;
|
|
50
|
+
/** A box `width` wide. */
|
|
51
|
+
export declare function box(width: number): Box;
|
|
52
|
+
/** Glue: `width plus stretch minus shrink`, with stretch of the given order. */
|
|
53
|
+
export declare function glue(width: number, stretch?: number, shrink?: number, stretchOrder?: GlueOrder): Glue;
|
|
54
|
+
/** A penalty of `penalty`, `width` wide if broken at; `flagged` marks a hyphen. */
|
|
55
|
+
export declare function penalty(penalty: number, width?: number, flagged?: boolean): Penalty;
|
|
56
|
+
/**
|
|
57
|
+
* A hyphenation point found by the hyphenator: a flagged penalty, `width`
|
|
58
|
+
* being the hyphen's, that only the second pass tries (TeX's
|
|
59
|
+
* `\hyphenpenalty`, default 50).
|
|
60
|
+
*/
|
|
61
|
+
export declare function hyphenationPoint(width: number, penalty?: number): Penalty;
|
|
62
|
+
/** TeX's default `\parfillskip`: `0pt plus 1fil`. */
|
|
63
|
+
export declare const PARFILLSKIP: GlueSpec;
|
|
64
|
+
/**
|
|
65
|
+
* Ends a paragraph as TeX does (tex.web §816): drops a trailing glue, then
|
|
66
|
+
* appends `\penalty10000`, the `\parfillskip` glue and a forced break, so
|
|
67
|
+
* the last line is filled rather than justified.
|
|
68
|
+
*/
|
|
69
|
+
export declare function finishParagraph(items: readonly Item[], parfillskip?: GlueSpec): Item[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TeX's horizontal lists, as Knuth and Plass model them in "Breaking
|
|
3
|
+
* Paragraphs into Lines" (1981): a paragraph is a sequence of boxes, glue
|
|
4
|
+
* and penalties (https://plans.inkylabs.com/pulpweaver#the-box-glue-and-penalty-model-in-css).
|
|
5
|
+
* Widths are plain numbers in any unit; the engine uses CSS px. Integer
|
|
6
|
+
* units (TeX's sp, or 1/64 px) keep the arithmetic exact, as TeX's is.
|
|
7
|
+
*/
|
|
8
|
+
/** A penalty at or above this never breaks; at or below its negation, always breaks. */
|
|
9
|
+
export const INFINITE_PENALTY = 10000;
|
|
10
|
+
/** A box `width` wide. */
|
|
11
|
+
export function box(width) {
|
|
12
|
+
return { type: 'box', width };
|
|
13
|
+
}
|
|
14
|
+
/** Glue: `width plus stretch minus shrink`, with stretch of the given order. */
|
|
15
|
+
export function glue(width, stretch = 0, shrink = 0, stretchOrder = 0) {
|
|
16
|
+
return stretchOrder === 0
|
|
17
|
+
? { type: 'glue', width, stretch, shrink }
|
|
18
|
+
: { type: 'glue', width, stretch, shrink, stretchOrder };
|
|
19
|
+
}
|
|
20
|
+
/** A penalty of `penalty`, `width` wide if broken at; `flagged` marks a hyphen. */
|
|
21
|
+
export function penalty(penalty, width = 0, flagged = false) {
|
|
22
|
+
return { type: 'penalty', width, penalty, flagged };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A hyphenation point found by the hyphenator: a flagged penalty, `width`
|
|
26
|
+
* being the hyphen's, that only the second pass tries (TeX's
|
|
27
|
+
* `\hyphenpenalty`, default 50).
|
|
28
|
+
*/
|
|
29
|
+
export function hyphenationPoint(width, penalty = 50) {
|
|
30
|
+
return { type: 'penalty', width, penalty, flagged: true, auto: true };
|
|
31
|
+
}
|
|
32
|
+
/** TeX's default `\parfillskip`: `0pt plus 1fil`. */
|
|
33
|
+
export const PARFILLSKIP = { width: 0, stretch: 1, shrink: 0, stretchOrder: 1 };
|
|
34
|
+
/**
|
|
35
|
+
* Ends a paragraph as TeX does (tex.web §816): drops a trailing glue, then
|
|
36
|
+
* appends `\penalty10000`, the `\parfillskip` glue and a forced break, so
|
|
37
|
+
* the last line is filled rather than justified.
|
|
38
|
+
*/
|
|
39
|
+
export function finishParagraph(items, parfillskip = PARFILLSKIP) {
|
|
40
|
+
const out = items.at(-1)?.type === 'glue' ? items.slice(0, -1) : items.slice();
|
|
41
|
+
out.push(penalty(INFINITE_PENALTY), { type: 'glue', ...parfillskip }, penalty(-INFINITE_PENALTY));
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../src/linebreak/items.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAA;AAgDrC,0BAA0B;AAC1B,MAAM,UAAU,GAAG,CAAC,KAAa;IAC/B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AAC/B,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,IAAI,CAAC,KAAa,EAAE,OAAO,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,YAAY,GAAc,CAAC;IACtF,OAAO,YAAY,KAAK,CAAC;QACvB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1C,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA;AAC5D,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,OAAe,EAAE,KAAK,GAAG,CAAC,EAAE,OAAO,GAAG,KAAK;IACjE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,OAAO,GAAG,EAAE;IAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;AACvE,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,WAAW,GAAa,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAA;AAEzF;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAsB,EAAE,WAAW,GAAa,WAAW;IACzF,MAAM,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IAC9E,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAA;IACjG,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Knuth–Plass line breaker, following TeX's own (tex.web §813–890):
|
|
3
|
+
* a pass without automatic hyphenation at `pretolerance`, then one with it
|
|
4
|
+
* at `tolerance`, then one with `emergencyStretch`; fitness classes;
|
|
5
|
+
* demerits of (l + b)² ± p² plus TeX's adjacent, double-hyphen and
|
|
6
|
+
* final-hyphen demerits; looseness; and a measure per line, as `\parshape`.
|
|
7
|
+
* Given the same widths, it chooses TeX's breaks and reports TeX's
|
|
8
|
+
* numbers; `trace` gives the record `\tracingparagraphs` would.
|
|
9
|
+
*/
|
|
10
|
+
import type { GlueOrder, GlueSpec, Item } from './items.js';
|
|
11
|
+
/** TeX's `inf_bad`: the badness of a line that can't stretch enough. */
|
|
12
|
+
export declare const INFINITE_BADNESS = 10000;
|
|
13
|
+
/** TeX's fitness classes (§817), from a line's badness and whether it stretches or shrinks. */
|
|
14
|
+
export declare const Fitness: {
|
|
15
|
+
readonly VeryLoose: 0;
|
|
16
|
+
readonly Loose: 1;
|
|
17
|
+
readonly Decent: 2;
|
|
18
|
+
readonly Tight: 3;
|
|
19
|
+
};
|
|
20
|
+
export type Fitness = (typeof Fitness)[keyof typeof Fitness];
|
|
21
|
+
/**
|
|
22
|
+
* The measure of each line, as TeX's `\parshape`: a number for every line,
|
|
23
|
+
* an array whose last entry repeats for the lines after it, or a function
|
|
24
|
+
* of the line number (from 1).
|
|
25
|
+
*/
|
|
26
|
+
export type Measure = number | readonly number[] | ((line: number) => number);
|
|
27
|
+
/** TeX's paragraph parameters, under TeX's names; the CSS sets them as `--pw-tolerance` and so on. */
|
|
28
|
+
export interface LineBreakParameters {
|
|
29
|
+
/** The badness the second pass accepts: `\tolerance`, default 200. */
|
|
30
|
+
readonly tolerance: number;
|
|
31
|
+
/** The badness the first pass, without automatic hyphenation, accepts; negative skips that pass: `\pretolerance`, default 100. */
|
|
32
|
+
readonly pretolerance: number;
|
|
33
|
+
/** Added to each line's badness before squaring, so fewer lines win: `\linepenalty`, default 10. */
|
|
34
|
+
readonly linePenalty: number;
|
|
35
|
+
/** For a line whose fitness class isn't next to the previous line's: `\adjdemerits`, default 10000. */
|
|
36
|
+
readonly adjDemerits: number;
|
|
37
|
+
/** For two hyphenated lines in a row: `\doublehyphendemerits`, default 10000. */
|
|
38
|
+
readonly doubleHyphenDemerits: number;
|
|
39
|
+
/** For a hyphen ending the second-last line: `\finalhyphendemerits`, default 5000. */
|
|
40
|
+
readonly finalHyphenDemerits: number;
|
|
41
|
+
/** Stretch added to every line in a last pass before giving up on the tolerance: `\emergencystretch`, default 0. */
|
|
42
|
+
readonly emergencyStretch: number;
|
|
43
|
+
/** Lines to add (or, negative, remove) from the optimum if it can be done within tolerance: `\looseness`, default 0. */
|
|
44
|
+
readonly looseness: number;
|
|
45
|
+
/** Glue at the start and end of every line: `\leftskip`, `\rightskip`. */
|
|
46
|
+
readonly leftSkip: GlueSpec;
|
|
47
|
+
readonly rightSkip: GlueSpec;
|
|
48
|
+
/** Lines with badness above this are reported underfull: `\hbadness`, default 1000. It doesn't change the breaks. */
|
|
49
|
+
readonly hbadness: number;
|
|
50
|
+
}
|
|
51
|
+
/** TeX's defaults (plain TeX's, where INITEX's are zero). */
|
|
52
|
+
export declare const DEFAULT_PARAMETERS: LineBreakParameters;
|
|
53
|
+
export interface LineBreakOptions extends Partial<LineBreakParameters> {
|
|
54
|
+
readonly measure: Measure;
|
|
55
|
+
/** Record every feasible break and active node, as `\tracingparagraphs=1` does. */
|
|
56
|
+
readonly trace?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** One line of the broken paragraph, ready to set. */
|
|
59
|
+
export interface Line {
|
|
60
|
+
/** The first item on the line: glue and penalties after the previous break are discarded. */
|
|
61
|
+
readonly start: number;
|
|
62
|
+
/** The item the line breaks at. It isn't on the line unless it's a penalty, whose width (a hyphen) is. */
|
|
63
|
+
readonly end: number;
|
|
64
|
+
/** The measure of this line. */
|
|
65
|
+
readonly measure: number;
|
|
66
|
+
/** Natural width, with `leftSkip`, `rightSkip` and a hyphen at the break. */
|
|
67
|
+
readonly width: number;
|
|
68
|
+
/** Total finite stretch and shrink. */
|
|
69
|
+
readonly stretch: number;
|
|
70
|
+
readonly shrink: number;
|
|
71
|
+
/**
|
|
72
|
+
* How far the glue is set, as TeX's glue set ratio: positive stretches
|
|
73
|
+
* each glue by `ratio × stretch` (only glue of order {@link glueOrder},
|
|
74
|
+
* when that's infinite), negative shrinks it by `−ratio × shrink`. An
|
|
75
|
+
* overfull line has −1 (all its shrink) and still doesn't fit.
|
|
76
|
+
*/
|
|
77
|
+
readonly ratio: number;
|
|
78
|
+
readonly glueOrder: GlueOrder;
|
|
79
|
+
/** Badness as TeX's `hpack` computes it, so as set (emergency stretch isn't real glue); 1000000 if overfull. */
|
|
80
|
+
readonly badness: number;
|
|
81
|
+
readonly fitness: Fitness;
|
|
82
|
+
/** This line's demerits as the breaker charged them. */
|
|
83
|
+
readonly demerits: number;
|
|
84
|
+
/** Ends at a flagged penalty: the renderer inserts a hyphen. */
|
|
85
|
+
readonly hyphenated: boolean;
|
|
86
|
+
/** How much wider than the measure the line stays at full shrink; 0 if it fits. */
|
|
87
|
+
readonly overfull: number;
|
|
88
|
+
/** Stretched past `hbadness` (TeX's "Underfull \hbox"). */
|
|
89
|
+
readonly underfull: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** The pass that found the breaks: TeX's three, or `given` when they were chosen elsewhere ({@link setLines}). */
|
|
92
|
+
export type Pass = 'first' | 'second' | 'emergency' | 'given';
|
|
93
|
+
/** A feasible break or a new active node, as `\tracingparagraphs` shows them. */
|
|
94
|
+
export type TraceEvent = {
|
|
95
|
+
readonly type: 'pass';
|
|
96
|
+
readonly pass: Pass;
|
|
97
|
+
} | {
|
|
98
|
+
/** `@<kind> via @@<via> b=<badness> p=<penalty> d=<demerits>`; badness 10001 is TeX's `*`. */
|
|
99
|
+
readonly type: 'feasible';
|
|
100
|
+
readonly at: number;
|
|
101
|
+
readonly kind: 'glue' | 'penalty' | 'discretionary' | 'par';
|
|
102
|
+
readonly via: number;
|
|
103
|
+
readonly badness: number;
|
|
104
|
+
readonly penalty: number;
|
|
105
|
+
/** null when the break is forced in the final pass (TeX's `d=*`). */
|
|
106
|
+
readonly demerits: number | null;
|
|
107
|
+
} | {
|
|
108
|
+
/** `@@<serial>: line <line>.<fitness>[-] t=<total> -> @@<previous>` */
|
|
109
|
+
readonly type: 'break';
|
|
110
|
+
readonly serial: number;
|
|
111
|
+
readonly at: number;
|
|
112
|
+
readonly line: number;
|
|
113
|
+
readonly fitness: Fitness;
|
|
114
|
+
readonly hyphenated: boolean;
|
|
115
|
+
readonly total: number;
|
|
116
|
+
readonly previous: number;
|
|
117
|
+
};
|
|
118
|
+
export interface LineBreakResult {
|
|
119
|
+
/** The item each line breaks at; the last is the paragraph's final forced break. */
|
|
120
|
+
readonly breaks: readonly number[];
|
|
121
|
+
readonly lines: readonly Line[];
|
|
122
|
+
/** Total demerits of the chosen breaks. */
|
|
123
|
+
readonly demerits: number;
|
|
124
|
+
/** The pass that found them. */
|
|
125
|
+
readonly pass: Pass;
|
|
126
|
+
/** Lines more (or fewer) than the optimum, as far as `looseness` could be met. */
|
|
127
|
+
readonly looseness: number;
|
|
128
|
+
readonly trace?: readonly TraceEvent[];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* TeX's badness (§108): about 100 × (t / s)³, computed as TeX does it so
|
|
132
|
+
* the numbers match. The branches on 7230584 and 1663497 are TeX's guards
|
|
133
|
+
* against overflow in sp; in px they never apply.
|
|
134
|
+
*/
|
|
135
|
+
export declare function badness(t: number, s: number): number;
|
|
136
|
+
/**
|
|
137
|
+
* Sets a paragraph at breaks chosen elsewhere (the browser's, for
|
|
138
|
+
* `--pw-line-breaking: browser`, or a plugin's line breaker): each line
|
|
139
|
+
* packed as `breakLines` packs its own, with no demerits charged. `breaks` are the items the lines but
|
|
140
|
+
* the last break at, in order, each a glue or a penalty; the paragraph's
|
|
141
|
+
* final forced break ends the last.
|
|
142
|
+
*/
|
|
143
|
+
export declare function setLines(items: readonly Item[], breaks: readonly number[], options: LineBreakOptions): LineBreakResult;
|
|
144
|
+
/**
|
|
145
|
+
* Breaks a paragraph into lines. The list must end with a forced break
|
|
146
|
+
* (`finishParagraph` adds TeX's ending). Lines that can't be set within
|
|
147
|
+
* tolerance come out overfull or underfull and are reported, never thrown.
|
|
148
|
+
*/
|
|
149
|
+
export declare function breakLines(items: readonly Item[], options: LineBreakOptions): LineBreakResult;
|