aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: eb763e276e4b050d9b8ed96547d1c575aba36e2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# clectio

tiny, fast, suckless daily readings.

clectio prints the Catholic liturgical day and its Mass readings for any date.
It computes nothing at run time: the calendar, the reading citations and the
scripture text are all compiled in. One table lookup, no config file, no
network, no dependencies beyond libc. The default text is the public-domain
Latin Vulgate, and the whole program fits on a 1.44 MB floppy.

It is the small cousin of [lectio](https://github.com/lukaszkasprzak/lectio),
the Go engine that computes and generates clectio's data.

## Build

    make                      # Ordinary Form, English sigla, Latin Vulgate
    ./clectio                 # today
    ./clectio 2026-12-25      # a given date
    ./clectio -g 2026-12-25   # the Gospel only
    ./clectio -a              # all readings (override a Gospel-only build)
    ./clectio --month         # this month at a glance (day, colour, celebration)
    ./clectio --month 2026-04 > apr.txt   # a month to a file for reference
    make install              # into $PREFIX/bin (default /usr/local)

Needs only a C99 compiler and libc. It builds in about a second.

The run-time options are `-a`/`--all`, `-g`/`--gospel` (which reading set to
print, overriding the compiled default), `--month [YYYY-MM | N]` (one line per
day of a month — weekday, colour and celebration, no readings; defaults to the
current month) and `-h`/`--help`. Everything else is compile-time. Reading text
wraps to the terminal width by default (see `WRAP`); piped output is left one
line per verse.

## Configure (suckless style)

Edit `config.h` (copied from `config.def.h` on first build), then `make`:

  * `FORM_OF` / `FORM_EF`         — Ordinary Form (1969) or Extraordinary Form (1962)
  * `SIGLA_ENGLISH` / `SIGLA_LATIN` — citation dialect (`Jer 14` vs `Ier 14`)
  * `COLOR`                       — colour the day name with its liturgical colour
  * `GOSPEL_ONLY`                 — default reading set: every reading (0) or the Gospel only (1); override per run with `-a` / `-g`
  * `WRAP`                        — wrap reading text at N columns; `0` fits the terminal (and leaves piped output unwrapped)

One form per binary; for both, build twice. The interface is English only.

## Bring your own Bible

The default build embeds the Latin Vulgate. To compile with another
translation, hand `make` a corpus in the same 6-column TSV format
(`Book<TAB>Abbrev<TAB>BookNum<TAB>Chapter<TAB>Verse<TAB>Text`), using Vulgate
chapter/verse numbering:

    make CORPUS=/path/to/mybible.tsv

clectio compiles in only the ~12000 verses the lectionary actually cites, so the
binary stays well under 1 MiB whatever the Bible. A verse the corpus lacks prints
blank; it never fails the day. (The default build needs only a compiler; a
`CORPUS=` rebuild also needs `gzip`, which `mktext` uses to pack the text.)

## Coverage

The compiled calendar runs 2025–2054. Dates outside that range are reported, not
guessed. To extend it, regenerate `gen/` with lectio's `clectio-gen`.

## Files

    clectio.c        the program: date -> table lookup -> print
    config.def.h     compile-time configuration
    puff.c/.h        DEFLATE decompressor (Mark Adler's puff, public domain)
    mktext.c         build tool: resolve verse keys against a corpus, gzip-pack the text
    bin2h.c          build tool: embed the packed text as C
    gen/             generated, corpus-independent data (calendar + citations)
    text_of.lz       the default Vulgate text, DEFLATE-packed (one per form)

## Licence

clectio's own code is ISC (see `LICENSE`). The data in `gen/` is generated from
lectio and is dates and scripture *references* — facts, not copyrightable. The
compiled scripture *text* is a separate work under its own terms; the default,
the Latin Vulgate, is public domain. Distribute a build made with a different
Bible only where that translation permits it.