Skip to content

Add Dirshu Amud HaYomi daily learning program#8

Merged
mjradwin merged 3 commits intomainfrom
claude/add-dirshu-amud-yomi-bT5sT
Mar 24, 2026
Merged

Add Dirshu Amud HaYomi daily learning program#8
mjradwin merged 3 commits intomainfrom
claude/add-dirshu-amud-yomi-bT5sT

Conversation

@mjradwin
Copy link
Copy Markdown
Member

Summary

This PR adds support for the Dirshu Amud HaYomi daily learning program, which cycles through all 5,407 amudim (pages) of the Talmud. The cycle began on October 16, 2023 (1 Cheshvan 5784) with Berachot 2a.

Key Changes

  • New DirshuAmudYomi class (dirshuAmudYomiBase.ts): Extends DafPage to represent a specific amud in the Dirshu program with tractate name, blatt number, and side (a/b)
  • calculateDirshuAmud() function: Computes which amud should be studied on a given date by calculating days elapsed since the cycle start and mapping to the appropriate tractate and page
  • DirshuAmudYomiEvent class (DirshuAmudYomiEvent.ts): Event wrapper that integrates with the daily learning system, providing:
    • Localized rendering in English and Hebrew
    • Brief format output
    • Sefaria.org links with proper tractate name mappings (e.g., "Berachot" → "Berakhot", "Baba Kamma" → "Bava_Kamma")
    • Category classification as dirshuAmudYomi
  • Daily learning integration (dirshuAmudYomi.ts): Registers the program with the DailyLearning system, making it available for calendar queries starting from the cycle start date
  • Comprehensive test suite (dirshuAmudYomi.spec.ts): 177 lines of tests covering:
    • Cycle start dates and boundary conditions
    • Specific amudim calculations across different tractates
    • Cycle wrapping behavior
    • Event rendering in multiple locales
    • Sefaria URL generation with proper name mappings
    • Edge cases (too-early dates, last amud of cycle)

Implementation Details

  • The Shas (all 40 tractates) is defined as a lookup table with amud counts totaling 5,407
  • Amud calculation uses modulo arithmetic to handle cycle wrapping
  • Each amud maps to a blatt number starting from 2 (since daf 1 is typically not studied) with alternating a/b sides
  • Hebrew rendering uses gematriya for page numbers and special notation (ע״א/ע״ב) for sides
  • Sefaria name mappings handle special cases where English tractate names differ from Sefaria's URL format

https://claude.ai/code/session_016o5KhppqzAC6F68t2tRRho

Implements the Dirshu Amud HaYomi program which began on 1 Cheshvan
5784 (October 16, 2023). Learners study one amud (side of a Talmud
page) per day, cycling through all 40 tractates of the Babylonian
Talmud (5,407 amudim total).

- dirshuAmudYomiBase.ts: core algorithm with DirshuAmudYomi class
  extending DafPage, storing blattNum and side ('a'/'b') separately
  for proper Hebrew rendering (e.g. "שקלים דף ד ע״ב")
- DirshuAmudYomiEvent.ts: DafPageEvent subclass with custom render(),
  url(), and getCategories(); Sefaria links use the actual amud side
- dirshuAmudYomi.ts: DailyLearning wrapper registration
- register.ts: include dirshuAmudYomi in global registry
- test/dirshuAmudYomi.spec.ts: 19 unit tests covering cycle start,
  today's amud (Shekalim 4b on March 23 2026), tractate boundaries,
  cycle wrap, Hebrew rendering, Sefaria URL generation, and error handling

https://claude.ai/code/session_016o5KhppqzAC6F68t2tRRho
claude and others added 2 commits March 23, 2026 19:22
Removes the duplicated sefariaNames map from DirshuAmudYomiEvent by
exporting the existing dafYomiSefaria from DafPageEvent and importing
it. The Shekalim entry is overridden locally since dafYomiSefaria points
to the Yerushalmi page but Dirshu Amud HaYomi uses the Bavli edition.

https://claude.ai/code/session_016o5KhppqzAC6F68t2tRRho
@mjradwin mjradwin merged commit cd07d41 into main Mar 24, 2026
4 checks passed
@mjradwin mjradwin deleted the claude/add-dirshu-amud-yomi-bT5sT branch March 24, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants