aboutsummaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* fix(install): ship lang/ so installed colitur resolves namesLukasz Kasprzak2026-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | la.ini and en.ini (725 Latin/English liturgical names -- the entire point of the naming-and-config work just merged) had no dune install rule, so make install / dune install never copied them to <prefix>/share/colitur/lang/. bin/main.ml's lang_dir() probes exactly that installed path first, falling back to a build-tree layout that also does not exist for an installed binary -- so every installed user silently got raw slugs (ef-circumcision) and untranslated terms (epistle/gospel) instead of resolved names, with no error at all. The defect existed because nobody had run the installed binary from a directory with no colitur source tree above it: dune exec and dune test always resolve lang/ via the build tree, materialized as a side effect of test/dune's cram deps, so every in-tree check stayed green while the installed artifact was broken. Add lang/dune, following schema/dune's exact pattern: an install stanza placing la.ini and en.ini at <prefix>/share/colitur/lang/, matching where bin/main.ml's lang_dir() already looked. No code change was needed there -- only the missing install rule. Update Makefile's install target help text and summary echo to mention lang alongside ef/templates/schema. Verified end to end: uninstalled, removed lang/dune, rebuilt and reinstalled to reproduce the bug from an outside directory (~/tmp, colitur table showed ef-circumcision/epistle); restored lang/dune, reinstalled, and confirmed the same command now shows the resolved Latin name and rubric terms, that ~/.local/share/colitur/lang/ contains both files, and that colitur emit --format csv shows a real name in the name column. lang/la.ini and lang/en.ini are untouched. Full suite: dune test --force, 495 tests, 0 failures.
* docs(templates): document the ordo booklet's required two-pass buildLukasz Kasprzak2026-08-191-2/+4
| | | | | | | | | | | | | | | A LaTeX table of contents needs two pdflatex passes -- the first pass leaves every entry showing '??', the second resolves the \pageref values. A user hit exactly this and reported it as a bug; the template was fine, the instructions were not. README's rendering example now runs pdflatex twice for ordo.tex (or names latexmk -pdf as the one-shot alternative) and notes the wall calendar needs only one pass, having no cross-references of its own. make check-templates now runs pdflatex twice per LaTeX template too, so the target exercises what a user actually has to do rather than silently passing on a single, incomplete pass.
* fix(tools): harden check_citations.py against its own self-poisoning bugLukasz Kasprzak2026-08-191-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reproduced the defect: reintroducing the exact historical citation bug (pointing class-1's citation back at LT.txt:12459, the value a prior fix round corrected away from) made the tool report "147 citations checked, 0 look wrong". The mechanism was that the corrective comment documenting the old bug quotes the wrong historical value, and the checker pooled every quoted phrase from the whole surrounding comment block, so citing the wrong line matched the comment explaining why it was wrong. Four changes: 1. The word pool for a citation is now scoped to the entry(ies) it is attached to only -- never to quoted text elsewhere in the comment. This is the direct fix for the self-poisoning bug. 2. A citation whose pool has fewer than two distinctive words (Latin liturgical headings are short and stopword-heavy) cannot discriminate the right line from a wrong nearby one. Such a citation is now reported CANNOT VERIFY and fails the target, instead of silently passing. 3. The blanket +-2-line tolerance is gone. A bare "LT.txt:N" is checked at line N only; a heading that genuinely wraps must say so explicitly as "LT.txt:N-M". The allowance moves into the data, where it is visible. 4. The tool gets its own test suite, tools/test_check_citations.py, with a synthetic fixture covering: a correct citation, off-by-one and off-by-three mismatches, an explicit wrap range, a degenerate pool, a PATTERN-marked entry with no citation, and a dedicated regression test for the self-poisoning case itself. Wired into `dune test` via a new (rule (alias runtest) ...) in tools/dune (a plain (test ...) stanza cannot run a Python script), so it runs with the rest of the suite, not only as a `make` target. Added a --file/--lt-file override to check_citations.py so the tool (and its own tests) can point at a fixture without touching the real lang/la.ini or docs/research/LT.txt. Confirmed the "SKIPPED, exit 0" behaviour for a missing docs/research/LT.txt is unchanged. tools/__pycache__/ (a stray artefact of this script, previously untracked and ungitignored) is now in .gitignore. Measured against the current lang/la.ini (another task is still landing its sanctoral entries on this branch): 15 of 275 citations now look wrong and 42 more cannot be verified, both far above the 0 the unhardened tool reported. Not fixed here -- the data pass is separate, once the sanctoral entries land.
* fix(lang): correct two wrong citation lines, add check-citationsLukasz Kasprzak2026-08-191-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Two of la.ini's LT.txt:<n> citations pointed at the wrong line -- the Latin itself was right, only the pinned line was wrong: - advent cited LT.txt:8631 ("Tempus Nativitatis"); the real "Tempus Adventus" heading is at 8609. - ef-christ-the-king and [rank]'s own citation both pointed near "Dominica ultima Octobris" (12459) when the text they actually quote, "D.NI NOSTRI JESU CHRISTI REGIS" and "I classis", sits two and three lines further down, at 12461 and 12462. ef-christmas-sunday-0 was marked PATTERN but LT.txt:8644 is the identical string verbatim -- relabelled as a direct citation, not constructed. Added tools/check_citations.py and `make check-citations`: for every LT.txt:<n> citation outside a PATTERN block, confirms a +-2-line window around line n actually contains the Latin text the citation claims, rather than trusting each of the 38 citations by hand. Follows check-schema/check-templates' own precedent -- docs/ is gitignored, so the target prints SKIPPED loudly and exits 0 when docs/research/LT.txt is absent, never a silent pass. The checker's own teeth are proven three ways: replayed against the pre-fix file it independently re-derives both corrections above; a fresh mutation (redirecting one citation to an unrelated line) is caught and reverted; the fixed file passes clean, 147 citations checked, 0 wrong.
* fix(templates): grid.ms wall calendar dropped four of seven columnsLukasz Kasprzak2026-08-191-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pdftotext -layout of the shipped grid.ms showed only 3-4 of 7 columns and roughly a third of each month's day numbers: tbl's plain columns (no w()) size to their widest single entry and never wrap, so a long fallback slug (some run past 40 characters) forced every column that wide, the table ran far past the page, and whatever fell past the physical edge was gone, not merely ugly. groff exited 0 throughout (warnings, not errors), so make check-templates reported OK on a broken artefact. Fixed both halves. (a) The table now fits: true landscape via gropdf's own -P-pa4l (an in-document Xpapersize=a4l escape was tried and rejected -- it does not rotate the page in this groff), ms's own title macro widened back out after narrowing the line length for the title text (a second, independent way the original lost its width, found by reading s.tmac), and every column rewritten as a genuine tbl text-block (T{/T}, not a plain w() cell -- w() alone does not wrap, confirmed against tbl's own generated troff code) so long, hyphenated slugs wrap at their own hyphens instead of forcing the column wider. (b) check-templates now captures groff's stderr per template and fails the target if it is non-empty, rather than trusting groff's exit code. Verified: 0 warnings (was 12), pdftotext -layout shows all 7 columns and every day number for all 12 months (was 3-4 columns, ~12-23 of each month's day numbers). The golden fixture is regenerated: 0 "{{", 12 month headings, exactly one Ianuarius, and each week's block (now spread across several physical lines by the T{/T} wrap) carries exactly 6 tabs joining its 7 cells.
* docs(render): template reference, install rules, typesetting checkLukasz Kasprzak2026-08-191-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | colitur-templates.5 documents the four syntax forms, the six flavours and their escaping, and the full view-model field reference. It states plainly that there are no partials, no raw form and no expression evaluation -- a template is data, never a program. It documents two real hazards found during this build, not theoretical ones: the outward scope fallback silently shadowing an inner name/num key with an outer one of the same name (with the safe {{#name}}...{{^la}} idiom), and the engine's lack of host-comment awareness (a {{...}} inside a LaTeX %, groff .\" or HTML <!-- --> comment is still parsed as a tag). It also states the limitation rather than hiding it: AsciiDoc and Markdown are not escaped, so a feast name containing * or _ renders as emphasis. templates/ and schema/ now install into <prefix>/share/colitur/, matching data/ef/, via new install stanzas; colitur-templates.5 installs to man5 beside colitur-overlay.5. Verified against a scratch prefix: the installed binary resolves both from the prefix, not the source tree, when run from an unrelated working directory. make check-templates typesets every shipped template through pdflatex and groff when they are installed, and prints SKIPPED loudly when they are not. Golden tests prove templates render; only this proves they typeset. A silent skip would read as a pass. Fixed a real doc/help drift while here: bin/main.ml's --help still said --overlay was accepted on day and readings only, three commands out of date (emit, table/render and publish all accept it too), disagreeing with the man page's own OVERLAYS section, which carried the identical stale line. Both are corrected; --overlay's own behaviour is unchanged.
* feat(render): XML emitter and schemaLukasz Kasprzak2026-08-191-1/+10
| | | | | | | | | | | | | Element-per-field; attributes carry identity only and there is no mixed content, so a consumer's XPath never has to distinguish the two. Schema validation is an opt-in make check-schema via xmllint, not an in-suite assertion: validating XSD needs an XML library and the dependency list is frozen. It prints SKIPPED loudly when xmllint is absent, because a silent skip reads as a pass. The suite asserts well-formedness properties directly instead. This corrects the design spec, which claimed in-test validation.
* docs(man): colitur-overlay(5), the overlay format in fullLukasz Kasprzak2026-08-181-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The overlay format was documented in three partial places -- a paragraph in colitur(1), a block in --help, and the comments inside the shipped example -- none of which was a reference. Someone writing a diocesan calendar had to read all three and infer the rest. Section 5 because an overlay is a thing a user AUTHORS rather than a command they run: it belongs beside fstab(5), not in man1. Covers every directive and every field edit, the six required fields and the two optional ones, all three date specifications including the signed Easter_offset and the negative nth, three worked examples, and the caveats. The subject field gets a note explaining that it is not decoration -- it decides whether a feast displaces an occurring Sunday under RG 16(a). Two things it says that the code says and the old prose did not. There is no Set_status and no Set_date among the field edits, deliberately: changing an entry's status or its date makes it a different celebration rather than an edited one, so Replace is the right directive and the change stays visible in `colitur check` output. And a local feast missing from output has usually LOST its day under the general rubrics rather than failed to load -- the engine applies precedence to overlay entries exactly as to universal ones, which is the first thing an author hits and was written down nowhere. Writing it caught a documentation bug before it shipped: a first draft listed a Set_status edit that does not exist and omitted Remove_name that does. Every documented edit is now cross-checked against overlay.mli. Linked from colitur(1)'s SEE ALSO and its OVERLAYS section, and from --help. The Makefile installs it into man5, removes it on uninstall, and the man and doc targets lint both pages.
* fix(make): release must not abort when the version bump is a no-opv0.1.0Lukasz Kasprzak2026-08-171-2/+9
| | | | | | | | | Cutting a version whose files already carry it -- which is how the first tag went, and what any re-run after a failed gate looks like -- leaves nothing staged, and git commit aborts the target on "nothing to commit" despite everything being in order. The commit is now conditional on something actually being staged, and an existing tag is refused explicitly rather than surfacing as a bare git error.
* feat(cli): --version, a CHANGELOG, and a release targetLukasz Kasprzak2026-08-171-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | Groundwork for tagging. The project had no version anywhere: not in dune-project, not in the binary, no CHANGELOG, no tags. The version lives in two places -- dune-project, which generates colitur.opam, and a constant in bin/main.ml, which is what --version prints. Two rather than one because dune's watermarking only substitutes in a release tarball, so a binary built the ordinary way from a checkout would report a placeholder. The release target rewrites both and then re-checks both, and finally requires the freshly built binary to report the version it just wrote: a release that bumped one and not the other would ship a binary disagreeing with its own package metadata. --version is deliberately not embedded in the help text. cli.t pins help's first line, and a version there would mean editing a test expectation every release for no gain. The release target mirrors lectio's, refusals included: no release from a dirty tree, none without a CHANGELOG entry for that version, none whose version bump silently failed to apply, and `make check` -- the full 1583-9999 sweep, not the sampling suite -- must pass before the tag is created.
* feat(cli): a Makefile, a man page, and --helpLukasz Kasprzak2026-08-171-0/+55
Three things the project had no answer for: how to install it without knowing dune, where to read about it, and what it does when asked. Makefile, same shape as lectio's -- PREFIX ?= $(HOME)/.local, BINDIR, MANDIR, and the '## '-comment help target -- so the two siblings are driven the same way. Every recipe wraps dune in `opam exec --`, which is the actual point of having one here: `make build` works from a plain shell with no `eval $(opam env)` first. install goes through `dune install` rather than a hand-rolled copy, because the binary finds its calendar data relative to its own path; the man page is installed separately to share/man/man1, matching lectio. install and uninstall were both run against a scratch prefix and checked: uninstall leaves zero files behind. PREFIX defaults to ~/.local because that is where lectio installs and where it actually lives on this machine, so colitur lands on an existing PATH with no shell change. An earlier install this session went to ~/opt/colitur, which was me over-applying a rule meant for third-party tools to one of the author's own projects; it has been removed rather than left as a second, staler binary competing on PATH. man/colitur.1 documents the four commands, both output formats and why they differ, COLITUR_DATA_DIR and its refusal to fall back, the data resolution order, exit statuses, and -- deliberately -- the limitations: EF only, Epistle and Gospel only with the chants unbuilt and rejected rather than guessed, and the BVM Saturday Mass-selection gap. A man page that only lists what works is half a man page. Renders clean under `groff -ww -z`, no warnings. --help prints to stdout and exits 0; a usage error prints one line to stderr and exits 2. That is the Unix convention rather than a preference: asking for help succeeded and should be pipeable, being invoked wrongly did not and must not pollute stdout. Both directions are asserted in cli.t, along with a loop confirming every command the help text advertises is one the dispatch actually accepts -- the check that catches help drifting away from the code.