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 @@
|
|
|
1
|
+
{"version":3,"file":"measurer.js","sourceRoot":"","sources":["../../src/measure/measurer.ts"],"names":[],"mappings":"AAQA,OAAO,EAAoB,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAIpF,IAAI,QAAuC,CAAA;AAE3C,4EAA4E;AAC5E,SAAS,YAAY;IACnB,QAAQ,KAAK,MAAM,CAAC,YAAY,CAAC,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H,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a browser turns a font's advances into layout. The engine measures text
|
|
3
|
+
* with HarfBuzz and needs the browser to lay it out the same way, so it
|
|
4
|
+
* shapes under the model of the browser it runs in. The models come from
|
|
5
|
+
* the measuring test (tests/widths, and
|
|
6
|
+
* https://plans.inkylabs.com/pulpweaver#measuring-text).
|
|
7
|
+
*/
|
|
8
|
+
export interface LayoutModel {
|
|
9
|
+
/** Which browser engine this models. */
|
|
10
|
+
readonly engine: Engine;
|
|
11
|
+
/**
|
|
12
|
+
* What the size text is set at is rounded to, in px: 1/64 px, FreeType's
|
|
13
|
+
* 26.6 fixed point, except that Firefox rounds CFF fonts' sizes to its 1/60
|
|
14
|
+
* px app unit instead (0: not rounded).
|
|
15
|
+
*/
|
|
16
|
+
readonly sizeUnit: number;
|
|
17
|
+
readonly cffSizeUnit: number;
|
|
18
|
+
/**
|
|
19
|
+
* What `opsz` follows under `font-optical-sizing: auto`: the size in CSS px
|
|
20
|
+
* as the page gives it (Chromium), the size text is set at (Firefox), or
|
|
21
|
+
* nothing, leaving the font's default (WebKit).
|
|
22
|
+
*/
|
|
23
|
+
readonly opticalSize: 'css-size' | 'set-size' | 'none';
|
|
24
|
+
/** The unit each glyph advance and `word-spacing` is rounded to, in px (0: not rounded). */
|
|
25
|
+
readonly advanceUnit: number;
|
|
26
|
+
/** The unit positions are rounded to, in px: the browser's layout unit. */
|
|
27
|
+
readonly layoutUnit: number;
|
|
28
|
+
}
|
|
29
|
+
export type Engine = 'chromium' | 'firefox' | 'webkit';
|
|
30
|
+
export declare const MODELS: Readonly<Record<Engine, LayoutModel>>;
|
|
31
|
+
/** The engine a user agent string names; Chromium when it can't tell. */
|
|
32
|
+
export declare function detectEngine(userAgent: string): Engine;
|
|
33
|
+
/** The model for the browser the code runs in (Chromium's outside one). */
|
|
34
|
+
export declare function currentModel(): LayoutModel;
|
|
35
|
+
/**
|
|
36
|
+
* A size as the model sets text at it. Chromium's choice of 1/64 px step
|
|
37
|
+
* isn't plain rounding for every size (853/64 px is set at 852/64), which is
|
|
38
|
+
* why layout calibrates sizes against the page (layout/calibrate.ts).
|
|
39
|
+
*/
|
|
40
|
+
export declare function setSize(model: LayoutModel, px: number, cff: boolean): number;
|
|
41
|
+
/**
|
|
42
|
+
* A `word-spacing` (or any added space) as the model applies it. Firefox
|
|
43
|
+
* keeps CSS lengths as 32-bit floats and converts them to app units in
|
|
44
|
+
* 32-bit arithmetic, which decides a value that falls on half an app unit.
|
|
45
|
+
*/
|
|
46
|
+
export declare function appliedSpacing(model: LayoutModel, px: number): number;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const MODELS = {
|
|
2
|
+
chromium: {
|
|
3
|
+
engine: 'chromium', sizeUnit: 1 / 64, cffSizeUnit: 1 / 64, opticalSize: 'css-size', advanceUnit: 0, layoutUnit: 1 / 64,
|
|
4
|
+
},
|
|
5
|
+
firefox: {
|
|
6
|
+
engine: 'firefox', sizeUnit: 1 / 64, cffSizeUnit: 1 / 60, opticalSize: 'set-size', advanceUnit: 1 / 60, layoutUnit: 1 / 60,
|
|
7
|
+
},
|
|
8
|
+
// Approximate: WebKit also synthesizes small caps and shapes word by word,
|
|
9
|
+
// which the engine doesn't model yet.
|
|
10
|
+
webkit: {
|
|
11
|
+
engine: 'webkit', sizeUnit: 1 / 64, cffSizeUnit: 1 / 64, opticalSize: 'none', advanceUnit: 0, layoutUnit: 1 / 64,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
/** The engine a user agent string names; Chromium when it can't tell. */
|
|
15
|
+
export function detectEngine(userAgent) {
|
|
16
|
+
if (/\bFirefox\//.test(userAgent))
|
|
17
|
+
return 'firefox';
|
|
18
|
+
if (/\bAppleWebKit\//.test(userAgent) && !/\b(Chrome|Chromium|HeadlessChrome)\//.test(userAgent))
|
|
19
|
+
return 'webkit';
|
|
20
|
+
return 'chromium';
|
|
21
|
+
}
|
|
22
|
+
/** The model for the browser the code runs in (Chromium's outside one). */
|
|
23
|
+
export function currentModel() {
|
|
24
|
+
const ua = globalThis.navigator?.userAgent ?? '';
|
|
25
|
+
return MODELS[detectEngine(ua)];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A size as the model sets text at it. Chromium's choice of 1/64 px step
|
|
29
|
+
* isn't plain rounding for every size (853/64 px is set at 852/64), which is
|
|
30
|
+
* why layout calibrates sizes against the page (layout/calibrate.ts).
|
|
31
|
+
*/
|
|
32
|
+
export function setSize(model, px, cff) {
|
|
33
|
+
const unit = cff ? model.cffSizeUnit : model.sizeUnit;
|
|
34
|
+
return unit ? Math.round(px / unit) * unit : px;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A `word-spacing` (or any added space) as the model applies it. Firefox
|
|
38
|
+
* keeps CSS lengths as 32-bit floats and converts them to app units in
|
|
39
|
+
* 32-bit arithmetic, which decides a value that falls on half an app unit.
|
|
40
|
+
*/
|
|
41
|
+
export function appliedSpacing(model, px) {
|
|
42
|
+
if (!model.advanceUnit)
|
|
43
|
+
return px;
|
|
44
|
+
const perPx = 1 / model.advanceUnit;
|
|
45
|
+
return Math.round(Math.fround(Math.fround(px) * perPx)) / perPx;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/measure/model.ts"],"names":[],"mappings":"AA+BA,MAAM,CAAC,MAAM,MAAM,GAA0C;IAC3D,QAAQ,EAAE;QACR,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE;KACvH;IACD,OAAO,EAAE;QACP,MAAM,EAAE,SAAS,E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ACH,MAAM,UAAU,cAAc,CAAC,KAAkB,EAAE,EAAU;IAC3D,IAAI,CAAC,KAAK,CAAC,WAAW;QAAE,OAAO,EAAE,CAAA;IACjC,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,CAAA;IACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAA;AACjE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PluginRegistry } from '../plugin/register.js';
|
|
2
|
+
import { type Problem } from '../problem.js';
|
|
3
|
+
import type { VFS } from '../vfs/vfs.js';
|
|
4
|
+
/**
|
|
5
|
+
* `fs` as the edition's assets read it: a file whose extension a plugin's
|
|
6
|
+
* processor claims reads as that processor makes it for `edition`; the
|
|
7
|
+
* rest, and every file's text, as they are. A processor's failures go in
|
|
8
|
+
* `problems`, once each.
|
|
9
|
+
*/
|
|
10
|
+
export declare function assetFiles(fs: VFS, registry: PluginRegistry | undefined, edition: string, problems: Problem[]): VFS;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { tryPluginAsync } from '../plugin/failure.js';
|
|
2
|
+
import { problemKey } from '../problem.js';
|
|
3
|
+
/** What each processor gave back, by edition and the SHA-256 of what it was given. */
|
|
4
|
+
const cache = new WeakMap();
|
|
5
|
+
/**
|
|
6
|
+
* `fs` as the edition's assets read it: a file whose extension a plugin's
|
|
7
|
+
* processor claims reads as that processor makes it for `edition`; the
|
|
8
|
+
* rest, and every file's text, as they are. A processor's failures go in
|
|
9
|
+
* `problems`, once each.
|
|
10
|
+
*/
|
|
11
|
+
export function assetFiles(fs, registry, edition, problems) {
|
|
12
|
+
if (!registry?.assets.size)
|
|
13
|
+
return fs;
|
|
14
|
+
const reported = new Set();
|
|
15
|
+
const report = (p) => {
|
|
16
|
+
if (reported.has(problemKey(p)))
|
|
17
|
+
return;
|
|
18
|
+
reported.add(problemKey(p));
|
|
19
|
+
problems.push(p);
|
|
20
|
+
};
|
|
21
|
+
const readFile = async (path) => {
|
|
22
|
+
const data = await fs.readFile(path);
|
|
23
|
+
const name = path.slice(path.lastIndexOf('/') + 1);
|
|
24
|
+
const owned = name.includes('.') ? registry.assets.get(name.slice(name.lastIndexOf('.') + 1).toLowerCase()) : undefined;
|
|
25
|
+
if (!owned)
|
|
26
|
+
return data;
|
|
27
|
+
const found = [];
|
|
28
|
+
const at = { file: path, line: 1, column: 1, endLine: 1, endColumn: 1 };
|
|
29
|
+
const processed = await tryPluginAsync(owned.plugin, 'assets', { what: path, at, leftOut: `${path} is used as it is` }, found, () => processAsset(owned, data, path, edition));
|
|
30
|
+
found.forEach(report);
|
|
31
|
+
return processed ?? data;
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
readFile,
|
|
35
|
+
readText: (path) => fs.readText(path),
|
|
36
|
+
writeFile: (path, data) => fs.writeFile(path, data),
|
|
37
|
+
readDir: (path) => fs.readDir(path),
|
|
38
|
+
stat: (path) => fs.stat(path),
|
|
39
|
+
exists: (path) => fs.exists(path),
|
|
40
|
+
mkdir: (path) => fs.mkdir(path),
|
|
41
|
+
remove: (path) => fs.remove(path),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** What the processor makes of `data` for `edition`, from the cache if it has made it before. */
|
|
45
|
+
async function processAsset(owned, data, path, edition) {
|
|
46
|
+
let byContent = cache.get(owned);
|
|
47
|
+
if (!byContent)
|
|
48
|
+
cache.set(owned, (byContent = new Map()));
|
|
49
|
+
const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', data));
|
|
50
|
+
const key = `${edition}\0${[...digest].map((b) => b.toString(16).padStart(2, '0')).join('')}`;
|
|
51
|
+
let processed = byContent.get(key);
|
|
52
|
+
if (!processed) {
|
|
53
|
+
processed = (async () => {
|
|
54
|
+
const out = await owned.definition.process(data.slice(), { path, edition, plugin: owned.plugin });
|
|
55
|
+
if (!(out instanceof Uint8Array))
|
|
56
|
+
throw new TypeError(`its asset processor for ${path} gave back ${out === undefined ? 'nothing' : 'something other than bytes'}`);
|
|
57
|
+
return out;
|
|
58
|
+
})();
|
|
59
|
+
byContent.set(key, processed);
|
|
60
|
+
// A failure isn't kept: the next read tries again, and is reported again.
|
|
61
|
+
processed.catch(() => byContent.get(key) === processed && byContent.delete(key));
|
|
62
|
+
}
|
|
63
|
+
return processed;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/output/assets.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAA;AAGxD,sFAAsF;AACtF,MAAM,KAAK,GAAG,IAAI,OAAO,EAA2D,CAAA;AAEpF;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,EAAO,EAAE,QAAoC,EAAE,OAAe,EAAE,QAAmB;IAC5G,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IACrC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;IAClC,MAAM,MAAM,GAAG,CAAC,CAAU,EAAE,EAAE;QAC5B,IAAI,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAAE,OAAM;QACvC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3B,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC,CAAA;IACD,MAAM,QAAQ,GAAG,KAAK,EAAE,IAAY,EAAuB,EAAE;QAC3D,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QACpC,MAAM,IAAI,GAAG,IAAI,CA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KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;YACjG,IAAI,CAAC,CAAC,GAAG,YAAY,UAAU,CAAC;gBAAE,MAAM,IAAI,SAAS,CAAC,2BAA2B,IAAI,cAAc,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,4BAA4B,EAAE,CAAC,CAAA;YAClK,OAAO,GAAG,CAAA;QACZ,CAAC,CAAC,EAAE,CAAA;QACJ,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;QAC7B,0EAA0E;QAC1E,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IAClF,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Outputs: what writes an edition, and a build of one edition through to its output. */
|
|
2
|
+
export { CORE_OUTPUT_WRITERS, writeEdition, type Output, type OutputContext, type OutputResult, type WriteEditionOptions } from './output.js';
|
|
3
|
+
export { assetFiles } from './assets.js';
|
|
4
|
+
export { editionStyles, type EditionStyles, type EditionStylesOptions, projectStylesheets } from './stylesheets.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Outputs: what writes an edition, and a build of one edition through to its output. */
|
|
2
|
+
export { CORE_OUTPUT_WRITERS, writeEdition } from './output.js';
|
|
3
|
+
export { assetFiles } from './assets.js';
|
|
4
|
+
export { editionStyles, projectStylesheets } from './stylesheets.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAgF,MAAM,aAAa,CAAA;AAC7I,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,aAAa,EAAiD,kBAAkB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outputs (https://plans.inkylabs.com/pulpweaver#how-a-build-runs): the
|
|
3
|
+
* build's last step, which writes an edition from the transformed book: the
|
|
4
|
+
* web edition as a static site, a print edition as a PDF, the text edition
|
|
5
|
+
* as files, and, through plugins, the EPUB and reStructuredText. Each output
|
|
6
|
+
* has a name, the one an edition's `output` gives, and one owner.
|
|
7
|
+
*
|
|
8
|
+
* This is the core's own interface for them, which the plugin API exposes
|
|
9
|
+
* as a plugin's `output` stage; the core's outputs are
|
|
10
|
+
* {@link CORE_OUTPUT_WRITERS}. `writeEdition` runs a whole build of one
|
|
11
|
+
* edition: read, transform, then the edition's output, with the plugins'
|
|
12
|
+
* readers, transforms, renderers, stylesheets and outputs if it is given
|
|
13
|
+
* their registry.
|
|
14
|
+
*/
|
|
15
|
+
import { type Edition } from '../config/config.js';
|
|
16
|
+
import type { RendererRegistry } from '../html/registry.js';
|
|
17
|
+
import type { CslProcessor } from '../csl/processor.js';
|
|
18
|
+
import type { Measurer } from '../measure/measurer.js';
|
|
19
|
+
import type { Problem } from '../problem.js';
|
|
20
|
+
import type { Project } from '../project.js';
|
|
21
|
+
import type { PluginStylesheet, StylesheetSource, ThemeStylesheet } from '../style/compile.js';
|
|
22
|
+
import type { PluginRegistry, Renderers } from '../plugin/register.js';
|
|
23
|
+
import type { Manuscript } from '../transform/transform.js';
|
|
24
|
+
import type { VFS } from '../vfs/vfs.js';
|
|
25
|
+
import type { OutputIntentHost } from '../colour/intents.js';
|
|
26
|
+
import type { PdfDateTime } from '../pdf/types.js';
|
|
27
|
+
/** What an output is given. */
|
|
28
|
+
export interface OutputContext {
|
|
29
|
+
/** The project, its configuration read and checked. */
|
|
30
|
+
readonly project: Project & {
|
|
31
|
+
readonly config: NonNullable<Project['config']>;
|
|
32
|
+
};
|
|
33
|
+
/** The edition to write. */
|
|
34
|
+
readonly edition: Edition;
|
|
35
|
+
/** The book, read and through the transforms. */
|
|
36
|
+
readonly manuscript: Manuscript;
|
|
37
|
+
/** The plugins' renderers for their blocks and inlines. */
|
|
38
|
+
readonly renderers?: RendererRegistry;
|
|
39
|
+
/** The project's citations' processor (`loadProjectCitations`), if the host has it loaded; else the output loads it if the book cites. */
|
|
40
|
+
readonly citations?: CslProcessor;
|
|
41
|
+
/**
|
|
42
|
+
* The plugins' renderers for their blocks and inlines in every format, by
|
|
43
|
+
* name: the text output uses their `text` ones, a reStructuredText output
|
|
44
|
+
* their `rst` ones.
|
|
45
|
+
*/
|
|
46
|
+
readonly formatRenderers?: ReadonlyMap<string, Renderers>;
|
|
47
|
+
/**
|
|
48
|
+
* The stylesheets besides the core's: the theme's, the plugins' and the
|
|
49
|
+
* author's. The author's default to the project's `styles/` folder, its
|
|
50
|
+
* `.css` files in order of their paths.
|
|
51
|
+
*/
|
|
52
|
+
readonly stylesheets?: {
|
|
53
|
+
readonly theme?: ThemeStylesheet;
|
|
54
|
+
readonly plugins?: readonly PluginStylesheet[];
|
|
55
|
+
readonly author?: readonly StylesheetSource[];
|
|
56
|
+
};
|
|
57
|
+
/** The plugins' registry, whose page builder hooks a paged output's layout takes; none if absent. */
|
|
58
|
+
readonly registry?: PluginRegistry;
|
|
59
|
+
/** The build's date (`buildDate`): a PDF's creation date. None, and nothing is dated. */
|
|
60
|
+
readonly date?: PdfDateTime;
|
|
61
|
+
/** Where output intents' profiles come from: a host's cache of the standard ones, which a page may not fetch across origins. */
|
|
62
|
+
readonly outputIntents?: Pick<OutputIntentHost, 'standardProfile' | 'downloadedProfile'>;
|
|
63
|
+
/** Where the edition's files go: a folder of their own, such as `dist/<edition>`. */
|
|
64
|
+
readonly out: VFS;
|
|
65
|
+
/** A page the output may lay out and measure in: the current one if absent. */
|
|
66
|
+
readonly document?: Document;
|
|
67
|
+
/** The measurer, if the host has one loaded. */
|
|
68
|
+
readonly measurer?: Measurer;
|
|
69
|
+
/**
|
|
70
|
+
* Reads a file the core ships beside its modules (WebAssembly, the site's
|
|
71
|
+
* script): `fetch` by default. A host whose `fetch` can't read the core's
|
|
72
|
+
* URLs (Node's reads no `file:` URLs) passes its own.
|
|
73
|
+
*/
|
|
74
|
+
readonly load?: (url: URL) => Promise<Uint8Array>;
|
|
75
|
+
}
|
|
76
|
+
/** What an output wrote, and what was wrong. */
|
|
77
|
+
export interface OutputResult {
|
|
78
|
+
/** The files written, as paths in `out`, sorted. */
|
|
79
|
+
readonly files: readonly string[];
|
|
80
|
+
readonly problems: readonly Problem[];
|
|
81
|
+
}
|
|
82
|
+
/** An output: what writes an edition whose `output` is its name. */
|
|
83
|
+
export interface Output {
|
|
84
|
+
readonly name: string;
|
|
85
|
+
write(ctx: OutputContext): Promise<OutputResult>;
|
|
86
|
+
}
|
|
87
|
+
/** The outputs the core writes, by name (`config/project-schema.ts`'s `CORE_OUTPUTS` names them all; the rest are to come). */
|
|
88
|
+
export declare const CORE_OUTPUT_WRITERS: Readonly<Record<string, Output>>;
|
|
89
|
+
export interface WriteEditionOptions extends Omit<OutputContext, 'project' | 'edition' | 'manuscript' | 'out' | 'registry'> {
|
|
90
|
+
/** Outputs besides the core's, by name, as plugins add them. */
|
|
91
|
+
readonly outputs?: Readonly<Record<string, Output>>;
|
|
92
|
+
/** The project's plugins (`loadPlugins`): their readers, transforms, renderers, stylesheets and outputs. */
|
|
93
|
+
readonly registry?: PluginRegistry;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Builds one edition of a project into `out`: its chapters read as Djot,
|
|
97
|
+
* the core's transforms, and the output its `output` names. The build goes
|
|
98
|
+
* on past every problem with the source (a reader or transform that throws
|
|
99
|
+
* has its file or its changes left out), so the output is written and every
|
|
100
|
+
* problem comes back with it, the output's own too; a host fails the build
|
|
101
|
+
* on any error (`hasErrors`). An output that throws writes nothing.
|
|
102
|
+
*/
|
|
103
|
+
export declare function writeEdition(project: Project, edition: string, out: VFS, options?: WriteEditionOptions): Promise<OutputResult>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outputs (https://plans.inkylabs.com/pulpweaver#how-a-build-runs): the
|
|
3
|
+
* build's last step, which writes an edition from the transformed book: the
|
|
4
|
+
* web edition as a static site, a print edition as a PDF, the text edition
|
|
5
|
+
* as files, and, through plugins, the EPUB and reStructuredText. Each output
|
|
6
|
+
* has a name, the one an edition's `output` gives, and one owner.
|
|
7
|
+
*
|
|
8
|
+
* This is the core's own interface for them, which the plugin API exposes
|
|
9
|
+
* as a plugin's `output` stage; the core's outputs are
|
|
10
|
+
* {@link CORE_OUTPUT_WRITERS}. `writeEdition` runs a whole build of one
|
|
11
|
+
* edition: read, transform, then the edition's output, with the plugins'
|
|
12
|
+
* readers, transforms, renderers, stylesheets and outputs if it is given
|
|
13
|
+
* their registry.
|
|
14
|
+
*/
|
|
15
|
+
import { CONFIG_FILE } from '../config/config.js';
|
|
16
|
+
import { readDjot } from '../djot/read.js';
|
|
17
|
+
import { citeTransform } from '../citations/notes.js';
|
|
18
|
+
import { citesAnything, projectCitations } from '../citations/project.js';
|
|
19
|
+
import { checkAttributes } from '../plugin/attributes.js';
|
|
20
|
+
import { readFailure, tryPluginAsync } from '../plugin/failure.js';
|
|
21
|
+
import { TomlDocument } from '../config/toml.js';
|
|
22
|
+
import { rendererRegistry } from '../plugin/render.js';
|
|
23
|
+
import { coreTransforms } from '../transform/core.js';
|
|
24
|
+
import { runTransforms } from '../transform/run.js';
|
|
25
|
+
import { textOutput } from '../text/output.js';
|
|
26
|
+
import { pdfOutput } from '../print/output.js';
|
|
27
|
+
import { webOutput } from '../web/output.js';
|
|
28
|
+
/** The outputs the core writes, by name (`config/project-schema.ts`'s `CORE_OUTPUTS` names them all; the rest are to come). */
|
|
29
|
+
export const CORE_OUTPUT_WRITERS = { web: webOutput, pdf: pdfOutput, text: textOutput };
|
|
30
|
+
/**
|
|
31
|
+
* Builds one edition of a project into `out`: its chapters read as Djot,
|
|
32
|
+
* the core's transforms, and the output its `output` names. The build goes
|
|
33
|
+
* on past every problem with the source (a reader or transform that throws
|
|
34
|
+
* has its file or its changes left out), so the output is written and every
|
|
35
|
+
* problem comes back with it, the output's own too; a host fails the build
|
|
36
|
+
* on any error (`hasErrors`). An output that throws writes nothing.
|
|
37
|
+
*/
|
|
38
|
+
export async function writeEdition(project, edition, out, options = {}) {
|
|
39
|
+
const { config } = project;
|
|
40
|
+
if (!config)
|
|
41
|
+
return { files: [], problems: project.problems };
|
|
42
|
+
const settings = config.editions[edition];
|
|
43
|
+
if (!settings)
|
|
44
|
+
throw new Error(`pulpweaver4.toml has no edition ${JSON.stringify(edition)}`);
|
|
45
|
+
const { registry } = options;
|
|
46
|
+
const outputs = { ...CORE_OUTPUT_WRITERS, ...registry?.outputWriters(), ...options.outputs };
|
|
47
|
+
const output = outputs[settings.output];
|
|
48
|
+
if (!output)
|
|
49
|
+
throw new Error(`no output writes ${JSON.stringify(settings.output)} editions yet`);
|
|
50
|
+
const problems = [];
|
|
51
|
+
const readings = await Promise.all(project.chapters.map(async (file) => {
|
|
52
|
+
const reader = registry?.readers.get(file.slice(file.lastIndexOf('.') + 1).toLowerCase());
|
|
53
|
+
if (!reader)
|
|
54
|
+
return readDjot(project.fs, file, registry ? { profile: { owners: registry.owners } } : {});
|
|
55
|
+
const text = await project.fs.readText(file);
|
|
56
|
+
const document = await tryPluginAsync(reader.plugin, 'read', readFailure(file), problems, () => reader.definition(text, { file, plugin: reader.plugin, options: registry.options[reader.plugin] ?? {} }));
|
|
57
|
+
return { document, problems: [] };
|
|
58
|
+
}));
|
|
59
|
+
const manuscript = { documents: readings.flatMap((r) => (r.document ? [r.document] : [])) };
|
|
60
|
+
problems.push(...readings.flatMap((r) => r.problems));
|
|
61
|
+
if (registry)
|
|
62
|
+
problems.push(...checkAttributes(manuscript, registry));
|
|
63
|
+
// A note style makes the citations in the text footnotes (`citations/notes.ts`).
|
|
64
|
+
// The bibliographies' and the style's problems come with the rest; a style that can't be loaded has the default stand in.
|
|
65
|
+
const loaded = options.citations === undefined && citesAnything(manuscript) ? await projectCitations(project) : undefined;
|
|
66
|
+
if (loaded)
|
|
67
|
+
problems.push(...loaded.problems);
|
|
68
|
+
const citations = options.citations ?? loaded?.processor;
|
|
69
|
+
const cite = citations ? [citeTransform({ note: citations.style.class === 'note' })] : [];
|
|
70
|
+
problems.push(...(await runTransforms(manuscript, [...coreTransforms({ indexes: { language: config.language } }), ...cite, ...(registry?.transforms ?? [])], registry ? { owners: registry.owners, options: registry.options, now: registry.now } : {})));
|
|
71
|
+
const { outputs: _, registry: __, ...given } = options;
|
|
72
|
+
const context = registry
|
|
73
|
+
? { renderers: rendererRegistry(registry), formatRenderers: registry.renderers, registry, ...given, stylesheets: { ...registry.styles, ...given.stylesheets } }
|
|
74
|
+
: given;
|
|
75
|
+
const owner = registry?.outputs.get(settings.output)?.plugin;
|
|
76
|
+
const write = () => output.write({ ...context, ...(citations ? { citations } : {}), project: project, edition: settings, manuscript, out });
|
|
77
|
+
if (owner === undefined) {
|
|
78
|
+
const result = await write();
|
|
79
|
+
return { files: result.files, problems: [...problems, ...result.problems] };
|
|
80
|
+
}
|
|
81
|
+
// A plugin's output that throws is named at the edition's `output`, and the edition isn't written.
|
|
82
|
+
const at = TomlDocument.parse(project.configText, CONFIG_FILE).problem(['editions', edition, 'output'], 'value', '', '');
|
|
83
|
+
const result = await tryPluginAsync(owner, 'output', { what: `the edition ${edition}`, at, leftOut: `the edition ${edition} isn't written` }, problems, write);
|
|
84
|
+
return { files: result?.files ?? [], problems: [...problems, ...(result?.problems ?? [])] };
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/output/output.ts"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AE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAA;IACvK,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,MAAM,KAAK,EAAE,CAAA;QAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7E,CAAC;IACD,mGAAmG;IACnG,MAAM,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IACxH,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,eAAe,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,eAAe,OAAO,gBAAgB,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC9J,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAA;AAC7F,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ProjectFonts } from '../fonts/faces.js';
|
|
2
|
+
import type { ColourMap } from '../colour/previews.js';
|
|
3
|
+
import type { Measurer } from '../measure/measurer.js';
|
|
4
|
+
import type { PluginRegistry } from '../plugin/register.js';
|
|
5
|
+
import { type Problem } from '../problem.js';
|
|
6
|
+
import type { Project } from '../project.js';
|
|
7
|
+
import { type CompileOptions, type PluginStylesheet, type StylesheetSource, type ThemeStylesheet } from '../style/compile.js';
|
|
8
|
+
/** The project's own stylesheets: the `.css` files in `styles/`, in order of their paths. */
|
|
9
|
+
export declare function projectStylesheets(project: Project): Promise<StylesheetSource[]>;
|
|
10
|
+
/** What styles an edition of a paged or screen medium, as {@link editionStyles} makes it. */
|
|
11
|
+
export interface EditionStyles {
|
|
12
|
+
/** The stylesheet compiled for the edition, its `@font-face` rules left out: the faces are the project's, loaded. */
|
|
13
|
+
readonly css: string;
|
|
14
|
+
/** The previews the compiler lowered CMYK colours and inks to, for the painter. */
|
|
15
|
+
readonly colours: ColourMap;
|
|
16
|
+
/** The faces the stylesheets' `@font-face` rules name, from the project's files, in the page. */
|
|
17
|
+
readonly fonts: ProjectFonts;
|
|
18
|
+
/** The stylesheets' problems and the fonts'. */
|
|
19
|
+
readonly problems: readonly Problem[];
|
|
20
|
+
}
|
|
21
|
+
export interface EditionStylesOptions {
|
|
22
|
+
/** The theme's and the plugins' stylesheets, and the author's, which default to {@link projectStylesheets}. */
|
|
23
|
+
readonly stylesheets?: {
|
|
24
|
+
readonly theme?: ThemeStylesheet;
|
|
25
|
+
readonly plugins?: readonly PluginStylesheet[];
|
|
26
|
+
readonly author?: readonly StylesheetSource[];
|
|
27
|
+
};
|
|
28
|
+
readonly measurer: Measurer;
|
|
29
|
+
/** The page the faces join (`document.fonts`); the current one by default, `null` for none. */
|
|
30
|
+
readonly document?: Document | null;
|
|
31
|
+
/** How a CMYK colour looks: a CMYK edition's output intent's (`CmykConverter.toSrgb`). */
|
|
32
|
+
readonly cmykPreview?: CompileOptions['cmykPreview'];
|
|
33
|
+
/** The plugins, whose asset processors the faces' files go through (`assetFiles`). */
|
|
34
|
+
readonly registry?: PluginRegistry;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* An edition's stylesheet and fonts, as a build of it lays it out: the
|
|
38
|
+
* core's defaults and the rendered HTML's rules, the theme's, the plugins'
|
|
39
|
+
* and the author's stylesheets compiled for the edition
|
|
40
|
+
* (`compileStylesheet`), and the faces their `@font-face` rules name loaded
|
|
41
|
+
* from the project (`loadProjectFonts`), through the plugins' asset
|
|
42
|
+
* processors. A print edition's PDF and a test's
|
|
43
|
+
* `build()` of it see the same.
|
|
44
|
+
*/
|
|
45
|
+
export declare function editionStyles(project: Project, edition: string, options: EditionStylesOptions): Promise<EditionStyles>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** The stylesheets a project's editions are styled with. */
|
|
2
|
+
import { withoutFontFaceRules } from '../fonts/css.js';
|
|
3
|
+
import { loadProjectFonts } from '../fonts/faces.js';
|
|
4
|
+
import { htmlRules } from '../html/css.js';
|
|
5
|
+
import { assetFiles } from './assets.js';
|
|
6
|
+
import { problemAt } from '../problem.js';
|
|
7
|
+
import { compileStylesheet, styleOptions } from '../style/compile.js';
|
|
8
|
+
import { DEFAULT_STYLESHEET } from '../style/defaults.js';
|
|
9
|
+
/** The project's own stylesheets: the `.css` files in `styles/`, in order of their paths. */
|
|
10
|
+
export async function projectStylesheets(project) {
|
|
11
|
+
const files = project.files.filter((f) => f.startsWith('styles/') && f.endsWith('.css'));
|
|
12
|
+
return Promise.all(files.map(async (file) => ({ file, css: await project.fs.readText(file) })));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* An edition's stylesheet and fonts, as a build of it lays it out: the
|
|
16
|
+
* core's defaults and the rendered HTML's rules, the theme's, the plugins'
|
|
17
|
+
* and the author's stylesheets compiled for the edition
|
|
18
|
+
* (`compileStylesheet`), and the faces their `@font-face` rules name loaded
|
|
19
|
+
* from the project (`loadProjectFonts`), through the plugins' asset
|
|
20
|
+
* processors. A print edition's PDF and a test's
|
|
21
|
+
* `build()` of it see the same.
|
|
22
|
+
*/
|
|
23
|
+
export async function editionStyles(project, edition, options) {
|
|
24
|
+
const { config } = project;
|
|
25
|
+
if (!config)
|
|
26
|
+
throw new Error('pulpweaver4.toml has errors');
|
|
27
|
+
const style = styleOptions(config.editions, edition);
|
|
28
|
+
const author = options.stylesheets?.author ?? (await projectStylesheets(project));
|
|
29
|
+
const compiled = compileStylesheet({
|
|
30
|
+
...style,
|
|
31
|
+
defaults: `${DEFAULT_STYLESHEET}${htmlRules(style.edition)}`,
|
|
32
|
+
...(options.stylesheets?.theme ? { theme: options.stylesheets.theme } : {}),
|
|
33
|
+
...(options.stylesheets?.plugins ? { plugins: options.stylesheets.plugins } : {}),
|
|
34
|
+
author,
|
|
35
|
+
...(options.cmykPreview ? { cmykPreview: options.cmykPreview } : {}),
|
|
36
|
+
});
|
|
37
|
+
const assetProblems = [];
|
|
38
|
+
const fonts = await loadProjectFonts(assetFiles(project.fs, options.registry, edition, assetProblems), author.map((s) => ({ path: s.file, css: s.css })), {
|
|
39
|
+
media: style.edition.media, measurer: options.measurer, ...(options.document !== undefined ? { document: options.document } : {}),
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
css: withoutFontFaceRules(compiled.css),
|
|
43
|
+
colours: compiled.colours,
|
|
44
|
+
fonts,
|
|
45
|
+
problems: [...compiled.problems, ...fonts.problems.map((p) => problemAt(p.position, p, AT_CONFIG)), ...assetProblems],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Where a problem with no place in the source is put: the configuration. */
|
|
49
|
+
const AT_CONFIG = { file: 'pulpweaver4.toml', line: 1, column: 1, endLine: 1, endColumn: 1 };
|
|
50
|
+
//# sourceMappingURL=stylesheets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylesheets.js","sourceRoot":"","sources":["../../src/output/stylesheets.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAA;AAEvD,OAAO,EAAE,iBAAiB,EAA8C,YAAY,EAA+C,M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Aa,CAAC;KACtH,CAAA;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAW,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backgrounds (CSS Backgrounds 3): the colour, then each layer from the
|
|
3
|
+
* bottom up, an image or a gradient sized, positioned and repeated in its
|
|
4
|
+
* origin box and clipped to its clip box, rounded by the border radii. A
|
|
5
|
+
* layer that repeats is a tiling pattern whose cell is one tile (and its
|
|
6
|
+
* spacing); one that doesn't is the tile alone. `background-blend-mode`
|
|
7
|
+
* blends the layers in an isolated group, so they blend with each other and
|
|
8
|
+
* the colour, not with what is behind the element.
|
|
9
|
+
*
|
|
10
|
+
* The same layers make `mask-image`'s masks (`effects.ts`), with the mask's
|
|
11
|
+
* longhands.
|
|
12
|
+
*/
|
|
13
|
+
import type { PdfFill, PdfOp, PdfPathSegment } from '../pdf/types.js';
|
|
14
|
+
import type { PaintContext } from './context.js';
|
|
15
|
+
import { type Edges, type Radii, type Rect } from './geometry.js';
|
|
16
|
+
/** The longhands of a list of layers: `background-*` or `mask-*`, each a computed comma-separated list. */
|
|
17
|
+
export interface Layers {
|
|
18
|
+
image: string;
|
|
19
|
+
position: string;
|
|
20
|
+
size: string;
|
|
21
|
+
repeat: string;
|
|
22
|
+
origin: string;
|
|
23
|
+
clip: string;
|
|
24
|
+
/** `background-blend-mode`; masks have none (`maskOf` reads `mask-composite`). */
|
|
25
|
+
blend?: string;
|
|
26
|
+
}
|
|
27
|
+
/** An element's boxes, in page px: the border box, padding box and content box, with their radii. */
|
|
28
|
+
export interface Boxes {
|
|
29
|
+
border: Rect;
|
|
30
|
+
padding: Rect;
|
|
31
|
+
content: Rect;
|
|
32
|
+
borderRadii: Radii;
|
|
33
|
+
paddingRadii: Radii;
|
|
34
|
+
contentRadii: Radii;
|
|
35
|
+
widths: Edges;
|
|
36
|
+
}
|
|
37
|
+
/** An element's boxes, from its border box in page px. */
|
|
38
|
+
export declare function boxesOf(cs: CSSStyleDeclaration, border: Rect): Boxes;
|
|
39
|
+
/** A box of an element by its keyword: `border-box`, `padding-box` or `content-box` (others as the border box). */
|
|
40
|
+
export declare function boxOf(b: Boxes, keyword: string): {
|
|
41
|
+
rect: Rect;
|
|
42
|
+
radii: Radii;
|
|
43
|
+
};
|
|
44
|
+
export declare function layersOf(cs: CSSStyleDeclaration, prefix: 'background' | 'mask'): Layers;
|
|
45
|
+
/** An element's background: its colour and layers, in page points. */
|
|
46
|
+
export declare function paintBackground(cs: CSSStyleDeclaration, b: Boxes, ctx: PaintContext, interpolate: boolean): Promise<PdfOp[]>;
|
|
47
|
+
export declare const BLEND_MODES: Readonly<Record<string, true>>;
|
|
48
|
+
/**
|
|
49
|
+
* Each image layer, from the bottom up, clipped: `wrap` may put a layer's
|
|
50
|
+
* ops in a blend mode. Layers whose image is `none` paint nothing.
|
|
51
|
+
*/
|
|
52
|
+
export declare function paintLayers(layers: Layers, b: Boxes, ctx: PaintContext, interpolate: boolean, wrap?: (index: number, ops: PdfOp[]) => PdfOp[]): Promise<PdfOp[]>;
|
|
53
|
+
/** The URL of a `url(…)` value. */
|
|
54
|
+
export declare function urlOf(value: string): string | undefined;
|
|
55
|
+
/** A filled path. */
|
|
56
|
+
export declare function fill(path: PdfPathSegment[], f: PdfFill): PdfOp;
|