paperlint 7.2.0 → 9.0.0
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/CLAUDE.md +9 -25
- package/CONTRIBUTING.md +5 -4
- package/README.md +4 -3
- package/dist/adapters/bibtex/index.d.ts +3 -0
- package/dist/adapters/bibtex/index.d.ts.map +1 -0
- package/dist/adapters/bibtex/index.js +103 -0
- package/dist/adapters/bibtex/index.js.map +1 -0
- package/dist/adapters/latex/filecontents.d.ts +33 -0
- package/dist/adapters/latex/filecontents.d.ts.map +1 -0
- package/dist/adapters/latex/filecontents.js +65 -0
- package/dist/adapters/latex/filecontents.js.map +1 -0
- package/dist/adapters/latex/includes.d.ts +3 -3
- package/dist/adapters/latex/includes.d.ts.map +1 -1
- package/dist/adapters/latex/includes.js +18 -10
- package/dist/adapters/latex/includes.js.map +1 -1
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +2 -0
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/nodes.d.ts +12 -0
- package/dist/adapters/latex/nodes.d.ts.map +1 -1
- package/dist/adapters/latex/nodes.js +39 -0
- package/dist/adapters/latex/nodes.js.map +1 -1
- package/dist/adapters/latex/parse.d.ts +7 -1
- package/dist/adapters/latex/parse.d.ts.map +1 -1
- package/dist/adapters/latex/parse.js +55 -6
- package/dist/adapters/latex/parse.js.map +1 -1
- package/dist/adapters/memory/index.d.ts +3 -0
- package/dist/adapters/memory/index.d.ts.map +1 -1
- package/dist/adapters/memory/index.js +9 -0
- package/dist/adapters/memory/index.js.map +1 -1
- package/dist/adapters/references/index.d.ts.map +1 -1
- package/dist/adapters/references/index.js +27 -24
- package/dist/adapters/references/index.js.map +1 -1
- package/dist/adapters/sources-record/index.d.ts +9 -0
- package/dist/adapters/sources-record/index.d.ts.map +1 -0
- package/dist/adapters/sources-record/index.js +68 -0
- package/dist/adapters/sources-record/index.js.map +1 -0
- package/dist/adapters/tex-output/blg.d.ts +9 -0
- package/dist/adapters/tex-output/blg.d.ts.map +1 -0
- package/dist/adapters/tex-output/blg.js +20 -0
- package/dist/adapters/tex-output/blg.js.map +1 -0
- package/dist/adapters/tex-output/fls.d.ts +8 -0
- package/dist/adapters/tex-output/fls.d.ts.map +1 -0
- package/dist/adapters/tex-output/fls.js +16 -0
- package/dist/adapters/tex-output/fls.js.map +1 -0
- package/dist/adapters/tex-output/index.d.ts +7 -0
- package/dist/adapters/tex-output/index.d.ts.map +1 -0
- package/dist/adapters/tex-output/index.js +7 -0
- package/dist/adapters/tex-output/index.js.map +1 -0
- package/dist/bib-rules.d.ts +47 -0
- package/dist/bib-rules.d.ts.map +1 -0
- package/dist/bib-rules.js +127 -0
- package/dist/bib-rules.js.map +1 -0
- package/dist/build.d.ts +29 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +41 -30
- package/dist/build.js.map +1 -1
- package/dist/claim-provenance.d.ts +2 -2
- package/dist/cli.d.ts +9 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +43 -68
- package/dist/cli.js.map +1 -1
- package/dist/domain/paper-source.d.ts +1 -10
- package/dist/domain/paper-source.d.ts.map +1 -1
- package/dist/domain/paper-source.js +34 -24
- package/dist/domain/paper-source.js.map +1 -1
- package/dist/domain/paper-sources.d.ts +72 -0
- package/dist/domain/paper-sources.d.ts.map +1 -0
- package/dist/domain/paper-sources.js +18 -0
- package/dist/domain/paper-sources.js.map +1 -0
- package/dist/domain/sources-record.d.ts +102 -0
- package/dist/domain/sources-record.d.ts.map +1 -0
- package/dist/domain/sources-record.js +38 -0
- package/dist/domain/sources-record.js.map +1 -0
- package/dist/domain/tex-run.d.ts +25 -0
- package/dist/domain/tex-run.d.ts.map +1 -0
- package/dist/domain/tex-run.js +79 -0
- package/dist/domain/tex-run.js.map +1 -0
- package/dist/eslint-rules/latex-language.d.ts.map +1 -1
- package/dist/eslint-rules/latex-language.js +10 -13
- package/dist/eslint-rules/latex-language.js.map +1 -1
- package/dist/eslint-rules/paper-context.d.ts.map +1 -1
- package/dist/eslint-rules/paper-context.js +6 -5
- package/dist/eslint-rules/paper-context.js.map +1 -1
- package/dist/eslint-rules/paper-typography.d.ts +0 -9
- package/dist/eslint-rules/paper-typography.d.ts.map +1 -1
- package/dist/eslint-rules/paper-typography.js +34 -96
- package/dist/eslint-rules/paper-typography.js.map +1 -1
- package/dist/eslint-rules/papers.d.ts +1 -3
- package/dist/eslint-rules/papers.d.ts.map +1 -1
- package/dist/eslint-rules/papers.js +2 -4
- package/dist/eslint-rules/papers.js.map +1 -1
- package/dist/eslint-rules/tex-build.d.ts.map +1 -1
- package/dist/eslint-rules/tex-build.js +8 -25
- package/dist/eslint-rules/tex-build.js.map +1 -1
- package/dist/init.d.ts +1 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +3 -9
- package/dist/init.js.map +1 -1
- package/dist/latex-log.d.ts +10 -0
- package/dist/latex-log.d.ts.map +1 -1
- package/dist/latex-log.js +10 -0
- package/dist/latex-log.js.map +1 -1
- package/dist/latex-loop.d.ts +2 -0
- package/dist/latex-loop.d.ts.map +1 -1
- package/dist/latex-loop.js.map +1 -1
- package/dist/lib/markdown.d.ts +5 -81
- package/dist/lib/markdown.d.ts.map +1 -1
- package/dist/lib/markdown.js +5 -116
- package/dist/lib/markdown.js.map +1 -1
- package/dist/lib/paper-config.d.ts.map +1 -1
- package/dist/lib/paper-config.js +0 -2
- package/dist/lib/paper-config.js.map +1 -1
- package/dist/lib/skill-eval-fixture.d.ts +6 -4
- package/dist/lib/skill-eval-fixture.d.ts.map +1 -1
- package/dist/lib/skill-eval-fixture.js +25 -18
- package/dist/lib/skill-eval-fixture.js.map +1 -1
- package/dist/new-paper.d.ts +5 -11
- package/dist/new-paper.d.ts.map +1 -1
- package/dist/new-paper.js +12 -23
- package/dist/new-paper.js.map +1 -1
- package/dist/package-dirs.d.ts.map +1 -1
- package/dist/package-dirs.js +3 -2
- package/dist/package-dirs.js.map +1 -1
- package/dist/paper-files.d.ts +4 -4
- package/dist/paper-includes.d.ts +4 -7
- package/dist/paper-includes.d.ts.map +1 -1
- package/dist/paper-includes.js +29 -21
- package/dist/paper-includes.js.map +1 -1
- package/dist/paper-prose.d.ts +17 -0
- package/dist/paper-prose.d.ts.map +1 -0
- package/dist/paper-prose.js +46 -0
- package/dist/paper-prose.js.map +1 -0
- package/dist/paper-record.d.ts +25 -0
- package/dist/paper-record.d.ts.map +1 -0
- package/dist/paper-record.js +39 -0
- package/dist/paper-record.js.map +1 -0
- package/dist/paper-sources.d.ts +66 -0
- package/dist/paper-sources.d.ts.map +1 -0
- package/dist/paper-sources.js +92 -0
- package/dist/paper-sources.js.map +1 -0
- package/dist/ports/bib-reader.d.ts +18 -0
- package/dist/ports/bib-reader.d.ts.map +1 -0
- package/dist/ports/bib-reader.js +2 -0
- package/dist/ports/bib-reader.js.map +1 -0
- package/dist/ports/check-references.d.ts +9 -4
- package/dist/ports/check-references.d.ts.map +1 -1
- package/dist/ports/latex.d.ts +15 -0
- package/dist/ports/latex.d.ts.map +1 -1
- package/dist/ports/sources-codec.d.ts +11 -0
- package/dist/ports/sources-codec.d.ts.map +1 -0
- package/dist/ports/sources-codec.js +2 -0
- package/dist/ports/sources-codec.js.map +1 -0
- package/dist/ports/tex-output.d.ts +17 -0
- package/dist/ports/tex-output.d.ts.map +1 -0
- package/dist/ports/tex-output.js +2 -0
- package/dist/ports/tex-output.js.map +1 -0
- package/dist/recorded-bibliography.d.ts +89 -0
- package/dist/recorded-bibliography.d.ts.map +1 -0
- package/dist/recorded-bibliography.js +136 -0
- package/dist/recorded-bibliography.js.map +1 -0
- package/dist/reference-rules.d.ts +5 -5
- package/dist/reference-rules.d.ts.map +1 -1
- package/dist/reference-rules.js +150 -77
- package/dist/reference-rules.js.map +1 -1
- package/dist/references.d.ts +71 -16
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +110 -26
- package/dist/references.js.map +1 -1
- package/dist/register-bands.d.ts +3 -3
- package/dist/register-bands.d.ts.map +1 -1
- package/dist/register-bands.js.map +1 -1
- package/dist/register.d.ts +2 -2
- package/dist/sources-record.d.ts +38 -0
- package/dist/sources-record.d.ts.map +1 -0
- package/dist/sources-record.js +123 -0
- package/dist/sources-record.js.map +1 -0
- package/dist/sources-rules.d.ts +44 -0
- package/dist/sources-rules.d.ts.map +1 -0
- package/dist/sources-rules.js +76 -0
- package/dist/sources-rules.js.map +1 -0
- package/dist/structure.d.ts.map +1 -1
- package/dist/structure.js +4 -3
- package/dist/structure.js.map +1 -1
- package/dist/tex-paper.d.ts +10 -15
- package/dist/tex-paper.d.ts.map +1 -1
- package/dist/tex-paper.js +24 -40
- package/dist/tex-paper.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +3 -3
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js.map +1 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +1 -1
- package/docs/configuration.md +18 -12
- package/docs/design/paper-sources.md +197 -0
- package/docs/e2e.md +4 -6
- package/docs/package-shape-options.md +1 -1
- package/docs/prior-art/paper-folder-scaffolding.md +24 -29
- package/docs/references.md +34 -8
- package/docs/rules/bib/reachable-entry.md +64 -0
- package/docs/rules/paper/sources-fresh.md +81 -0
- package/docs/rules/tex/claim-provenance.md +0 -1
- package/docs/rules.md +62 -61
- package/eslint-rules/latex-language.harness.mjs +3 -3
- package/eslint-rules/latex-language.ts +10 -13
- package/eslint-rules/paper-context.ts +6 -5
- package/eslint-rules/paper-typography.test.mjs +29 -157
- package/eslint-rules/paper-typography.ts +35 -104
- package/eslint-rules/papers.harness.mjs +1 -1
- package/eslint-rules/papers.ts +2 -4
- package/eslint-rules/tex-build.harness.mjs +2 -2
- package/eslint-rules/tex-build.ts +8 -25
- package/eslint.config.mjs +22 -1
- package/fixtures/build-e2e/aidc/paper.tex +1 -1
- package/fixtures/build-e2e/anon-ack/paper.tex +1 -1
- package/fixtures/build-e2e/anon-author/paper.tex +1 -1
- package/fixtures/build-e2e/anon-bib/paper.tex +1 -1
- package/fixtures/build-e2e/anon-href/paper.tex +1 -1
- package/fixtures/build-e2e/anon-macro/paper.tex +1 -1
- package/fixtures/build-e2e/anon-pdfauthor/paper.tex +1 -1
- package/fixtures/paper-sources/p1/paper.tex +30 -0
- package/fixtures/paper-sources/p1/refs.bib +6 -0
- package/fixtures/paper-sources/p1/sections/dead.tex +6 -0
- package/fixtures/paper-sources/p1/sections/intro.tex +7 -0
- package/fixtures/paper-sources/p1/sections/parked.tex +6 -0
- package/fixtures/paper-sources/p1/tex-truth.json +37 -0
- package/fixtures/paper-sources/p1/versions/2026-01-01-review.tex +4 -0
- package/fixtures/paper-sources/v1-stale/paper.tex +14 -0
- package/fixtures/paper-sources/v1-stale/refs.bib +6 -0
- package/fixtures/paper-sources/v1-stale/tex-truth.json +32 -0
- package/fixtures/paper-sources/v10-ifthenelse/anon.bib +1 -0
- package/fixtures/paper-sources/v10-ifthenelse/paper.tex +9 -0
- package/fixtures/paper-sources/v10-ifthenelse/real.bib +1 -0
- package/fixtures/paper-sources/v10-ifthenelse/tex-truth.json +28 -0
- package/fixtures/paper-sources/v11-two-blocks/paper.tex +12 -0
- package/fixtures/paper-sources/v11-two-blocks/tex-truth.json +30 -0
- package/fixtures/paper-sources/v13-percent-text/paper.tex +6 -0
- package/fixtures/paper-sources/v13-percent-text/refs.bib +3 -0
- package/fixtures/paper-sources/v13-percent-text/tex-truth.json +30 -0
- package/fixtures/paper-sources/v15-after-end/paper.tex +6 -0
- package/fixtures/paper-sources/v15-after-end/refs.bib +1 -0
- package/fixtures/paper-sources/v15-after-end/tex-truth.json +17 -0
- package/fixtures/paper-sources/v16-included-block/bibblock.tex +3 -0
- package/fixtures/paper-sources/v16-included-block/paper.tex +7 -0
- package/fixtures/paper-sources/v16-included-block/refs.bib +1 -0
- package/fixtures/paper-sources/v16-included-block/tex-truth.json +35 -0
- package/fixtures/paper-sources/v17-include-order/bibsetup.tex +1 -0
- package/fixtures/paper-sources/v17-include-order/first.bib +1 -0
- package/fixtures/paper-sources/v17-include-order/later.bib +1 -0
- package/fixtures/paper-sources/v17-include-order/paper.tex +7 -0
- package/fixtures/paper-sources/v17-include-order/tex-truth.json +40 -0
- package/fixtures/paper-sources/v2-overwrite/paper.tex +14 -0
- package/fixtures/paper-sources/v2-overwrite/refs.bib +6 -0
- package/fixtures/paper-sources/v2-overwrite/tex-truth.json +30 -0
- package/fixtures/paper-sources/v22-parked-thebibliography/paper.tex +7 -0
- package/fixtures/paper-sources/v22-parked-thebibliography/tex-truth.json +17 -0
- package/fixtures/paper-sources/v23-parked-include/old.bib +1 -0
- package/fixtures/paper-sources/v23-parked-include/paper.tex +7 -0
- package/fixtures/paper-sources/v23-parked-include/parked.tex +1 -0
- package/fixtures/paper-sources/v23-parked-include/refs.bib +1 -0
- package/fixtures/paper-sources/v23-parked-include/tex-truth.json +28 -0
- package/fixtures/paper-sources/v24-quoted-fields/paper.tex +6 -0
- package/fixtures/paper-sources/v24-quoted-fields/refs.bib +5 -0
- package/fixtures/paper-sources/v24-quoted-fields/tex-truth.json +32 -0
- package/fixtures/paper-sources/v25-string-differs/paper.tex +10 -0
- package/fixtures/paper-sources/v25-string-differs/refs.bib +2 -0
- package/fixtures/paper-sources/v25-string-differs/tex-truth.json +32 -0
- package/fixtures/paper-sources/v26-comment-in-names/one.bib +1 -0
- package/fixtures/paper-sources/v26-comment-in-names/paper.tex +7 -0
- package/fixtures/paper-sources/v26-comment-in-names/tex-truth.json +32 -0
- package/fixtures/paper-sources/v26-comment-in-names/two.bib +1 -0
- package/fixtures/paper-sources/v27-shared-string/abbreviations.bib +2 -0
- package/fixtures/paper-sources/v27-shared-string/paper.tex +6 -0
- package/fixtures/paper-sources/v27-shared-string/references.bib +6 -0
- package/fixtures/paper-sources/v27-shared-string/tex-truth.json +31 -0
- package/fixtures/paper-sources/v28-shared-string-block/abbreviations.bib +2 -0
- package/fixtures/paper-sources/v28-shared-string-block/paper.tex +14 -0
- package/fixtures/paper-sources/v28-shared-string-block/tex-truth.json +33 -0
- package/fixtures/paper-sources/v29-generated-input/paper.tex +9 -0
- package/fixtures/paper-sources/v29-generated-input/tex-truth.json +24 -0
- package/fixtures/paper-sources/v3-declared/paper.bib +6 -0
- package/fixtures/paper-sources/v3-declared/paper.tex +6 -0
- package/fixtures/paper-sources/v3-declared/tex-truth.json +28 -0
- package/fixtures/paper-sources/v30-name-next-line/paper.tex +14 -0
- package/fixtures/paper-sources/v30-name-next-line/tex-truth.json +30 -0
- package/fixtures/paper-sources/v4-commented/paper.tex +14 -0
- package/fixtures/paper-sources/v4-commented/refs.bib +6 -0
- package/fixtures/paper-sources/v4-commented/tex-truth.json +28 -0
- package/fixtures/paper-sources/v5-percent-entry/paper.tex +20 -0
- package/fixtures/paper-sources/v5-percent-entry/tex-truth.json +37 -0
- package/fixtures/paper-sources/v6-unclosed/paper.tex +6 -0
- package/fixtures/paper-sources/v6-unclosed/refs.bib +5 -0
- package/fixtures/paper-sources/v6-unclosed/tex-truth.json +37 -0
- package/fixtures/paper-sources/v8-jobname/paper.tex +9 -0
- package/fixtures/paper-sources/v8-jobname/tex-truth.json +30 -0
- package/fixtures/paper-sources/v9-two-bibliographies/one.bib +1 -0
- package/fixtures/paper-sources/v9-two-bibliographies/paper.tex +7 -0
- package/fixtures/paper-sources/v9-two-bibliographies/tex-truth.json +35 -0
- package/fixtures/paper-sources/v9-two-bibliographies/two.bib +1 -0
- package/fixtures/paper-typography/clean-paper/paper.tex +1 -1
- package/fixtures/paper-typography/messy-paper/paper.tex +1 -1
- package/hooks/hooks.harness.ts +15 -15
- package/hooks/paper-edit-guard.hook.mjs +5 -8
- package/hooks/paper-edit-guard.test.ts +12 -3
- package/hooks/paper-skills-nudge.hook.mjs +2 -3
- package/hooks/paper-skills-nudge.test.ts +13 -3
- package/hooks/paper-status-gates.hook.mjs +2 -2
- package/hooks/paper-status-gates.test.ts +14 -2
- package/lib/markdown.test.mjs +5 -60
- package/lib/markdown.ts +9 -136
- package/lib/paper-config.ts +0 -2
- package/lib/skill-checks.test.mjs +4 -1
- package/lib/skill-eval-fixture.ts +25 -18
- package/package.json +2 -12
- package/presets/realm.jsonc +1 -1
- package/scripts/check.test.ts +23 -1
- package/scripts/check.ts +7 -3
- package/scripts/coverage-config.test.ts +19 -10
- package/scripts/harness-api.frozen.json +0 -5
- package/scripts/layer-legacy-frozen.test.ts +41 -2
- package/scripts/layer-legacy-frozen.ts +31 -2
- package/skills/cold-read-diff/SKILL.md +3 -3
- package/skills/cold-read-diff/SKILL.md.spec.ts +2 -2
- package/skills/grade-paper-writing/SKILL.md +15 -22
- package/skills/grade-paper-writing/SKILL.md.spec.ts +14 -21
- package/skills/grade-paper-writing/__snapshots__/prose-lint.test.ts.snap +40 -26
- package/skills/grade-paper-writing/prose-lint.mjs +117 -278
- package/skills/grade-paper-writing/prose-lint.test.ts +230 -79
- package/skills/paper-adversarial-review/SKILL.md +2 -2
- package/skills/paper-adversarial-review/SKILL.md.spec.ts +1 -1
- package/skills/paper-pipeline/SKILL.md +9 -12
- package/skills/paper-pipeline/SKILL.md.spec.ts +8 -11
- package/skills/paper-pipeline/description-language.eval.mjs +25 -15
- package/skills/paper-pipeline/framing-vs-vocabulary.eval.mjs +25 -15
- package/skills/paper-pipeline/grade-paper-writing-ablation.eval.mjs +25 -15
- package/skills/paper-pipeline/pipeline-firing.eval.mjs +27 -16
- package/skills/paper-pipeline/pipeline-language.eval.mjs +25 -15
- package/skills/paper-pipeline/references/acceptance-gate.md +16 -20
- package/skills/paper-pipeline/references/artifact-checklist.md +4 -5
- package/skills/paper-pipeline/references/pipeline-status-template.md +1 -1
- package/skills/paper-pipeline/scripts/README.md +0 -4
- package/skills/paper-pipeline/scripts/extract-ref-facts.harness.mjs +91 -105
- package/skills/paper-pipeline/scripts/extract-ref-facts.mjs +85 -241
- package/skills/paper-pipeline/scripts/extract-ref-facts.test.mjs +166 -153
- package/skills/paper-pipeline/scripts/generated-code.harness.mjs +3 -3
- package/skills/paper-status/SKILL.md +2 -2
- package/skills/paper-status/SKILL.md.spec.ts +1 -1
- package/skills/render-paper/SKILL.md +2 -2
- package/skills/render-paper/SKILL.md.spec.ts +1 -1
- package/skills/render-paper/extract-pdf-facts.mjs +2 -2
- package/skills/tighten-paper/SKILL.md +29 -42
- package/skills/tighten-paper/SKILL.md.spec.ts +28 -41
- package/skills/verify-citations/SKILL.md +7 -4
- package/skills/verify-citations/SKILL.md.spec.ts +6 -3
- package/skills/verify-citations/scripts/bib-authors.check.test.mjs +17 -32
- package/skills/verify-citations/scripts/bib-authors.cli.test.ts +138 -43
- package/skills/verify-citations/scripts/bib-authors.d.mts +22 -2
- package/skills/verify-citations/scripts/bib-authors.mjs +54 -193
- package/skills/verify-citations/scripts/bib-authors.test.mjs +1 -44
- package/skills/verify-citations/scripts/verify-cites.cli.test.ts +16 -0
- package/skills/verify-citations/scripts/verify-cites.d.mts +19 -3
- package/skills/verify-citations/scripts/verify-cites.mjs +42 -108
- package/skills/verify-citations/scripts/verify-cites.test.mjs +23 -36
- package/src/adapters/bibtex/index.test.ts +163 -0
- package/src/adapters/bibtex/index.ts +155 -0
- package/src/adapters/latex/filecontents.ts +114 -0
- package/src/adapters/latex/includes.ts +18 -10
- package/src/adapters/latex/index.test.ts +73 -0
- package/src/adapters/latex/index.ts +2 -0
- package/src/adapters/latex/nodes.ts +64 -0
- package/src/adapters/latex/parse.test.ts +38 -0
- package/src/adapters/latex/parse.ts +67 -6
- package/src/adapters/memory/index.ts +17 -0
- package/src/adapters/references/index.test.ts +75 -21
- package/src/adapters/references/index.ts +37 -32
- package/src/adapters/sources-record/index.test.ts +87 -0
- package/src/adapters/sources-record/index.ts +82 -0
- package/src/adapters/tex-output/blg.ts +27 -0
- package/src/adapters/tex-output/fls.ts +24 -0
- package/src/adapters/tex-output/index.test.ts +171 -0
- package/src/adapters/tex-output/index.ts +12 -0
- package/src/bib-rules.test.ts +356 -0
- package/src/bib-rules.ts +228 -0
- package/src/bibliography-at.test.ts +286 -0
- package/src/build.harness.mjs +2 -2
- package/src/build.test.ts +211 -1
- package/src/build.ts +101 -41
- package/src/claim-provenance.test.ts +33 -7
- package/src/claim-provenance.ts +2 -2
- package/src/cli.harness.mjs +46 -56
- package/src/cli.test.ts +44 -48
- package/src/cli.ts +51 -82
- package/src/domain/paper-source.test.ts +58 -20
- package/src/domain/paper-source.ts +38 -42
- package/src/domain/paper-sources.ts +94 -0
- package/src/domain/sources-record.test.ts +71 -0
- package/src/domain/sources-record.ts +136 -0
- package/src/domain/tex-run.test.ts +228 -0
- package/src/domain/tex-run.ts +139 -0
- package/src/folder-venue-rule.test.ts +1 -1
- package/src/heading-case.test.ts +24 -10
- package/src/init.test.ts +6 -7
- package/src/init.ts +3 -22
- package/src/latex-log.ts +20 -0
- package/src/latex-loop.harness.ts +1 -0
- package/src/latex-loop.ts +2 -0
- package/src/lint-fix.test.ts +10 -4
- package/src/linted-set.test.ts +9 -1
- package/src/new-paper.harness.mjs +12 -30
- package/src/new-paper.test.ts +15 -11
- package/src/new-paper.ts +11 -30
- package/src/package-dirs.ts +3 -2
- package/src/paper-files.test.ts +5 -4
- package/src/paper-files.ts +4 -4
- package/src/paper-includes.test.ts +157 -38
- package/src/paper-includes.ts +39 -35
- package/src/paper-prose.test.ts +78 -0
- package/src/paper-prose.ts +67 -0
- package/src/paper-record.test.ts +173 -0
- package/src/paper-record.ts +66 -0
- package/src/paper-settings-commands.test.ts +5 -2
- package/src/paper-sources.ts +151 -0
- package/src/parse-args.test.ts +0 -1
- package/src/ports/bib-reader.ts +27 -0
- package/src/ports/check-references.ts +7 -3
- package/src/ports/latex.ts +19 -0
- package/src/ports/sources-codec.ts +11 -0
- package/src/ports/tex-output.ts +17 -0
- package/src/recorded-bibliography.ts +297 -0
- package/src/reference-rules.ts +217 -104
- package/src/references.test.ts +520 -177
- package/src/references.ts +185 -37
- package/src/register-bands.test.ts +5 -1
- package/src/register-bands.ts +3 -5
- package/src/register.test.ts +6 -1
- package/src/register.ts +2 -2
- package/src/rule-cases.test.ts +68 -12
- package/src/rule-docs.test.ts +0 -1
- package/src/sources-record.test.ts +308 -0
- package/src/sources-record.ts +231 -0
- package/src/sources-rules.test.ts +152 -0
- package/src/sources-rules.ts +117 -0
- package/src/structure.harness.ts +5 -11
- package/src/structure.ts +4 -3
- package/src/tex-paper.test.ts +148 -78
- package/src/tex-paper.ts +31 -61
- package/src/tex-venue-rules.test.ts +36 -8
- package/src/tex-venue-rules.ts +3 -5
- package/src/types.ts +0 -2
- package/dist/eslint-rules/bib-reachable-entry.d.ts +0 -22
- package/dist/eslint-rules/bib-reachable-entry.d.ts.map +0 -1
- package/dist/eslint-rules/bib-reachable-entry.js +0 -75
- package/dist/eslint-rules/bib-reachable-entry.js.map +0 -1
- package/eslint-rules/bib-reachable-entry.ts +0 -76
- package/fixtures/real-markdown-paper/baseline.json +0 -22
- package/fixtures/real-markdown-paper/baseline.ts +0 -70
- package/skills/paper-pipeline/PIPELINE-MAP.md +0 -381
- package/skills/paper-pipeline/pipeline-firing.baseline.json +0 -270
- package/skills/paper-pipeline/references/sweep-2026-08-09-ideal-pipeline.md +0 -585
- package/skills/paper-pipeline/scripts/artifact-coverage.harness.mjs +0 -492
- package/skills/paper-pipeline/scripts/artifact-coverage.mjs +0 -397
- package/skills/paper-pipeline/scripts/artifact-coverage.test.ts +0 -86
- package/skills/paper-pipeline/scripts/check-provenance.mjs +0 -184
- package/skills/paper-pipeline/scripts/population-map.harness.mjs +0 -135
- package/skills/paper-pipeline/scripts/population-map.mjs +0 -188
- package/skills/paper-pipeline/scripts/population-map.test.mjs +0 -154
- package/skills/paper-pipeline/scripts/provenance.harness.mjs +0 -266
- package/skills/paper-pipeline/scripts/round-diff.harness.ts +0 -907
- package/skills/paper-pipeline/scripts/round-diff.mjs +0 -583
- package/skills/paper-pipeline/scripts/round-diff.test.mjs +0 -159
- package/skills/tighten-paper/__snapshots__/structure.test.ts.snap +0 -133
- package/skills/tighten-paper/structure.mjs +0 -364
- package/skills/tighten-paper/structure.test.ts +0 -117
- package/templates/paper/paper.md +0 -4
package/CLAUDE.md
CHANGED
|
@@ -393,33 +393,17 @@ working, not a defect, exactly as argued below.
|
|
|
393
393
|
⚠️ The consumer in this project's own base is unaffected: it declares `vigiles` itself
|
|
394
394
|
(`devDependencies: ^27.2.0`), so nothing about its tree changes.
|
|
395
395
|
|
|
396
|
-
### The `.bib` parser is
|
|
396
|
+
### The `.bib` parser is a dependency: the one bibtex reader
|
|
397
397
|
|
|
398
|
-
`@retorquere/bibtex-parser` is
|
|
399
|
-
(`
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
398
|
+
`@retorquere/bibtex-parser` is a `dependency`. It is the one reader of `.bib` text in paperlint
|
|
399
|
+
(`src/ports/bib-reader.ts`, adapter `src/adapters/bibtex/`): `recordedBibliography`, `bib/reachable-entry`,
|
|
400
|
+
the build's reference check, `extract-ref-facts` and `bib-authors` all read through it, so it can
|
|
401
|
+
no longer be opt-in. It costs about 15 MB of the install (9 MB itself, plus
|
|
402
|
+
`wink-eng-lite-web-model` and `unicode2latex`).
|
|
403
403
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
| parser moved to an optional peer as well | 149 | **39 MB** |
|
|
408
|
-
|
|
409
|
-
🔴 **`optionalDependencies` is the wrong entry and was tried first** — npm _installs_ those and
|
|
410
|
-
only tolerates failure, so the weight stays. What makes a dependency genuinely opt-in is
|
|
411
|
-
`peerDependencies` + `peerDependenciesMeta: { optional: true }`, the same pair used for `vigiles`.
|
|
412
|
-
It stays in `devDependencies` too, because this package's own harnesses parse `.bib`.
|
|
413
|
-
|
|
414
|
-
⚠️ A silent skip here would be the worst outcome: a missing checker and a passing one look
|
|
415
|
-
identical, and "the bibliography was not checked" reads as "the bibliography is fine". So the
|
|
416
|
-
absence throws, and the message carries the cure rather than the diagnosis:
|
|
417
|
-
|
|
418
|
-
```
|
|
419
|
-
parsing .bib requires @retorquere/bibtex-parser — it is declared OPTIONAL because it weighs 15 MB…
|
|
420
|
-
Install: npm i -D @retorquere/bibtex-parser
|
|
421
|
-
Why not our own regex: measured 26.08 — the regex gave 0 entries on both real files…
|
|
422
|
-
```
|
|
404
|
+
Where it reads differently from bibtex — bibtex has no comment syntax, so an entry behind `%` or
|
|
405
|
+
inside `@comment{…}` is one bibtex typesets — paperlint does not emulate bibtex: the build records
|
|
406
|
+
what bibtex read, and `paper/refs-checked` names the difference (docs/design/paper-sources.md §7).
|
|
423
407
|
|
|
424
408
|
🔴 **Therefore the pin here and the pin in the consumer move TOGETHER, in one pass.** A major
|
|
425
409
|
mismatch means a hook compiled by one version is executed by another: the stamp does not
|
package/CONTRIBUTING.md
CHANGED
|
@@ -40,10 +40,11 @@ by printing **which CI jobs it does not reproduce, and why**.
|
|
|
40
40
|
that broke the suite: the gates were run afterwards and were green, but `npm test` and the
|
|
41
41
|
install e2e were not among them, because there were eleven separate scripts and the only way
|
|
42
42
|
to run them all was from memory. A subset flag re-creates exactly that — the cheap half gets run
|
|
43
|
-
and reported as "the gates".
|
|
44
|
-
|
|
45
|
-
and
|
|
46
|
-
|
|
43
|
+
and reported as "the gates". Every gate runs with `CI=true`, as in CI, so the local check is the
|
|
44
|
+
CI check: libraries read it (typescript-eslint parses from disk in a single run; vitest refuses
|
|
45
|
+
`.only` and writes no snapshot), and the e2e tests are strict — one that finds no TeX or no pnpm
|
|
46
|
+
FAILS with what to install, as it does in CI. A test that still skips is read from vitest's JSON
|
|
47
|
+
report and listed as skipped, never counted as passed. The e2e areas also run alone: `npm run test:e2e:install`,
|
|
47
48
|
`npm run test:e2e:tex`, or both with `npm run test:e2e`.
|
|
48
49
|
|
|
49
50
|
Each gate's command is listed in `scripts/check.ts`; run one of them directly while iterating on
|
package/README.md
CHANGED
|
@@ -203,9 +203,10 @@ Every skill, by stage: [`docs/skills.md`](docs/skills.md).
|
|
|
203
203
|
asks only about new or edited entries (and answers older than 30 days), so an unchanged
|
|
204
204
|
bibliography usually builds without the network ([`docs/references.md`](docs/references.md)).
|
|
205
205
|
- A paper whose body is in other files (`\input{sections/intro}`) is linted file by file: a finding
|
|
206
|
-
lands at the file and line it is in, and `--fix` edits that file. The files are the ones
|
|
207
|
-
`
|
|
208
|
-
and not an included `.bbl` (a tool's output, read only as part of the whole paper).
|
|
206
|
+
lands at the file and line it is in, and `--fix` edits that file. The files are the ones TeX read
|
|
207
|
+
after `\begin{document}` in the last build (`_build/sources.json`) — not every `.tex` beside it,
|
|
208
|
+
and not an included `.bbl` (a tool's output, read only as part of the whole paper). A paper that
|
|
209
|
+
was not built, or changed since, is linted as `paper.tex` alone, and `paper/sources-fresh` says so.
|
|
209
210
|
- Lint also checks the pipeline's own records: `PIPELINE-STATUS.md`, reviews, notes on related
|
|
210
211
|
papers ([`docs/rules.md`](docs/rules.md)).
|
|
211
212
|
- The rules run on ESLint, so a deliberate exception is a comment on the line above:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/bibtex/index.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAkH3D,eAAO,MAAM,SAAS,EAAE,SAIvB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bibtex reader over `@retorquere/bibtex-parser` — the one `.bib` reader of paperlint
|
|
3
|
+
* (`src/ports/bib-reader.ts`).
|
|
4
|
+
*
|
|
5
|
+
* It reads a well-formed database as bibtex does: entries, fields (LaTeX read into text, so `{\"u}`
|
|
6
|
+
* is `ü` and `\url{x}` a link), name lists split into names, `@string`s expanded, `@preamble`. A
|
|
7
|
+
* second reading keeps each field as bibtex takes it, LaTeX as written: what two databases are
|
|
8
|
+
* compared by (`sameDatabase`), where `{\"u}` and `ü` must stay different. A malformed
|
|
9
|
+
* database is bibtex's to report: the build runs bibtex and fails with bibtex's own lines. The two
|
|
10
|
+
* readers also differ on one well-formed shape: bibtex has no comment syntax, so an entry behind
|
|
11
|
+
* `%` or inside `@comment{…}` is one bibtex reads and this reader does not. The build records what
|
|
12
|
+
* bibtex read, and `paper/refs-checked` names such an entry (`src/references.ts`).
|
|
13
|
+
*
|
|
14
|
+
* The parser gives each entry's text (`input`), not its place: each is found in the body in order.
|
|
15
|
+
*
|
|
16
|
+
* A database read after others starts with the `@string`s they left in force (`inherited`), as bibtex
|
|
17
|
+
* reads a paper's databases in sequence with one table of them: the parser takes them as its table of
|
|
18
|
+
* predefined `@string`s, which the database's own definitions override from where they stand. Each
|
|
19
|
+
* database is still parsed as its own text, so every entry keeps its place in the file that holds it.
|
|
20
|
+
*/
|
|
21
|
+
import { parse, } from "@retorquere/bibtex-parser";
|
|
22
|
+
/** A title as written, not sentence-cased; no field kept as raw LaTeX. */
|
|
23
|
+
const OPTIONS = { sentenceCase: false, verbatimFields: [] };
|
|
24
|
+
/**
|
|
25
|
+
* Every field as bibtex takes it: `@string`s expanded where they are used, LaTeX left as written (no
|
|
26
|
+
* conversion, no name split, no outer braces dropped).
|
|
27
|
+
*/
|
|
28
|
+
const AS_WRITTEN = {
|
|
29
|
+
raw: true,
|
|
30
|
+
sentenceCase: false,
|
|
31
|
+
verbatimFields: [/.*/],
|
|
32
|
+
removeOuterBraces: [],
|
|
33
|
+
};
|
|
34
|
+
/** A name's parts, those it has: the parser leaves the others out. */
|
|
35
|
+
const nameOf = (c) => Object.fromEntries(Object.entries({
|
|
36
|
+
lastName: c.lastName,
|
|
37
|
+
firstName: c.firstName,
|
|
38
|
+
prefix: c.prefix,
|
|
39
|
+
suffix: c.suffix,
|
|
40
|
+
name: c.name,
|
|
41
|
+
}).filter((kv) => kv[1] !== undefined));
|
|
42
|
+
const isText = (x) => typeof x === "string";
|
|
43
|
+
const isName = (x) => typeof x === "object" && x !== null;
|
|
44
|
+
/** An entry's fields and name lists, from the parser's one record of both. */
|
|
45
|
+
function fieldsOf(e) {
|
|
46
|
+
const pairs = Object.entries(e.fields);
|
|
47
|
+
const isNames = (k) => e.mode[k] === "creatorlist";
|
|
48
|
+
return {
|
|
49
|
+
// A list field (`keywords`, `publisher`) is joined as BibTeX writes it.
|
|
50
|
+
fields: Object.fromEntries(pairs
|
|
51
|
+
.filter(([k]) => !isNames(k))
|
|
52
|
+
.map(([k, v]) => [k, [v].flat().filter(isText).join(" and ")])),
|
|
53
|
+
names: Object.fromEntries(pairs
|
|
54
|
+
.filter(([k]) => isNames(k))
|
|
55
|
+
.map(([k, v]) => [k, [v].flat().filter(isName).map(nameOf)])),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** Each entry the parser read, placed in the text: found in `source` in order, `source` at `offset`. */
|
|
59
|
+
function placed(parsed, source, offset) {
|
|
60
|
+
return parsed.reduce((acc, e) => {
|
|
61
|
+
const at = source.indexOf(e.input, acc.from);
|
|
62
|
+
const end = at + e.input.length;
|
|
63
|
+
const span = { start: offset + at, end: offset + end };
|
|
64
|
+
const entry = { type: e.type.toLowerCase(), key: e.key, span };
|
|
65
|
+
return { from: end, found: [...acc.found, { ...entry, ...fieldsOf(e) }] };
|
|
66
|
+
}, { from: 0, found: [] }).found;
|
|
67
|
+
}
|
|
68
|
+
/** The entries the parser finished: one it could not keeps no text — it is malformed, and bibtex reports it. */
|
|
69
|
+
const finished = (lib) => lib.entries.filter((e) => e.input !== "");
|
|
70
|
+
/** An entry as bibtex takes it; a list field (`keywords`) as one value. */
|
|
71
|
+
const writtenOf = (e) => ({
|
|
72
|
+
type: e.type.toLowerCase(),
|
|
73
|
+
key: e.key,
|
|
74
|
+
fields: Object.fromEntries(Object.entries(e.fields).map(([k, v]) => [
|
|
75
|
+
k,
|
|
76
|
+
[v].flat().filter(isText).join(", "),
|
|
77
|
+
])),
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* The database in `body` of `text`, the text of the file at `path`, read with the `@string`s
|
|
81
|
+
* `inherited` in force. The parser is handed a copy of them: it writes into its own.
|
|
82
|
+
*/
|
|
83
|
+
function read(path, text, body, inherited = {}) {
|
|
84
|
+
const source = text.slice(body.start, body.end);
|
|
85
|
+
const lib = parse(source, { ...OPTIONS, strings: { ...inherited } });
|
|
86
|
+
const asWritten = parse(source, { ...AS_WRITTEN, strings: { ...inherited } });
|
|
87
|
+
return {
|
|
88
|
+
path,
|
|
89
|
+
text,
|
|
90
|
+
body,
|
|
91
|
+
entries: placed(finished(lib), source, body.start),
|
|
92
|
+
written: finished(asWritten).map(writtenOf),
|
|
93
|
+
preamble: lib.preamble,
|
|
94
|
+
inherited,
|
|
95
|
+
// Its own as bibtex takes them: the reading that keeps LaTeX as written.
|
|
96
|
+
strings: { ...inherited, ...asWritten.strings },
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export const bibReader = {
|
|
100
|
+
read,
|
|
101
|
+
readFile: (path, text, inherited) => read(path, text, { start: 0, end: text.length }, inherited),
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/bibtex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,KAAK,GAKN,MAAM,2BAA2B,CAAC;AAYnC,0EAA0E;AAC1E,MAAM,OAAO,GAAsB,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;AAE/E;;;GAGG;AACH,MAAM,UAAU,GAAsB;IACpC,GAAG,EAAE,IAAI;IACT,YAAY,EAAE,KAAK;IACnB,cAAc,EAAE,CAAC,IAAI,CAAC;IACtB,iBAAiB,EAAE,EAAE;CACtB,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,GAAG,CAAC,CAAoB,EAAW,EAAE,CAC/C,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC;IACb,QAAQ,EAAE,CAAC,CAAC,QAAQ;IACpB,SAAS,EAAE,CAAC,CAAC,SAAS;IACtB,MA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ACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC,IAAI;IACJ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAClC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC;CAC9D,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE `filecontents` BLOCKS OF A SOURCE — where a `.bib` TeX wrote stands in the text that wrote it.
|
|
3
|
+
* Read from the parse tree, never decided: which file a block writes, and whether TeX ran it, is
|
|
4
|
+
* TeX's answer (`written` in `_build/sources.json`); this reader only says where each block's text
|
|
5
|
+
* is, so a finding about an entry TeX read can be shown at the block that holds it
|
|
6
|
+
* (docs/design/paper-sources.md §1).
|
|
7
|
+
*
|
|
8
|
+
* unified-latex reads a `filecontents` environment as verbatim; its option and file name are the
|
|
9
|
+
* first things in that node, white space between them — a line break too: `\begin{filecontents*}` with
|
|
10
|
+
* `{refs.bib}` on the next line writes `refs.bib` (measured with pdflatex) — and its body starts on the
|
|
11
|
+
* line after the name, as LaTeX's own reader starts it.
|
|
12
|
+
* A block is live when the tree keeps it: a comment is a node of its own, `\iffalse … \fi` is cut at
|
|
13
|
+
* parse (`conditionals.ts`), and nothing after `\end{document}` is read (`liveRoot`).
|
|
14
|
+
*/
|
|
15
|
+
import type * as Ast from "@unified-latex/unified-latex-types";
|
|
16
|
+
import type { Filecontents } from "../../ports/latex.ts";
|
|
17
|
+
import { type ArgumentPiece } from "./nodes.ts";
|
|
18
|
+
import { type ParsedTex } from "./parse.ts";
|
|
19
|
+
/** Names and options as TeX reads them: off the tree, a comma between two names. */
|
|
20
|
+
type Name = readonly ArgumentPiece[];
|
|
21
|
+
/** What a name or an option is written as: its pieces joined, white space trimmed off. */
|
|
22
|
+
export declare const written: (name: Name) => string;
|
|
23
|
+
/**
|
|
24
|
+
* One verbatim `filecontents` node as a block: its name, option, and body. unified-latex reads the
|
|
25
|
+
* whole environment as verbatim, so its text is parsed on its own and the name read off that tree like
|
|
26
|
+
* a declaration's (`headOf`). The body starts on the line after the one the name ends on; what TeX
|
|
27
|
+
* ignores after the name on that line is no body.
|
|
28
|
+
*/
|
|
29
|
+
export declare function blockOf(src: string, n: Readonly<Ast.VerbatimEnvironment>, jobname: string): readonly Filecontents[];
|
|
30
|
+
/** Every live `filecontents` block of a source whose main file's name is `jobname`, in source order. */
|
|
31
|
+
export declare const filecontentsOf: (t: ParsedTex, jobname: string) => readonly Filecontents[];
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=filecontents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filecontents.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/filecontents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAML,KAAK,aAAa,EAEnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAOlE,oFAAoF;AACpF,KAAK,IAAI,GAAG,SAAS,aAAa,EAAE,CAAC;AAErC,0FAA0F;AAC1F,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,KAAG,MAI1B,CAAC;AA2BZ;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,EACpC,OAAO,EAAE,MAAM,GACd,SAAS,YAAY,EAAE,CAuBzB;AAKD,wGAAwG;AACxG,eAAO,MAAM,cAAc,GACzB,GAAG,SAAS,EACZ,SAAS,MAAM,KACd,SAAS,YAAY,EAIuB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { argumentPieces, inPlace, isNode, placeOf, visited, } from "./nodes.js";
|
|
2
|
+
import { liveRoot, parseLatex } from "./parse.js";
|
|
3
|
+
const FILECONTENTS = new Set([
|
|
4
|
+
"filecontents",
|
|
5
|
+
"filecontents*",
|
|
6
|
+
]);
|
|
7
|
+
/** What a name or an option is written as: its pieces joined, white space trimmed off. */
|
|
8
|
+
export const written = (name) => name
|
|
9
|
+
.map((p) => p.text)
|
|
10
|
+
.join("")
|
|
11
|
+
.trim();
|
|
12
|
+
/** What may stand before the name: nothing, or one `[options]` — anything else is a block with no name. */
|
|
13
|
+
const OPTION = /^(?:\[[^\]]*\])?$/;
|
|
14
|
+
/** The head of a block whose text is `text`: the first group, with only white space and an option before it. */
|
|
15
|
+
function headOf(text) {
|
|
16
|
+
const nodes = parseLatex(text).root.content;
|
|
17
|
+
const at = nodes.findIndex((x) => x.type === "group");
|
|
18
|
+
const option = written(argumentPieces(nodes.slice(0, Math.max(at, 0)), null));
|
|
19
|
+
const name = nodes[at];
|
|
20
|
+
if (name === undefined || !OPTION.test(option))
|
|
21
|
+
return null;
|
|
22
|
+
return {
|
|
23
|
+
name,
|
|
24
|
+
options: option
|
|
25
|
+
.replace(/^\[|\]$/g, "")
|
|
26
|
+
.split(",")
|
|
27
|
+
.map((o) => o.trim()),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* One verbatim `filecontents` node as a block: its name, option, and body. unified-latex reads the
|
|
32
|
+
* whole environment as verbatim, so its text is parsed on its own and the name read off that tree like
|
|
33
|
+
* a declaration's (`headOf`). The body starts on the line after the one the name ends on; what TeX
|
|
34
|
+
* ignores after the name on that line is no body.
|
|
35
|
+
*/
|
|
36
|
+
export function blockOf(src, n, jobname) {
|
|
37
|
+
return inPlace(placeOf(n), (span) => {
|
|
38
|
+
// The node runs from `\begin{env}` to past `\end{env}`.
|
|
39
|
+
const headAt = span.start + `\\begin{${n.env}}`.length;
|
|
40
|
+
const end = span.end - `\\end{${n.env}}`.length;
|
|
41
|
+
const head = headOf(src.slice(headAt, end));
|
|
42
|
+
if (head === null)
|
|
43
|
+
return [];
|
|
44
|
+
return inPlace(placeOf(head.name), (named) => {
|
|
45
|
+
const after = headAt + named.end;
|
|
46
|
+
// What TeX ignores after the name, up to the end of its line.
|
|
47
|
+
const rest = src.slice(after, end).split("\n", 1).join("");
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
writes: written(argumentPieces([head.name], jobname)),
|
|
51
|
+
overwrite: head.options.some((o) => o === "overwrite" || o === "force"),
|
|
52
|
+
span,
|
|
53
|
+
body: { start: Math.min(after + rest.length + 1, end), end },
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const isBlock = (n) => n.type === "verbatim" && FILECONTENTS.has(n.env);
|
|
60
|
+
/** Every live `filecontents` block of a source whose main file's name is `jobname`, in source order. */
|
|
61
|
+
export const filecontentsOf = (t, jobname) => visited(liveRoot(t), () => false)
|
|
62
|
+
.filter(isNode)
|
|
63
|
+
.filter(isBlock)
|
|
64
|
+
.flatMap((n) => blockOf(t.src, n, jobname));
|
|
65
|
+
//# sourceMappingURL=filecontents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filecontents.js","sourceRoot":"","sources":["../../../src/adapters/latex/filecontents.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,cAAc,EACd,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,GAGR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAkB,MAAM,YAAY,CAAC;AAElE,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IAChD,cAAc;IACd,eAAe;CAChB,CAAC,CAAC;AAKH,0FAA0F;AAC1F,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAU,EAAU,EAAE,CAC5C,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AC,MAAM,cAAc,GAAG,CAC5B,CAAY,EACZ,OAAe,EACU,EAAE,CAC3B,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;KAC9B,MAAM,CAAC,MAAM,CAAC;KACd,MAAM,CAAC,OAAO,CAAC;KACf,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Include } from "../../domain/paper-source.ts";
|
|
2
2
|
import type { Span } from "../../domain/tex-document.ts";
|
|
3
|
-
import type
|
|
3
|
+
import { type ParsedTex } from "./parse.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Every `\input`, `\include` and `\subfile` of the source, in source order — not in a comment (a
|
|
6
|
-
* comment is a node of its own)
|
|
7
|
-
* is used, and nothing here expands macros.
|
|
6
|
+
* comment is a node of its own), not in a macro definition's body, which is read where the macro
|
|
7
|
+
* is used, and nothing here expands macros; not after `\end{document}`, which TeX never reads.
|
|
8
8
|
*/
|
|
9
9
|
export declare const includesOf: (t: ParsedTex) => readonly Include[];
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAazD,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAoCtD;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,SAAS,KAAG,SAAS,OAAO,EAGU,CAAC;AAKrE;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,KAAG,IAAI,GAAG,IAWhD,CAAC"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { isDefinition } from "./hidden.js";
|
|
2
|
-
import { inPlace, isNode, macroPlace, mandatory, placeOf, visited, } from "./nodes.js";
|
|
2
|
+
import { argumentPieces, inPlace, isNode, macroPlace, mandatory, placeOf, visited, } from "./nodes.js";
|
|
3
|
+
import { liveRoot } from "./parse.js";
|
|
3
4
|
const INCLUDE_MACROS = new Map([
|
|
4
5
|
["input", "input"],
|
|
5
6
|
["include", "include"],
|
|
6
7
|
["subfile", "subfile"],
|
|
7
8
|
]);
|
|
8
9
|
/**
|
|
9
|
-
* The path an include names
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* The path an include names: its braced argument read off the tree as TeX reads it (a comment is no
|
|
11
|
+
* part of it; a macro stays as written: nothing here expands one), or — TeX's own form, `\\input name`
|
|
12
|
+
* — the name up to the next space. unified-latex gives the unbraced form an argument of the first
|
|
13
|
+
* token only (`sections` of `sections/a`), so the source is read for that one.
|
|
12
14
|
*/
|
|
13
15
|
function argumentText(src, m) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
+
const arg = mandatory(m)[0];
|
|
17
|
+
const start = arg?.content[0]?.position?.start.offset;
|
|
18
|
+
if (arg === undefined || start === undefined)
|
|
16
19
|
return null;
|
|
20
|
+
// The parser gives both forms `{` as their open mark; the source says which one was written.
|
|
21
|
+
if (src[start - 1] === "{")
|
|
22
|
+
return argumentPieces(arg.content, null)
|
|
23
|
+
.map((p) => p.text)
|
|
24
|
+
.join("");
|
|
17
25
|
const rest = src.slice(start);
|
|
18
|
-
const stop = rest.search(
|
|
26
|
+
const stop = rest.search(/[\s{}%]/u);
|
|
19
27
|
return stop < 0 ? rest : rest.slice(0, stop);
|
|
20
28
|
}
|
|
21
29
|
/** One include macro as an `Include`, or nothing when it names no file or has no place. */
|
|
@@ -28,10 +36,10 @@ function includeOf(src, m) {
|
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
30
38
|
* Every `\input`, `\include` and `\subfile` of the source, in source order — not in a comment (a
|
|
31
|
-
* comment is a node of its own)
|
|
32
|
-
* is used, and nothing here expands macros.
|
|
39
|
+
* comment is a node of its own), not in a macro definition's body, which is read where the macro
|
|
40
|
+
* is used, and nothing here expands macros; not after `\end{document}`, which TeX never reads.
|
|
33
41
|
*/
|
|
34
|
-
export const includesOf = (t) => visited(t
|
|
42
|
+
export const includesOf = (t) => visited(liveRoot(t), isDefinition)
|
|
35
43
|
.filter(isNode)
|
|
36
44
|
.flatMap((n) => (n.type === "macro" ? includeOf(t.src, n) : []));
|
|
37
45
|
const isDocument = (n) => n.type === "environment" && n.env === "document";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"includes.js","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,OAAO,GAGR,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"includes.js","sourceRoot":"","sources":["../../../src/adapters/latex/includes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,OAAO,GAGR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAkB,MAAM,YAAY,CAAC;AAEtD,MAAM,cAAc,GAA0C,IAAI,GAAG,CAAC;IACpE,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,S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G,EAAE,IAAI,CAAC,GAAG,EAAE,EAC7D,IAAI,CACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAexD,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,mFAAmF;AACnF,eAAO,MAAM,WAAW,EAAE,WAazB,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { parseLatex } from "./parse.js";
|
|
|
6
6
|
import { bodyEmphasis, bodyProse } from "./prose.js";
|
|
7
7
|
import { renderedRuns } from "./rendered.js";
|
|
8
8
|
import { layoutOverridesOf } from "./layout.js";
|
|
9
|
+
import { filecontentsOf } from "./filecontents.js";
|
|
9
10
|
export { documentClassOf, parseTemplate, replaceDocumentClass, } from "./document-class.js";
|
|
10
11
|
export { collapse, inPlace, macroPlace, mandatory, optional, placeOf, textOf, } from "./nodes.js";
|
|
11
12
|
export { documentBodyOf, includesOf } from "./includes.js";
|
|
@@ -28,5 +29,6 @@ export const latexReader = {
|
|
|
28
29
|
template: parseTemplate,
|
|
29
30
|
withDocumentClass: (src, want) => replaceDocumentClass(parseLatex(src), want),
|
|
30
31
|
layoutOverrides: (src) => layoutOverridesOf(parseLatex(src)),
|
|
32
|
+
filecontents: (src, jobname) => filecontentsOf(parseLatex(src), jobname),
|
|
31
33
|
};
|
|
32
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/latex/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,c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IAC9C,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACpD,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9C,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9C,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtD,QAAQ,EAAE,aAAa;IACvB,iBAAiB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IAC7E,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5D,YAAY,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACzE,CAAC"}
|
|
@@ -55,4 +55,16 @@ export declare const isList: (v: Visited) => v is readonly (Node | Argument)[];
|
|
|
55
55
|
export declare const isArgument: (v: Visited) => v is Argument;
|
|
56
56
|
/** A node, as opposed to a node list or an argument (which visit also reports). */
|
|
57
57
|
export declare const isNode: (v: Visited) => v is Node;
|
|
58
|
+
/** A piece of an argument as TeX reads it: text, or a macro this reader leaves as written (`\x`). */
|
|
59
|
+
export interface ArgumentPiece {
|
|
60
|
+
readonly text: string;
|
|
61
|
+
readonly macro: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* An argument's nodes as TeX reads them, off the tree: a comment is no part of it, a group's braces
|
|
65
|
+
* are none, and white space is one space. `\jobname` is the main file's name when `jobname` is given;
|
|
66
|
+
* every other macro — `\jobnamebib` included, a control sequence of its own — is a piece of its own,
|
|
67
|
+
* written as it stands, and so is anything else (math, verbatim) a name cannot hold.
|
|
68
|
+
*/
|
|
69
|
+
export declare function argumentPieces(nodes: readonly Node[], jobname: string | null): readonly ArgumentPiece[];
|
|
58
70
|
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/nodes.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,4EAA4E;AAC5E,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtC,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACxC,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAE9C,uGAAuG;AACvG,UAAU,UAAU;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,KAAK,EAAE;YAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5C,QAAQ,CAAC,GAAG,EAAE;YAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3C,CAAC;CACH;AAED,uDAAuD;AACvD,eAAO,MAAM,OAAO,GAAI,GAAG,UAAU,KAAG,KAMjC,CAAC;AAER,2FAA2F;AAC3F,eAAO,MAAM,OAAO,GAAI,CAAC,EACvB,GAAG,KAAK,EACR,GAAG,CAAC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104
|
export const isArgument = (v) => !isList(v) && v.type === "argument";
|
|
105
105
|
/** A node, as opposed to a node list or an argument (which visit also reports). */
|
|
106
106
|
export const isNode = (v) => !isList(v) && v.type !== "argument" && v.type !== "root";
|
|
107
|
+
/**
|
|
108
|
+
* An argument's nodes as TeX reads them, off the tree: a comment is no part of it, a group's braces
|
|
109
|
+
* are none, and white space is one space. `\jobname` is the main file's name when `jobname` is given;
|
|
110
|
+
* every other macro — `\jobnamebib` included, a control sequence of its own — is a piece of its own,
|
|
111
|
+
* written as it stands, and so is anything else (math, verbatim) a name cannot hold.
|
|
112
|
+
*/
|
|
113
|
+
export function argumentPieces(nodes, jobname) {
|
|
114
|
+
return nodes.flatMap((n) => pieceOf(n, jobname));
|
|
115
|
+
}
|
|
116
|
+
const NAMELESS = new Set([
|
|
117
|
+
"root",
|
|
118
|
+
"environment",
|
|
119
|
+
"mathenv",
|
|
120
|
+
"inlinemath",
|
|
121
|
+
"displaymath",
|
|
122
|
+
"verb",
|
|
123
|
+
"verbatim",
|
|
124
|
+
]);
|
|
125
|
+
const isNameless = (n) => NAMELESS.has(n.type);
|
|
126
|
+
/** One node of an argument as `argumentPieces` reads it. */
|
|
127
|
+
function pieceOf(n, jobname) {
|
|
128
|
+
if (isNameless(n))
|
|
129
|
+
return [{ text: `\\${n.type}`, macro: true }];
|
|
130
|
+
switch (n.type) {
|
|
131
|
+
case "comment":
|
|
132
|
+
return [];
|
|
133
|
+
case "string":
|
|
134
|
+
return [{ text: n.content, macro: false }];
|
|
135
|
+
case "whitespace":
|
|
136
|
+
case "parbreak":
|
|
137
|
+
return [{ text: " ", macro: false }];
|
|
138
|
+
case "group":
|
|
139
|
+
return argumentPieces(n.content, jobname);
|
|
140
|
+
case "macro":
|
|
141
|
+
return n.content === "jobname" && jobname !== null
|
|
142
|
+
? [{ text: jobname, macro: false }]
|
|
143
|
+
: [{ text: `\\${n.content}`, macro: true }];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
107
146
|
//# sourceM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ACX,CAAC,CAAC;AACH,MAAM,UAAU,GAAG,CAAC,CAAO,EAAiB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAEpE,4DAA4D;AAC5D,SAAS,OAAO,CAAC,CAAO,EAAE,OAAsB;IAC9C,IAAI,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QACZ,KAAK,QAAQ;YACX,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7C,KAAK,YAAY,CAAC;QAClB,KAAK,UAAU;YACb,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACvC,KAAK,OAAO;YACV,OAAO,cAAc,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5C,KAAK,OAAO;YACV,OAAO,CAAC,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI;gBAChD,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;gBACnC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
|
|
@@ -37,6 +37,12 @@ export interface ParsedTex {
|
|
|
37
37
|
readonly [PARSED]: true;
|
|
38
38
|
}
|
|
39
39
|
/** A LaTeX source → its tree, without the branches `\iffalse … \fi` hides (`conditionals.ts`). */
|
|
40
|
-
export declare
|
|
40
|
+
export declare function parseLatex(src: string): ParsedTex;
|
|
41
|
+
/**
|
|
42
|
+
* The part of a source's tree TeX reads: everything up to and with the `document` environment.
|
|
43
|
+
* TeX stops at `\end{document}`, so a `\bibliography`, a `thebibliography`, a block or an `\input`
|
|
44
|
+
* parked after it is never read. A source with no `document` environment is read whole.
|
|
45
|
+
*/
|
|
46
|
+
export declare function liveRoot(t: ParsedTex): Readonly<Ast.Root>;
|
|
41
47
|
export {};
|
|
42
48
|
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAW/D,oGAAoG;AACpG,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAgB9C,CAAC;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAW/D,oGAAoG;AACpG,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAgB9C,CAAC;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CA2B9C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAGnD,CAAC;AAcH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW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