akivajgordon / tikkun.io

The online tikkun you always wanted, but never had.
https://www.tikkun.io
MIT License
44 stars 18 forks source link

Add Haftaros #117

Open SLaks opened 1 month ago

SLaks commented 1 month ago

I lein Haftaros from a קלף, and I am very interested in helping add this.

Data

https://hebcal.github.io/api/leyning/index.html includes a complete list of Haftaros, including skips, calendar logic, and Sefaria-URL-compatible naming.

Do you have the scripts you used to download data from Sefaria and populate JSON?

Layout

I'm pretty sure there is no standard layout/pagination for Haftaros (for example, different editions of the סימנים Tikkun use different pagination). To be compatible with the existing system, it probably makes most sense to simply generate lines by word wrapping at a fixed character count.

We should use appropriate layout for שירת דבורה and שירת דוד. It looks like Sefaria has layout for them. How did you do this in חומש?

UI

Adding Haftaros to the Parsha Picker is more complex, especially since Haftarah mappings depend on the year.

Do you have any suggestions here?

akivajgordon commented 4 weeks ago

@SLaks Great suggestion! And you thought about a lot of interesting questions. Certainly a lot of work to do to support this, but a worthwhile endeavor.

I do have a set of scripts in a different repo (not published anywhere yet) that I use to fetch data and force the alignment. But I'm with you on the idea of just using a rough character count for setting the lines since there's no real standard for haftarot.

As a question back to you, how do you manage the mismatched layouts when you practice vs. read from klaf? For the Torah reading, I find that I'm more likely to trip up when the Sefer Torah does not match up with the standard Tikkun layout. Do you experience the same for haftarot from klaf?

I was toying with a better UI for the "Coming up" and picker in general that would better support showing the haftarah, but it's probably been almost 2 years since I was working on that, so I need to dig that up.

SLaks commented 4 weeks ago

I haven't found that to be much of a problem, primarily because Haftaros are shorter and therefore easier to keep track. I also try to run through most of the Haftarah from the actual Klaf during הגבה and מי שברך.

If you're redoing the picker UI, consider using @hebcal JS libraries to replace your hard-coded JSON.

If you share your scripts, I can start working on this.

SLaks commented 4 weeks ago

We will also need UI to select which מנהג to use

SLaks commented 1 week ago

Can you please share your data fetching scripts so I can start building this?

If you have any ideas for the selection UI, let me know; otherwise, I'll come up with something.

How do you feel about using @hebcal to calculate calendar data at runtime instead of hard coded JSON?

akivajgordon commented 1 week ago

@SLaks – sorry for going dark, I've been pretty busy lately. I will see if I can share those scripts later tonight, but honestly I don't think there's too much that will be very helpful.

As for the selection UI, I want to be very thoughtful about it, but I'm ok if you want to come up with something for now while working on this.

I'd be happy to use hebcal's calendar calculator to replace the schedule. But I'd keep that in a separate PR if possible so that things don't get bloated; it feels unrelated to adding haftarot.

SLaks commented 4 days ago

Thanks!

No problem; I'm also pretty busy, and I'll see when/how much time I'll have to actually work on this.

I'll send a separate PR to use HebCal (that is not blocked on anything).

Please share any existing ideas you have for the selection UI so I can brainstorm further.