Prime: real content (psalms, Martyrology, Regula) and ordo corrections
Deploy / deploy (push) Failing after 21s
Deploy / deploy (push) Failing after 21s
Pulls in verified content from Divinum Officium rather than placeholders: 17 psalms (2, 6, 7-19, 118, 129), 365 days of the Martyrology, and the full 121-reading Regula cycle, plus the Athanasian Creed. Ordo corrections driven by review against the real engine output: - Capitulum and Preces now pick a Sunday/feast vs. ferial form (calendar/isSundayOrFeast); ferial Preces said every ferial day by choice. - Chapter responsory, hymn doxology, and the opening versicle's Alleluia/Laus tibi all vary by season via a shared resolver (hours/seasonal-propers.ts). - Real Roman Kalends/Nones/Ides Latin dating (calendar/roman-date.ts, verified against 363/365 real Martyrology headings) plus the historical "bis sextus" Feb 29 handling, and the Martyrology's Luna (moon-day) heading (a ported Golden-Number calculation). - Fixed responsory structure (was missing its initial full repeat), weekday psalm antiphons (opening as incipit-or-full by rank, full repeat after the psalms/Creed as its own part, "*" chant mark kept), scripture citations on the capitulum/lectio brevis, and V./R. markers switched from Unicode symbols to plain text for reliable font rendering. - Dropped Pretiosa and the dead-commemoration psalm (129) for time; trimmed section headings down to the ones that are actually named things (Preces, Chapter Office, etc. no longer relabel connective text). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import type { RegulaReading } from './types';
|
||||
import tableData from '../data/regula/table.yml';
|
||||
|
||||
interface Table {
|
||||
table: Record<string, [string, string]>;
|
||||
}
|
||||
|
||||
const { table } = tableData as Table;
|
||||
|
||||
// Reverse index: any of the 3 recurring dates -> canonical (first) date.
|
||||
const canonicalDateFor = new Map<string, string>();
|
||||
for (const [canonical, [repeat1, repeat2]] of Object.entries(table)) {
|
||||
canonicalDateFor.set(canonical, canonical);
|
||||
canonicalDateFor.set(repeat1, canonical);
|
||||
canonicalDateFor.set(repeat2, canonical);
|
||||
}
|
||||
|
||||
const readingModules = import.meta.glob<{ default: RegulaReading }>('../data/regula/[0-9]*.yml', {
|
||||
eager: true,
|
||||
});
|
||||
|
||||
const readings = new Map<string, RegulaReading>();
|
||||
for (const mod of Object.values(readingModules)) {
|
||||
readings.set(mod.default.canonicalDate, mod.default);
|
||||
}
|
||||
|
||||
function isLeapYear(year: number): boolean {
|
||||
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isoDate "YYYY-MM-DD". Feb 29 only has its own canonical reading in
|
||||
* leap years — in a non-leap year, Feb 24–28 shift forward by one day before
|
||||
* lookup (mirroring the source engine's own bis-sextus rule), so a plain
|
||||
* Feb 28 reads what would otherwise be Feb 29's chapter.
|
||||
*/
|
||||
export function getRegulaReadingFor(isoDate: string): RegulaReading {
|
||||
const [yearStr, monthStr, dayStr] = isoDate.split('-');
|
||||
const year = Number(yearStr);
|
||||
const month = Number(monthStr);
|
||||
let day = Number(dayStr);
|
||||
|
||||
if (month === 2 && day >= 24 && !isLeapYear(year)) {
|
||||
day += 1;
|
||||
}
|
||||
|
||||
const monthDay = `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
||||
const canonicalDate = canonicalDateFor.get(monthDay);
|
||||
if (!canonicalDate) {
|
||||
return { canonicalDate: monthDay, label: {}, text: {}, status: { la: 'missing', en: 'missing' } };
|
||||
}
|
||||
|
||||
return (
|
||||
readings.get(canonicalDate) ?? {
|
||||
canonicalDate,
|
||||
label: {},
|
||||
text: {},
|
||||
status: { la: 'missing', en: 'missing' },
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export type { RegulaReading } from './types';
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { LanguageCode, TranslationStatus } from '../psalter/types';
|
||||
|
||||
/** One canonical Regula reading, keyed by its first (Jan–May) calendar date —
|
||||
* see data/regula/table.yml for how real dates map onto these. */
|
||||
export interface RegulaReading {
|
||||
canonicalDate: string;
|
||||
/** e.g. "Caput 67: De frátribus in viam diréctis" */
|
||||
label: Partial<Record<LanguageCode, string>>;
|
||||
text: Partial<Record<LanguageCode, string>>;
|
||||
status: Partial<Record<LanguageCode, TranslationStatus>>;
|
||||
}
|
||||
Reference in New Issue
Block a user