pulpweaver4 0.0.0-stage → 0.0.88
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 +123 -0
- package/dist/ast/djot.js +458 -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 +534 -0
- package/dist/ast/nodes.js +48 -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 +91 -0
- package/dist/citations/book.js +206 -0
- package/dist/citations/book.js.map +1 -0
- package/dist/citations/collect.d.ts +52 -0
- package/dist/citations/collect.js +125 -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 +120 -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 +135 -0
- package/dist/colour/intents.js +183 -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 +109 -0
- package/dist/config/config.js +295 -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 +209 -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 +177 -0
- package/dist/csl/processor.js +759 -0
- package/dist/csl/processor.js.map +1 -0
- package/dist/csl/project.d.ts +21 -0
- package/dist/csl/project.js +78 -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 +324 -0
- package/dist/djot/djot.js/src/ast.js +61 -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 +656 -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 +1019 -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 +1040 -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 +1436 -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 +687 -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 +32 -0
- package/dist/layout/page-box.js +110 -0
- package/dist/layout/page-box.js.map +1 -0
- package/dist/layout/page-rules.d.ts +47 -0
- package/dist/layout/page-rules.js +202 -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 +71 -0
- package/dist/layout/pages.js +741 -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 +65 -0
- package/dist/lint/rules/source.js +334 -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 +534 -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 +1779 -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 +199 -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 +120 -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 +228 -0
- package/dist/test/pipeline.js +73 -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 +36 -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 +194 -0
- package/docs/reference/pulpweaver4-toml/index.md +182 -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,849 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BibLaTeX and BibTeX files as CSL items, mapped as biblatex's data model
|
|
3
|
+
* and Pandoc's citeproc reader map them, so a `.bib` reads here as it does
|
|
4
|
+
* through Pandoc, with these differences:
|
|
5
|
+
*
|
|
6
|
+
* - Titles keep their case. Pandoc turns English titles into sentence case
|
|
7
|
+
* for CSL, which spoils every proper noun not in braces (“The first
|
|
8
|
+
* epistle to the corinthians”); Chicago, the default style, wants title
|
|
9
|
+
* case, which the bibliographies this reads already have. Braces still
|
|
10
|
+
* protect case, as nocase spans, for styles that change it.
|
|
11
|
+
* - `pagination` and `bookpagination` are kept, in `custom`, for the
|
|
12
|
+
* processor's locators.
|
|
13
|
+
* - `shorthand` is CSL's `citation-label`.
|
|
14
|
+
* - `entrysubtype = {classical}` (biblatex-chicago's mark for ancient and
|
|
15
|
+
* medieval works cited by their divisions) is CSL 1.0.2's `classic`.
|
|
16
|
+
* - Month names (`month = {September}`), seasons and ranges of months and
|
|
17
|
+
* years (`year = {2001--2002}`) are read, where Pandoc drops them; so are
|
|
18
|
+
* textgreek's letters (`\textChi`).
|
|
19
|
+
*
|
|
20
|
+
* Reading has three steps: BibTeX's legacy types and fields become
|
|
21
|
+
* biblatex's (`journal` is `journaltitle`, `@phdthesis` is `@thesis` with
|
|
22
|
+
* `type = {phdthesis}`); `xdata` and `crossref` are resolved, the latter
|
|
23
|
+
* with biber's inheritance rules (a `@book`'s `title` is its `@inbook`'s
|
|
24
|
+
* `booktitle`, an `@mvbook`'s is its volumes' `maintitle`); then each entry
|
|
25
|
+
* becomes an item. A field with no CSL variable is reported, so nothing in
|
|
26
|
+
* a bibliography is silently lost.
|
|
27
|
+
*/
|
|
28
|
+
import { parseBibtex } from './bibtex.js';
|
|
29
|
+
import { legacyDate, parseEdtf } from './dates.js';
|
|
30
|
+
import { LineMap } from './item.js';
|
|
31
|
+
import { latexToText } from './latex.js';
|
|
32
|
+
import { parseNames, splitNames } from './names.js';
|
|
33
|
+
/** Reads a `.bib` file's entries as CSL items. */
|
|
34
|
+
export function readBiblatex(text, options = {}) {
|
|
35
|
+
const lines = new LineMap(text, options.file ?? '');
|
|
36
|
+
const parsed = parseBibtex(text, lines);
|
|
37
|
+
const problems = new Problems(lines, parsed.problems);
|
|
38
|
+
const entries = new Map();
|
|
39
|
+
for (const raw of parsed.entries) {
|
|
40
|
+
const entry = normalize(raw);
|
|
41
|
+
entries.set(entry.key, entry);
|
|
42
|
+
}
|
|
43
|
+
const resolver = new Resolver(entries, problems);
|
|
44
|
+
const items = [];
|
|
45
|
+
const byId = new Map();
|
|
46
|
+
const ranges = new Map();
|
|
47
|
+
const inherits = new Map();
|
|
48
|
+
const aliases = [];
|
|
49
|
+
for (const entry of entries.values()) {
|
|
50
|
+
if (entry.type === 'xdata')
|
|
51
|
+
continue;
|
|
52
|
+
const resolved = resolver.resolve(entry.key);
|
|
53
|
+
const item = new Mapper(resolved, problems, options.variant ?? 'biblatex').item();
|
|
54
|
+
items.push(item);
|
|
55
|
+
byId.set(item.id, item);
|
|
56
|
+
ranges.set(item.id, lines.range(entry.start, entry.end));
|
|
57
|
+
const from = resolver.inherits.get(entry.key);
|
|
58
|
+
if (from !== undefined)
|
|
59
|
+
inherits.set(item.id, from);
|
|
60
|
+
const ids = entry.fields.get('ids');
|
|
61
|
+
if (ids !== undefined)
|
|
62
|
+
for (const alias of splitList(ids.value))
|
|
63
|
+
aliases.push([alias, item.id, ids]);
|
|
64
|
+
}
|
|
65
|
+
for (const [alias, id, field] of aliases) {
|
|
66
|
+
if (byId.has(alias))
|
|
67
|
+
problems.add('warning', 'duplicate-key', `${alias}, an alias of ${id}, is already a key`, field);
|
|
68
|
+
else
|
|
69
|
+
byId.set(alias, byId.get(id));
|
|
70
|
+
}
|
|
71
|
+
return { items, byId, ranges, inherits, problems: problems.list };
|
|
72
|
+
}
|
|
73
|
+
class Problems {
|
|
74
|
+
lines;
|
|
75
|
+
list;
|
|
76
|
+
seen = new Set();
|
|
77
|
+
constructor(lines, initial) {
|
|
78
|
+
this.lines = lines;
|
|
79
|
+
this.list = [...initial];
|
|
80
|
+
}
|
|
81
|
+
/** Reports a problem at a field, once: an inherited field's problem would otherwise repeat in every child. */
|
|
82
|
+
add(severity, code, message, at, fix) {
|
|
83
|
+
const id = `${code}\0${message}\0${at.start}`;
|
|
84
|
+
if (this.seen.has(id))
|
|
85
|
+
return;
|
|
86
|
+
this.seen.add(id);
|
|
87
|
+
this.list.push({ severity, code, message, ...(fix !== undefined && { fix }), ...this.lines.range(at.start, at.end) });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// BibTeX's legacy types and fields, as biber's default source map renames them.
|
|
92
|
+
const TYPE_ALIASES = {
|
|
93
|
+
conference: ['inproceedings'],
|
|
94
|
+
electronic: ['online'],
|
|
95
|
+
www: ['online'],
|
|
96
|
+
mastersthesis: ['thesis', 'mathesis'],
|
|
97
|
+
phdthesis: ['thesis', 'phdthesis'],
|
|
98
|
+
techreport: ['report', 'techreport'],
|
|
99
|
+
};
|
|
100
|
+
const FIELD_ALIASES = {
|
|
101
|
+
address: 'location',
|
|
102
|
+
annote: 'annotation',
|
|
103
|
+
archiveprefix: 'eprinttype',
|
|
104
|
+
journal: 'journaltitle',
|
|
105
|
+
key: 'sortkey',
|
|
106
|
+
pdf: 'file',
|
|
107
|
+
primaryclass: 'eprintclass',
|
|
108
|
+
school: 'institution',
|
|
109
|
+
hyphenation: 'langid',
|
|
110
|
+
};
|
|
111
|
+
function normalize(raw) {
|
|
112
|
+
const fields = new Map();
|
|
113
|
+
for (const field of raw.fields.values()) {
|
|
114
|
+
const name = FIELD_ALIASES[field.name] ?? field.name;
|
|
115
|
+
if (!fields.has(name) || name === field.name)
|
|
116
|
+
fields.set(name, name === field.name ? field : { ...field, name });
|
|
117
|
+
}
|
|
118
|
+
let type = raw.type;
|
|
119
|
+
const alias = TYPE_ALIASES[type];
|
|
120
|
+
if (alias !== undefined) {
|
|
121
|
+
type = alias[0];
|
|
122
|
+
if (alias[1] !== undefined && !fields.has('type'))
|
|
123
|
+
fields.set('type', { name: 'type', value: alias[1], start: raw.start, end: raw.start + 1 + raw.type.length });
|
|
124
|
+
}
|
|
125
|
+
return { type, key: raw.key, fields, start: raw.start, end: raw.end };
|
|
126
|
+
}
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
// xdata and crossref.
|
|
129
|
+
/** Fields no entry inherits (biblatex's manual, appendix B). */
|
|
130
|
+
const NOT_INHERITED = new Set([
|
|
131
|
+
'ids',
|
|
132
|
+
'crossref',
|
|
133
|
+
'xref',
|
|
134
|
+
'xdata',
|
|
135
|
+
'entryset',
|
|
136
|
+
'entrysubtype',
|
|
137
|
+
'execute',
|
|
138
|
+
'label',
|
|
139
|
+
'options',
|
|
140
|
+
'presort',
|
|
141
|
+
'related',
|
|
142
|
+
'relatedoptions',
|
|
143
|
+
'relatedstring',
|
|
144
|
+
'relatedtype',
|
|
145
|
+
'shorthand',
|
|
146
|
+
'shorthandintro',
|
|
147
|
+
'sortkey',
|
|
148
|
+
]);
|
|
149
|
+
const NO_SHORT_TITLES = { shorttitle: [], sorttitle: [], indextitle: [], indexsorttitle: [] };
|
|
150
|
+
const TO_MAIN = { title: ['maintitle'], subtitle: ['mainsubtitle'], titleaddon: ['maintitleaddon'], ...NO_SHORT_TITLES };
|
|
151
|
+
const TO_BOOK = { title: ['booktitle'], subtitle: ['booksubtitle'], titleaddon: ['booktitleaddon'], ...NO_SHORT_TITLES };
|
|
152
|
+
const TO_JOURNAL = { title: ['journaltitle'], subtitle: ['journalsubtitle'], titleaddon: ['journaltitleaddon'], ...NO_SHORT_TITLES };
|
|
153
|
+
/** biber's default inheritance: from which types, to which, the fields that change their names. */
|
|
154
|
+
const INHERITANCE = [
|
|
155
|
+
[['mvbook'], ['book', 'inbook', 'bookinbook', 'suppbook'], TO_MAIN],
|
|
156
|
+
[['mvbook', 'book'], ['inbook', 'bookinbook', 'suppbook'], { author: ['author', 'bookauthor'] }],
|
|
157
|
+
[['mvcollection', 'mvreference'], ['collection', 'reference', 'incollection', 'inreference', 'suppcollection'], TO_MAIN],
|
|
158
|
+
[['mvproceedings'], ['proceedings', 'inproceedings'], TO_MAIN],
|
|
159
|
+
[['book'], ['inbook', 'bookinbook', 'suppbook'], TO_BOOK],
|
|
160
|
+
[['collection', 'reference'], ['incollection', 'inreference', 'suppcollection'], TO_BOOK],
|
|
161
|
+
[['proceedings'], ['inproceedings'], TO_BOOK],
|
|
162
|
+
[['periodical'], ['article', 'suppperiodical'], TO_JOURNAL],
|
|
163
|
+
];
|
|
164
|
+
class Resolver {
|
|
165
|
+
entries;
|
|
166
|
+
problems;
|
|
167
|
+
done = new Map();
|
|
168
|
+
active = new Set();
|
|
169
|
+
/** The keys each resolved entry inherited from, its parents' among them; none, not there. */
|
|
170
|
+
inherits = new Map();
|
|
171
|
+
constructor(entries, problems) {
|
|
172
|
+
this.entries = entries;
|
|
173
|
+
this.problems = problems;
|
|
174
|
+
}
|
|
175
|
+
/** An entry with what it inherits from its xdata and crossref entries. */
|
|
176
|
+
resolve(key) {
|
|
177
|
+
const done = this.done.get(key);
|
|
178
|
+
if (done !== undefined)
|
|
179
|
+
return done;
|
|
180
|
+
const entry = this.entries.get(key);
|
|
181
|
+
if (entry === undefined)
|
|
182
|
+
return undefined;
|
|
183
|
+
if (this.active.has(key))
|
|
184
|
+
return entry;
|
|
185
|
+
this.active.add(key);
|
|
186
|
+
const fields = new Map(entry.fields);
|
|
187
|
+
const from = new Set();
|
|
188
|
+
const inheritFrom = (ref) => {
|
|
189
|
+
from.add(ref);
|
|
190
|
+
for (const key of this.inherits.get(ref) ?? [])
|
|
191
|
+
from.add(key);
|
|
192
|
+
};
|
|
193
|
+
const xdata = entry.fields.get('xdata');
|
|
194
|
+
if (xdata !== undefined) {
|
|
195
|
+
for (const ref of splitList(xdata.value)) {
|
|
196
|
+
const source = this.parent(key, ref, xdata);
|
|
197
|
+
if (source === undefined)
|
|
198
|
+
continue;
|
|
199
|
+
inheritFrom(ref);
|
|
200
|
+
if (source.type !== 'xdata')
|
|
201
|
+
this.problems.add('warning', 'bad-xdata', `${key}'s xdata ${ref} is a @${source.type}, not an @xdata entry`, xdata);
|
|
202
|
+
for (const [name, field] of source.fields)
|
|
203
|
+
if (!fields.has(name) && !NOT_INHERITED.has(name))
|
|
204
|
+
fields.set(name, field);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const crossref = entry.fields.get('crossref');
|
|
208
|
+
if (crossref !== undefined) {
|
|
209
|
+
const parent = this.parent(key, crossref.value.trim(), crossref);
|
|
210
|
+
if (parent !== undefined) {
|
|
211
|
+
inheritFrom(crossref.value.trim());
|
|
212
|
+
const renamed = new Map();
|
|
213
|
+
for (const [from, to, map] of INHERITANCE) {
|
|
214
|
+
if (!from.includes(parent.type) || !to.includes(entry.type))
|
|
215
|
+
continue;
|
|
216
|
+
for (const [name, targets] of Object.entries(map))
|
|
217
|
+
renamed.set(name, [...(renamed.get(name) ?? []), ...targets]);
|
|
218
|
+
}
|
|
219
|
+
for (const [name, field] of parent.fields) {
|
|
220
|
+
if (NOT_INHERITED.has(name))
|
|
221
|
+
continue;
|
|
222
|
+
for (const target of renamed.get(name) ?? [name])
|
|
223
|
+
if (!fields.has(target))
|
|
224
|
+
fields.set(target, { ...field, name: target });
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
this.active.delete(key);
|
|
229
|
+
if (from.size > 0)
|
|
230
|
+
this.inherits.set(key, [...from]);
|
|
231
|
+
const resolved = { ...entry, fields };
|
|
232
|
+
this.done.set(key, resolved);
|
|
233
|
+
return resolved;
|
|
234
|
+
}
|
|
235
|
+
parent(key, ref, field) {
|
|
236
|
+
if (this.active.has(ref)) {
|
|
237
|
+
this.problems.add('warning', 'crossref-cycle', `${key}'s ${field.name} ${ref} leads back to ${key}`, field);
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
const parent = this.resolve(ref);
|
|
241
|
+
if (parent === undefined)
|
|
242
|
+
this.problems.add('warning', 'missing-crossref', `${key}'s ${field.name} names ${ref}, which isn't in the bibliography`, field);
|
|
243
|
+
return parent;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
// biblatex's entries as CSL items.
|
|
248
|
+
const TYPES = {
|
|
249
|
+
article: 'article-journal',
|
|
250
|
+
book: 'book',
|
|
251
|
+
mvbook: 'book',
|
|
252
|
+
inbook: 'chapter',
|
|
253
|
+
bookinbook: 'chapter',
|
|
254
|
+
suppbook: 'chapter',
|
|
255
|
+
booklet: 'pamphlet',
|
|
256
|
+
collection: 'book',
|
|
257
|
+
mvcollection: 'book',
|
|
258
|
+
incollection: 'chapter',
|
|
259
|
+
suppcollection: 'chapter',
|
|
260
|
+
dataset: 'dataset',
|
|
261
|
+
manual: 'book',
|
|
262
|
+
misc: 'document',
|
|
263
|
+
online: 'webpage',
|
|
264
|
+
patent: 'patent',
|
|
265
|
+
periodical: 'article-journal',
|
|
266
|
+
suppperiodical: 'article-journal',
|
|
267
|
+
proceedings: 'book',
|
|
268
|
+
mvproceedings: 'book',
|
|
269
|
+
inproceedings: 'paper-conference',
|
|
270
|
+
reference: 'book',
|
|
271
|
+
mvreference: 'book',
|
|
272
|
+
inreference: 'entry-encyclopedia',
|
|
273
|
+
report: 'report',
|
|
274
|
+
software: 'software',
|
|
275
|
+
thesis: 'thesis',
|
|
276
|
+
unpublished: 'manuscript',
|
|
277
|
+
// The types biblatex defines but its standard styles don't support.
|
|
278
|
+
artwork: 'graphic',
|
|
279
|
+
audio: 'song',
|
|
280
|
+
commentary: 'book',
|
|
281
|
+
image: 'graphic',
|
|
282
|
+
jurisdiction: 'legal_case',
|
|
283
|
+
legislation: 'legislation',
|
|
284
|
+
legal: 'treaty',
|
|
285
|
+
letter: 'personal_communication',
|
|
286
|
+
movie: 'motion_picture',
|
|
287
|
+
music: 'song',
|
|
288
|
+
performance: 'performance',
|
|
289
|
+
review: 'review',
|
|
290
|
+
standard: 'standard',
|
|
291
|
+
video: 'motion_picture',
|
|
292
|
+
};
|
|
293
|
+
const ARTICLES = new Set(['article', 'periodical', 'suppperiodical', 'review']);
|
|
294
|
+
const CHAPTERS = new Set(['inbook', 'incollection', 'inproceedings', 'inreference', 'bookinbook', 'suppbook', 'suppcollection']);
|
|
295
|
+
/** Types whose `number` is the number in a series, CSL's `collection-number`. */
|
|
296
|
+
const IN_SERIES = new Set([
|
|
297
|
+
'book',
|
|
298
|
+
'collection',
|
|
299
|
+
'proceedings',
|
|
300
|
+
'reference',
|
|
301
|
+
'mvbook',
|
|
302
|
+
'mvcollection',
|
|
303
|
+
'mvproceedings',
|
|
304
|
+
'mvreference',
|
|
305
|
+
'bookinbook',
|
|
306
|
+
'inbook',
|
|
307
|
+
'incollection',
|
|
308
|
+
'inproceedings',
|
|
309
|
+
'inreference',
|
|
310
|
+
'suppbook',
|
|
311
|
+
'suppcollection',
|
|
312
|
+
]);
|
|
313
|
+
/** biblatex's localisation keys for `type` and `pubstate`, in its English strings (english.lbx). */
|
|
314
|
+
const KEYS = {
|
|
315
|
+
mathesis: 'Master’s thesis',
|
|
316
|
+
phdthesis: 'PhD thesis',
|
|
317
|
+
candthesis: 'Candidate thesis',
|
|
318
|
+
techreport: 'technical report',
|
|
319
|
+
resreport: 'research report',
|
|
320
|
+
software: 'computer software',
|
|
321
|
+
datacd: 'CD-ROM',
|
|
322
|
+
audiocd: 'audio CD',
|
|
323
|
+
patent: 'patent',
|
|
324
|
+
patentde: 'German patent',
|
|
325
|
+
patenteu: 'European patent',
|
|
326
|
+
patentfr: 'French patent',
|
|
327
|
+
patentuk: 'British patent',
|
|
328
|
+
patentus: 'U.S. patent',
|
|
329
|
+
patreq: 'patent request',
|
|
330
|
+
patreqde: 'German patent request',
|
|
331
|
+
patreqeu: 'European patent request',
|
|
332
|
+
patreqfr: 'French patent request',
|
|
333
|
+
patrequk: 'British patent request',
|
|
334
|
+
patrequs: 'U.S. patent request',
|
|
335
|
+
inpreparation: 'in preparation',
|
|
336
|
+
submitted: 'submitted',
|
|
337
|
+
forthcoming: 'forthcoming',
|
|
338
|
+
inpress: 'in press',
|
|
339
|
+
prepublished: 'pre-published',
|
|
340
|
+
};
|
|
341
|
+
/** babel's and polyglossia's language names, as BCP 47 tags (as Pandoc maps them). */
|
|
342
|
+
const LANGUAGES = {
|
|
343
|
+
afrikaans: 'af-ZA',
|
|
344
|
+
albanian: 'sq',
|
|
345
|
+
american: 'en-US',
|
|
346
|
+
amharic: 'am',
|
|
347
|
+
ancientgreek: 'grc',
|
|
348
|
+
arabic: 'ar',
|
|
349
|
+
armenian: 'hy',
|
|
350
|
+
australian: 'en-AU',
|
|
351
|
+
austrian: 'de-AT',
|
|
352
|
+
naustrian: 'de-AT',
|
|
353
|
+
basque: 'eu',
|
|
354
|
+
bengali: 'bn',
|
|
355
|
+
brazil: 'pt-BR',
|
|
356
|
+
brazilian: 'pt-BR',
|
|
357
|
+
breton: 'br',
|
|
358
|
+
british: 'en-GB',
|
|
359
|
+
bulgarian: 'bg',
|
|
360
|
+
canadian: 'en-CA',
|
|
361
|
+
canadien: 'fr-CA',
|
|
362
|
+
catalan: 'ca-AD',
|
|
363
|
+
chinese: 'zh',
|
|
364
|
+
coptic: 'cop',
|
|
365
|
+
croatian: 'hr-HR',
|
|
366
|
+
czech: 'cs-CZ',
|
|
367
|
+
danish: 'da-DK',
|
|
368
|
+
dutch: 'nl-NL',
|
|
369
|
+
english: 'en-US',
|
|
370
|
+
esperanto: 'eo',
|
|
371
|
+
estonian: 'et-EE',
|
|
372
|
+
finnish: 'fi-FI',
|
|
373
|
+
french: 'fr-FR',
|
|
374
|
+
francais: 'fr-FR',
|
|
375
|
+
galician: 'gl',
|
|
376
|
+
german: 'de-DE',
|
|
377
|
+
ngerman: 'de-DE',
|
|
378
|
+
swissgerman: 'de-CH',
|
|
379
|
+
nswissgerman: 'de-CH',
|
|
380
|
+
greek: 'el-GR',
|
|
381
|
+
polutonikogreek: 'el-GR',
|
|
382
|
+
hebrew: 'he-IL',
|
|
383
|
+
hindi: 'hi',
|
|
384
|
+
hungarian: 'hu-HU',
|
|
385
|
+
magyar: 'hu-HU',
|
|
386
|
+
icelandic: 'is-IS',
|
|
387
|
+
interlingua: 'ia',
|
|
388
|
+
irish: 'ga-IE',
|
|
389
|
+
italian: 'it-IT',
|
|
390
|
+
japanese: 'ja-JP',
|
|
391
|
+
korean: 'ko-KR',
|
|
392
|
+
latin: 'la',
|
|
393
|
+
latvian: 'lv-LV',
|
|
394
|
+
lithuanian: 'lt-LT',
|
|
395
|
+
lowersorbian: 'dsb',
|
|
396
|
+
macedonian: 'mk',
|
|
397
|
+
malay: 'ms',
|
|
398
|
+
mexican: 'es-MX',
|
|
399
|
+
newzealand: 'en-NZ',
|
|
400
|
+
norsk: 'nb-NO',
|
|
401
|
+
nynorsk: 'nn-NO',
|
|
402
|
+
norwegian: 'nb-NO',
|
|
403
|
+
occitan: 'oc',
|
|
404
|
+
persian: 'fa-IR',
|
|
405
|
+
polish: 'pl-PL',
|
|
406
|
+
portuguese: 'pt-PT',
|
|
407
|
+
portuges: 'pt-PT',
|
|
408
|
+
romanian: 'ro-RO',
|
|
409
|
+
russian: 'ru-RU',
|
|
410
|
+
sanskrit: 'sa',
|
|
411
|
+
serbian: 'sr-RS',
|
|
412
|
+
slovak: 'sk-SK',
|
|
413
|
+
slovene: 'sl-SI',
|
|
414
|
+
slovenian: 'sl-SI',
|
|
415
|
+
spanish: 'es-ES',
|
|
416
|
+
swedish: 'sv-SE',
|
|
417
|
+
syriac: 'syr',
|
|
418
|
+
thai: 'th-TH',
|
|
419
|
+
turkish: 'tr-TR',
|
|
420
|
+
ukrainian: 'uk-UA',
|
|
421
|
+
uppersorbian: 'hsb',
|
|
422
|
+
urdu: 'ur',
|
|
423
|
+
vietnamese: 'vi-VN',
|
|
424
|
+
welsh: 'cy-GB',
|
|
425
|
+
};
|
|
426
|
+
/** Name fields' editorial roles (biblatex's `editortype` values), as CSL name variables. */
|
|
427
|
+
const ROLES = {
|
|
428
|
+
editor: 'editor',
|
|
429
|
+
compiler: 'compiler',
|
|
430
|
+
director: 'director',
|
|
431
|
+
organizer: 'organizer',
|
|
432
|
+
collaborator: 'contributor',
|
|
433
|
+
redactor: 'contributor',
|
|
434
|
+
reviser: 'contributor',
|
|
435
|
+
founder: 'contributor',
|
|
436
|
+
continuator: 'contributor',
|
|
437
|
+
};
|
|
438
|
+
/** Fields read for what they say about others, or kept only for sorting, indexes or the files' tools: none is reported. */
|
|
439
|
+
const IGNORED = new Set([
|
|
440
|
+
'crossref',
|
|
441
|
+
'xref',
|
|
442
|
+
'xdata',
|
|
443
|
+
'ids',
|
|
444
|
+
'entryset',
|
|
445
|
+
'execute',
|
|
446
|
+
'label',
|
|
447
|
+
'options',
|
|
448
|
+
'presort',
|
|
449
|
+
'sortkey',
|
|
450
|
+
'sortname',
|
|
451
|
+
'sorttitle',
|
|
452
|
+
'sortyear',
|
|
453
|
+
'sortshorthand',
|
|
454
|
+
'sortinit',
|
|
455
|
+
'indextitle',
|
|
456
|
+
'indexsorttitle',
|
|
457
|
+
'shorthandintro',
|
|
458
|
+
'gender',
|
|
459
|
+
'authortype',
|
|
460
|
+
'eprintclass',
|
|
461
|
+
'langidopts',
|
|
462
|
+
'file',
|
|
463
|
+
'owner',
|
|
464
|
+
'timestamp',
|
|
465
|
+
'creationdate',
|
|
466
|
+
'modificationdate',
|
|
467
|
+
'groups',
|
|
468
|
+
'ranking',
|
|
469
|
+
'readstatus',
|
|
470
|
+
'priority',
|
|
471
|
+
'qualityassured',
|
|
472
|
+
'relevance',
|
|
473
|
+
'printed',
|
|
474
|
+
'date-added',
|
|
475
|
+
'date-modified',
|
|
476
|
+
'mendeley-tags',
|
|
477
|
+
'mendeley-groups',
|
|
478
|
+
]);
|
|
479
|
+
/** Title fields, whose braces protect case. */
|
|
480
|
+
const TITLE_FIELDS = /^(title|subtitle|titleaddon|(main|book|journal|issue|event|orig)(title|subtitle|titleaddon)|series|shorttitle|shortjournal|shortseries|reprinttitle)$/;
|
|
481
|
+
class Mapper {
|
|
482
|
+
entry;
|
|
483
|
+
problems;
|
|
484
|
+
variant;
|
|
485
|
+
used = new Set();
|
|
486
|
+
out;
|
|
487
|
+
useprefix;
|
|
488
|
+
constructor(entry, problems, variant) {
|
|
489
|
+
this.entry = entry;
|
|
490
|
+
this.problems = problems;
|
|
491
|
+
this.variant = variant;
|
|
492
|
+
this.out = { id: entry.key };
|
|
493
|
+
this.useprefix = /(^|,)\s*useprefix\s*(=\s*true\s*)?(,|$)/i.test(this.raw('options') ?? '');
|
|
494
|
+
}
|
|
495
|
+
item() {
|
|
496
|
+
this.type();
|
|
497
|
+
this.names();
|
|
498
|
+
this.titles();
|
|
499
|
+
this.publication();
|
|
500
|
+
this.numbers();
|
|
501
|
+
this.dates();
|
|
502
|
+
this.identifiers();
|
|
503
|
+
this.notes();
|
|
504
|
+
this.unmapped();
|
|
505
|
+
return this.out;
|
|
506
|
+
}
|
|
507
|
+
get t() {
|
|
508
|
+
return this.entry.type;
|
|
509
|
+
}
|
|
510
|
+
type() {
|
|
511
|
+
const t = this.t;
|
|
512
|
+
let type = TYPES[t];
|
|
513
|
+
if (type === undefined) {
|
|
514
|
+
this.problems.add('warning', 'unknown-type', `@${t} isn't a biblatex entry type; ${this.entry.key} is read as @misc`, {
|
|
515
|
+
start: this.entry.start,
|
|
516
|
+
end: this.entry.start + 1 + t.length,
|
|
517
|
+
});
|
|
518
|
+
type = 'document';
|
|
519
|
+
}
|
|
520
|
+
const subtype = this.raw('entrysubtype')?.toLowerCase();
|
|
521
|
+
if (subtype !== undefined)
|
|
522
|
+
this.used.add('entrysubtype');
|
|
523
|
+
if (t === 'article' && subtype === 'magazine')
|
|
524
|
+
type = 'article-magazine';
|
|
525
|
+
else if (t === 'article' && subtype === 'newspaper')
|
|
526
|
+
type = 'article-newspaper';
|
|
527
|
+
else if (subtype === 'classical' && (type === 'book' || type === 'document'))
|
|
528
|
+
type = 'classic';
|
|
529
|
+
if (t === 'unpublished' && (this.has('eventtitle') || this.has('eventdate') || this.has('venue')))
|
|
530
|
+
type = 'speech';
|
|
531
|
+
this.out.type = type;
|
|
532
|
+
const genre = this.raw('type');
|
|
533
|
+
if (genre !== undefined)
|
|
534
|
+
this.set('genre', KEYS[genre.toLowerCase()] ?? this.text('type'), 'type');
|
|
535
|
+
}
|
|
536
|
+
names() {
|
|
537
|
+
this.setNames('author', 'author');
|
|
538
|
+
this.setNames('container-author', 'bookauthor');
|
|
539
|
+
this.setNames('translator', 'translator');
|
|
540
|
+
for (const field of ['editor', 'editora', 'editorb', 'editorc']) {
|
|
541
|
+
if (!this.has(field))
|
|
542
|
+
continue;
|
|
543
|
+
const typeField = `${field}type`;
|
|
544
|
+
const role = this.raw(typeField)?.toLowerCase() ?? (field === 'editor' || !this.has('editor') ? 'editor' : 'collaborator');
|
|
545
|
+
this.used.add(typeField);
|
|
546
|
+
this.setNames(ROLES[role] ?? 'contributor', field);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
setNames(variable, field) {
|
|
550
|
+
const f = this.field(field);
|
|
551
|
+
if (f === undefined)
|
|
552
|
+
return;
|
|
553
|
+
this.used.add(field);
|
|
554
|
+
const names = parseNames(f.value, this.useprefix, (cmd) => this.unknownCommand(cmd, f));
|
|
555
|
+
if (names.length === 0)
|
|
556
|
+
return;
|
|
557
|
+
const existing = this.out[variable];
|
|
558
|
+
this.out[variable] = existing === undefined ? names : [...existing, ...names];
|
|
559
|
+
}
|
|
560
|
+
titles() {
|
|
561
|
+
const t = this.t;
|
|
562
|
+
const periodical = t === 'periodical';
|
|
563
|
+
const chapter = CHAPTERS.has(t);
|
|
564
|
+
const hasMain = this.has('maintitle');
|
|
565
|
+
const main = hasMain && !chapter;
|
|
566
|
+
const title = (periodical && this.has('issuetitle') ? this.title('issuetitle', 'issuesubtitle', 'issuetitleaddon') : undefined) ??
|
|
567
|
+
(main ? this.title('maintitle', 'mainsubtitle', 'maintitleaddon') : this.title('title', 'subtitle', 'titleaddon'));
|
|
568
|
+
if (title !== undefined)
|
|
569
|
+
this.out.title = title;
|
|
570
|
+
if (hasMain) {
|
|
571
|
+
const volume = chapter ? this.title('booktitle', 'booksubtitle', 'booktitleaddon') : this.title('title', 'subtitle', 'titleaddon');
|
|
572
|
+
if (volume !== undefined)
|
|
573
|
+
this.out['volume-title'] = volume;
|
|
574
|
+
}
|
|
575
|
+
const container = periodical
|
|
576
|
+
? this.title('title', 'subtitle', 'titleaddon')
|
|
577
|
+
: chapter && hasMain
|
|
578
|
+
? this.title('maintitle', 'mainsubtitle', 'maintitleaddon')
|
|
579
|
+
: chapter && this.has('booktitle')
|
|
580
|
+
? this.title('booktitle', 'booksubtitle', 'booktitleaddon')
|
|
581
|
+
: this.title('journaltitle', 'journalsubtitle', 'journaltitleaddon');
|
|
582
|
+
if (container !== undefined)
|
|
583
|
+
this.out['container-title'] = container;
|
|
584
|
+
if (periodical && !hasMain && this.has('shorttitle'))
|
|
585
|
+
this.set('container-title-short', this.text('shorttitle'), 'shorttitle');
|
|
586
|
+
else if (this.has('shortjournal'))
|
|
587
|
+
this.set('container-title-short', this.text('shortjournal'), 'shortjournal');
|
|
588
|
+
if (this.has('series')) {
|
|
589
|
+
const series = this.text('series');
|
|
590
|
+
this.set('collection-title', /^\d+$/.test(series) ? `${ordinal(Number(series))} series` : series, 'series');
|
|
591
|
+
}
|
|
592
|
+
// The short title: shorttitle, or the title without its subtitle.
|
|
593
|
+
if ((!hasMain || chapter) && this.has('shorttitle') && !(periodical && !hasMain)) {
|
|
594
|
+
this.set('title-short', this.text('shorttitle'), 'shorttitle');
|
|
595
|
+
}
|
|
596
|
+
else if (this.has('title') && !periodical) {
|
|
597
|
+
const full = this.text('title');
|
|
598
|
+
const colon = full.indexOf(':');
|
|
599
|
+
if ((this.has('subtitle') || this.has('titleaddon')) && !hasMain)
|
|
600
|
+
this.out['title-short'] = colon < 0 ? full : full.slice(0, colon).trim();
|
|
601
|
+
else if (colon >= 0 && !hasMain)
|
|
602
|
+
this.out['title-short'] = full.slice(0, colon).trim();
|
|
603
|
+
}
|
|
604
|
+
if (this.has('eventtitle'))
|
|
605
|
+
this.out['event-title'] = this.title('eventtitle', undefined, 'eventtitleaddon');
|
|
606
|
+
if (this.has('origtitle'))
|
|
607
|
+
this.set('original-title', this.text('origtitle'), 'origtitle');
|
|
608
|
+
}
|
|
609
|
+
/** A title, joined to its subtitle with a colon and its addon with a full stop, as biblatex prints them. */
|
|
610
|
+
title(main, sub, addon) {
|
|
611
|
+
if (!this.has(main))
|
|
612
|
+
return undefined;
|
|
613
|
+
let out = this.text(main);
|
|
614
|
+
if (sub !== undefined && this.has(sub))
|
|
615
|
+
out = join(out, this.text(sub), ':');
|
|
616
|
+
if (this.has(addon))
|
|
617
|
+
out = join(out, this.text(addon), '.');
|
|
618
|
+
return out;
|
|
619
|
+
}
|
|
620
|
+
publication() {
|
|
621
|
+
const publishers = ['institution', 'organization', 'howpublished', 'publisher']
|
|
622
|
+
.filter((f) => this.has(f))
|
|
623
|
+
.map((f) => (f === 'howpublished' ? this.text(f) : this.list(f)));
|
|
624
|
+
if (publishers.length > 0)
|
|
625
|
+
this.out.publisher = publishers.join('; ');
|
|
626
|
+
if (this.has('origpublisher'))
|
|
627
|
+
this.set('original-publisher', this.list('origpublisher'), 'origpublisher');
|
|
628
|
+
if (this.has('location'))
|
|
629
|
+
this.set(this.t === 'patent' ? 'jurisdiction' : 'publisher-place', this.list('location'), 'location');
|
|
630
|
+
if (this.has('origlocation'))
|
|
631
|
+
this.set('original-publisher-place', this.list('origlocation'), 'origlocation');
|
|
632
|
+
if (this.has('venue'))
|
|
633
|
+
this.set('event-place', this.text('venue'), 'venue');
|
|
634
|
+
}
|
|
635
|
+
numbers() {
|
|
636
|
+
const t = this.t;
|
|
637
|
+
if (this.has('pages'))
|
|
638
|
+
this.set('page', this.number('pages'), 'pages');
|
|
639
|
+
if (this.has('pagetotal'))
|
|
640
|
+
this.set('number-of-pages', this.number('pagetotal'), 'pagetotal');
|
|
641
|
+
const volume = this.has('volume') ? this.number('volume') : undefined;
|
|
642
|
+
const part = this.has('part') ? this.number('part') : undefined;
|
|
643
|
+
this.used.add('volume').add('part');
|
|
644
|
+
if (volume !== undefined || part !== undefined)
|
|
645
|
+
this.out.volume = [volume, part].filter((x) => x !== undefined).join('.');
|
|
646
|
+
if (this.has('volumes'))
|
|
647
|
+
this.set('number-of-volumes', this.number('volumes'), 'volumes');
|
|
648
|
+
if (this.has('chapter'))
|
|
649
|
+
this.set('chapter-number', this.number('chapter'), 'chapter');
|
|
650
|
+
if (this.has('edition'))
|
|
651
|
+
this.set('edition', this.number('edition'), 'edition');
|
|
652
|
+
if (this.has('version'))
|
|
653
|
+
this.set('version', this.text('version'), 'version');
|
|
654
|
+
const number = this.has('number') ? this.number('number') : undefined;
|
|
655
|
+
this.used.add('number');
|
|
656
|
+
if (ARTICLES.has(t)) {
|
|
657
|
+
const issue = [number, this.has('issue') ? this.number('issue') : undefined].filter((x) => x !== undefined);
|
|
658
|
+
this.used.add('issue');
|
|
659
|
+
if (issue.length > 0)
|
|
660
|
+
this.out.issue = issue.join(', ');
|
|
661
|
+
}
|
|
662
|
+
else if (number !== undefined) {
|
|
663
|
+
this.out[IN_SERIES.has(t) ? 'collection-number' : 'number'] = number;
|
|
664
|
+
}
|
|
665
|
+
if (this.has('eid') && this.out.number === undefined)
|
|
666
|
+
this.set('number', this.text('eid'), 'eid');
|
|
667
|
+
if (this.has('pagination'))
|
|
668
|
+
this.custom('pagination', this.raw('pagination').toLowerCase(), 'pagination');
|
|
669
|
+
if (this.has('bookpagination'))
|
|
670
|
+
this.custom('bookpagination', this.raw('bookpagination').toLowerCase(), 'bookpagination');
|
|
671
|
+
}
|
|
672
|
+
dates() {
|
|
673
|
+
this.date('issued', 'date', '');
|
|
674
|
+
this.date('event-date', 'eventdate', 'event');
|
|
675
|
+
this.date('original-date', 'origdate', 'orig');
|
|
676
|
+
this.date('accessed', 'urldate', 'url');
|
|
677
|
+
}
|
|
678
|
+
/** A biblatex date field, else BibTeX's year, month and day fields with the prefix. */
|
|
679
|
+
date(variable, field, prefix) {
|
|
680
|
+
const f = this.field(field);
|
|
681
|
+
if (f !== undefined) {
|
|
682
|
+
this.used.add(field);
|
|
683
|
+
const value = this.raw(field);
|
|
684
|
+
if (variable === 'issued' && /^(forthcoming|in press)$/i.test(value)) {
|
|
685
|
+
this.out.status ??= value.toLowerCase();
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
const date = parseEdtf(value);
|
|
689
|
+
if (date === undefined)
|
|
690
|
+
this.problems.add('warning', 'bad-date', `${this.entry.key}'s ${field}, ${value}, isn't an ISO 8601 date or range`, f, 'write it as YYYY, YYYY-MM or YYYY-MM-DD, or a range of them joined by /');
|
|
691
|
+
this.out[variable] = date ?? { literal: this.text(field) };
|
|
692
|
+
for (const old of ['year', 'month', 'day'].map((p) => prefix + p))
|
|
693
|
+
this.used.add(old);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const year = this.field(`${prefix}year`);
|
|
697
|
+
const month = this.field(`${prefix}month`);
|
|
698
|
+
if (year === undefined && month === undefined)
|
|
699
|
+
return;
|
|
700
|
+
for (const old of ['year', 'month', 'day'])
|
|
701
|
+
this.used.add(prefix + old);
|
|
702
|
+
const yearText = year === undefined ? undefined : this.text(year.name);
|
|
703
|
+
if (variable === 'issued' && yearText !== undefined && /^(forthcoming|in press)$/i.test(yearText)) {
|
|
704
|
+
this.out.status ??= yearText.toLowerCase();
|
|
705
|
+
this.used.add(`${prefix}month`).add(`${prefix}day`);
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
const monthText = month === undefined ? undefined : this.text(month.name);
|
|
709
|
+
const dayText = this.has(`${prefix}day`) ? this.text(`${prefix}day`) : undefined;
|
|
710
|
+
const { date, problem } = legacyDate(yearText, monthText, dayText);
|
|
711
|
+
if (problem !== undefined)
|
|
712
|
+
this.problems.add('warning', 'bad-date', `${this.entry.key}: ${problem}`, year ?? month);
|
|
713
|
+
if (date !== undefined)
|
|
714
|
+
this.out[variable] = date;
|
|
715
|
+
}
|
|
716
|
+
identifiers() {
|
|
717
|
+
const url = this.raw('url');
|
|
718
|
+
if (url !== undefined)
|
|
719
|
+
this.set('URL', url, 'url');
|
|
720
|
+
const eprint = this.raw('eprint');
|
|
721
|
+
if (eprint !== undefined) {
|
|
722
|
+
const kind = this.raw('eprinttype')?.toLowerCase();
|
|
723
|
+
const base = kind === undefined ? undefined : EPRINTS[kind];
|
|
724
|
+
if (kind === 'doi' && !this.has('doi'))
|
|
725
|
+
this.set('DOI', eprint, 'eprint');
|
|
726
|
+
else if (base !== undefined && url === undefined)
|
|
727
|
+
this.set('URL', base + eprint, 'eprint');
|
|
728
|
+
else if (base !== undefined)
|
|
729
|
+
this.used.add('eprint');
|
|
730
|
+
this.used.add('eprinttype');
|
|
731
|
+
}
|
|
732
|
+
for (const [field, variable] of [
|
|
733
|
+
['doi', 'DOI'],
|
|
734
|
+
['isbn', 'ISBN'],
|
|
735
|
+
['issn', 'ISSN'],
|
|
736
|
+
['pmid', 'PMID'],
|
|
737
|
+
['pmcid', 'PMCID'],
|
|
738
|
+
]) {
|
|
739
|
+
const value = this.raw(field);
|
|
740
|
+
if (value !== undefined)
|
|
741
|
+
this.set(variable, value, field);
|
|
742
|
+
}
|
|
743
|
+
if (this.has('library'))
|
|
744
|
+
this.set('call-number', this.text('library'), 'library');
|
|
745
|
+
if (this.has('shorthand'))
|
|
746
|
+
this.set('citation-label', this.text('shorthand'), 'shorthand');
|
|
747
|
+
}
|
|
748
|
+
notes() {
|
|
749
|
+
const notes = ['note', ...(this.variant === 'biblatex' ? ['addendum'] : [])].filter((f) => this.has(f)).map((f) => this.text(f));
|
|
750
|
+
this.used.add('note');
|
|
751
|
+
if (notes.length > 0)
|
|
752
|
+
this.out.note = notes.reduce((a, b) => join(a, b, '.'));
|
|
753
|
+
if (this.has('annotation'))
|
|
754
|
+
this.set('annote', this.text('annotation'), 'annotation');
|
|
755
|
+
if (this.has('abstract'))
|
|
756
|
+
this.set('abstract', this.text('abstract'), 'abstract');
|
|
757
|
+
if (this.has('keywords'))
|
|
758
|
+
this.set('keyword', this.text('keywords'), 'keywords');
|
|
759
|
+
if (this.has('pubstate')) {
|
|
760
|
+
const state = this.raw('pubstate');
|
|
761
|
+
this.out.status = KEYS[state.toLowerCase()] ?? this.text('pubstate');
|
|
762
|
+
this.used.add('pubstate');
|
|
763
|
+
}
|
|
764
|
+
const langid = this.raw('langid')?.toLowerCase();
|
|
765
|
+
const language = this.has('language') ? splitNames(this.raw('language'))[0]?.toLowerCase() : undefined;
|
|
766
|
+
if (langid !== undefined)
|
|
767
|
+
this.set('language', LANGUAGES[langid] ?? langid, 'langid');
|
|
768
|
+
else if (language !== undefined)
|
|
769
|
+
this.out.language = LANGUAGES[language.replace(/^lang/, '')] ?? this.text('language');
|
|
770
|
+
this.used.add('language');
|
|
771
|
+
}
|
|
772
|
+
/** Every field this entry has that no CSL variable took. */
|
|
773
|
+
unmapped() {
|
|
774
|
+
for (const [name, field] of this.entry.fields) {
|
|
775
|
+
if (this.used.has(name) || IGNORED.has(name) || name.startsWith('bdsk-') || field.value.trim() === '')
|
|
776
|
+
continue;
|
|
777
|
+
this.problems.add('warning', 'unmapped-field', `${this.entry.key}'s ${name} field has no CSL variable, so no style shows it`, field);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
// Helpers.
|
|
781
|
+
field(name) {
|
|
782
|
+
const f = this.entry.fields.get(name);
|
|
783
|
+
return f === undefined || f.value.trim() === '' ? undefined : f;
|
|
784
|
+
}
|
|
785
|
+
has(name) {
|
|
786
|
+
return this.field(name) !== undefined;
|
|
787
|
+
}
|
|
788
|
+
/** A field's value as written, for verbatim fields: URLs, DOIs, keys. */
|
|
789
|
+
raw(name) {
|
|
790
|
+
return this.field(name)?.value.trim().replace(/\s+/g, ' ');
|
|
791
|
+
}
|
|
792
|
+
/** A field's value as text. */
|
|
793
|
+
text(name) {
|
|
794
|
+
const f = this.field(name);
|
|
795
|
+
this.used.add(name);
|
|
796
|
+
return latexToText(f.value, { protectCase: TITLE_FIELDS.test(name), onUnknownCommand: (cmd) => this.unknownCommand(cmd, f) });
|
|
797
|
+
}
|
|
798
|
+
/** A number field's text, its ranges written with a hyphen, as CSL reads them: `20-21`. */
|
|
799
|
+
number(name) {
|
|
800
|
+
return this.text(name).replace(/[–—]/g, '-');
|
|
801
|
+
}
|
|
802
|
+
/** A literal list's names joined, as Pandoc joins them: `Leiden; Boston`. */
|
|
803
|
+
list(name) {
|
|
804
|
+
const f = this.field(name);
|
|
805
|
+
this.used.add(name);
|
|
806
|
+
if (this.variant === 'bibtex')
|
|
807
|
+
return this.text(name);
|
|
808
|
+
return splitNames(f.value)
|
|
809
|
+
.map((part) => (part.toLowerCase() === 'others' ? 'et al.' : latexToText(part, { onUnknownCommand: (cmd) => this.unknownCommand(cmd, f) })))
|
|
810
|
+
.join('; ');
|
|
811
|
+
}
|
|
812
|
+
set(variable, value, field) {
|
|
813
|
+
this.used.add(field);
|
|
814
|
+
if (value !== '')
|
|
815
|
+
this.out[variable] = value;
|
|
816
|
+
}
|
|
817
|
+
custom(key, value, field) {
|
|
818
|
+
this.used.add(field);
|
|
819
|
+
this.out.custom = { ...this.out.custom, [key]: value };
|
|
820
|
+
}
|
|
821
|
+
unknownCommand(cmd, field) {
|
|
822
|
+
this.problems.add('warning', 'unknown-command', `\\${cmd} in ${this.entry.key}'s ${field.name} isn't a LaTeX command the reader knows; its argument is kept as text`, field);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
const EPRINTS = {
|
|
826
|
+
arxiv: 'https://arxiv.org/abs/',
|
|
827
|
+
jstor: 'https://www.jstor.org/stable/',
|
|
828
|
+
pubmed: 'https://www.ncbi.nlm.nih.gov/pubmed/',
|
|
829
|
+
googlebooks: 'https://books.google.com?id=',
|
|
830
|
+
hdl: 'https://hdl.handle.net/',
|
|
831
|
+
};
|
|
832
|
+
/** Joins two parts with a separator and a space, or just a space after a full stop, question or exclamation mark. */
|
|
833
|
+
function join(a, b, sep) {
|
|
834
|
+
const last = a.replace(/(<\/[a-z]+>)+$/, '').slice(-1);
|
|
835
|
+
return /[.?!:;]/.test(last) || last === sep ? `${a} ${b}` : `${a}${sep} ${b}`;
|
|
836
|
+
}
|
|
837
|
+
/** A comma-separated list of keys. */
|
|
838
|
+
function splitList(value) {
|
|
839
|
+
return value
|
|
840
|
+
.split(',')
|
|
841
|
+
.map((s) => s.trim())
|
|
842
|
+
.filter((s) => s !== '');
|
|
843
|
+
}
|
|
844
|
+
function ordinal(n) {
|
|
845
|
+
const tens = n % 100;
|
|
846
|
+
const suffix = tens >= 11 && tens <= 13 ? 'th' : (['th', 'st', 'nd', 'rd'][n % 10] ?? 'th');
|
|
847
|
+
return `${n}${suffix}`;
|
|
848
|
+
}
|
|
849
|
+
//# sourceMappingURL=biblatex.js.map
|