@hebcal/leyning 4.14.3 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -80,6 +80,12 @@ for (const [num, aliyah] of Object.entries(triReading)) {
80
80
  <dd><p>Makes Sefaria links by adding <code>href</code>, <code>verses</code> and <code>num</code> attributes to each aliyah.
81
81
  CAUTION: Modifies the <code>aliyot</code> parameter instead of making a copy.</p>
82
82
  </dd>
83
+ <dt><a href="#formatAliyahWithBook">formatAliyahWithBook(a)</a> ⇒ <code>string</code></dt>
84
+ <dd><p>Formats an aliyah object like &quot;Numbers 28:9-28:15&quot;</p>
85
+ </dd>
86
+ <dt><a href="#formatAliyahShort">formatAliyahShort(aliyah, showBook)</a> ⇒ <code>string</code></dt>
87
+ <dd><p>Formats an aliyah object like &quot;Numbers 28:9-15&quot;</p>
88
+ </dd>
83
89
  <dt><a href="#getLeyningKeyForEvent">getLeyningKeyForEvent(e, [il])</a> ⇒ <code>string</code></dt>
84
90
  <dd><p>Based on the event date, type and title, finds the relevant leyning key</p>
85
91
  </dd>
@@ -90,7 +96,7 @@ of full kriyah aliyot, special Maftir, special Haftarah</p>
90
96
  <dt><a href="#makeLeyningSummary">makeLeyningSummary(aliyot)</a> ⇒ <code>string</code></dt>
91
97
  <dd><p>Makes a summary of the leyning, like &quot;Genesis 6:9-11:32&quot;</p>
92
98
  </dd>
93
- <dt><a href="#getLeyningForHolidayKey">getLeyningForHolidayKey(key)</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
99
+ <dt><a href="#getLeyningForHolidayKey">getLeyningForHolidayKey(key, [cholHaMoedDay])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
94
100
  <dd><p>Looks up leyning for a given holiday key. Key should be an
95
101
  (untranslated) string used in holiday-readings.json. Returns some
96
102
  of full kriyah aliyot, special Maftir, special Haftarah</p>
@@ -101,12 +107,6 @@ of full kriyah aliyot, special Maftir, special Haftarah</p>
101
107
  <dt><a href="#getLeyningForParshaHaShavua">getLeyningForParshaHaShavua(ev, [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
102
108
  <dd><p>Looks up leyning for a regular Shabbat parsha.</p>
103
109
  </dd>
104
- <dt><a href="#formatAliyahWithBook">formatAliyahWithBook(a)</a> ⇒ <code>string</code></dt>
105
- <dd><p>Formats an aliyah object like &quot;Numbers 28:9-28:15&quot;</p>
106
- </dd>
107
- <dt><a href="#formatAliyahShort">formatAliyahShort(aliyah, showBook)</a> ⇒ <code>string</code></dt>
108
- <dd><p>Formats an aliyah object like &quot;Numbers 28:9-15&quot;</p>
109
- </dd>
110
110
  <dt><a href="#getTriennial">getTriennial(year)</a> ⇒ <code><a href="#Triennial">Triennial</a></code></dt>
111
111
  <dd><p>Calculates the 3-year readings for a given year</p>
112
112
  </dd>
@@ -218,6 +218,29 @@ CAUTION: Modifies the `aliyot` parameter instead of making a copy.
218
218
  | aliyot | <code>Object.&lt;string, Aliyah&gt;</code> | aliyah map to decorate |
219
219
  | showBook | <code>boolean</code> | display the book name in the `verses` field (e.g. for special Maftir) |
220
220
 
221
+ <a name="formatAliyahWithBook"></a>
222
+
223
+ ## formatAliyahWithBook(a) ⇒ <code>string</code>
224
+ Formats an aliyah object like "Numbers 28:9-28:15"
225
+
226
+ **Kind**: global function
227
+
228
+ | Param | Type | Description |
229
+ | --- | --- | --- |
230
+ | a | [<code>Aliyah</code>](#Aliyah) | aliyah |
231
+
232
+ <a name="formatAliyahShort"></a>
233
+
234
+ ## formatAliyahShort(aliyah, showBook) ⇒ <code>string</code>
235
+ Formats an aliyah object like "Numbers 28:9-15"
236
+
237
+ **Kind**: global function
238
+
239
+ | Param | Type |
240
+ | --- | --- |
241
+ | aliyah | [<code>Aliyah</code>](#Aliyah) |
242
+ | showBook | <code>boolean</code> |
243
+
221
244
  <a name="getLeyningKeyForEvent"></a>
222
245
 
223
246
  ## getLeyningKeyForEvent(e, [il]) ⇒ <code>string</code>
@@ -258,7 +281,7 @@ Makes a summary of the leyning, like "Genesis 6:9-11:32"
258
281
 
259
282
  <a name="getLeyningForHolidayKey"></a>
260
283
 
261
- ## getLeyningForHolidayKey(key) ⇒ [<code>Leyning</code>](#Leyning)
284
+ ## getLeyningForHolidayKey(key, [cholHaMoedDay]) ⇒ [<code>Leyning</code>](#Leyning)
262
285
  Looks up leyning for a given holiday key. Key should be an
263
286
  (untranslated) string used in holiday-readings.json. Returns some
264
287
  of full kriyah aliyot, special Maftir, special Haftarah
@@ -269,6 +292,7 @@ of full kriyah aliyot, special Maftir, special Haftarah
269
292
  | Param | Type | Description |
270
293
  | --- | --- | --- |
271
294
  | key | <code>string</code> | name from `holiday-readings.json` to find |
295
+ | [cholHaMoedDay] | <code>number</code> | |
272
296
 
273
297
  <a name="getLeyningForParsha"></a>
274
298
 
@@ -299,29 +323,6 @@ Looks up leyning for a regular Shabbat parsha.
299
323
  | ev | <code>Event</code> | | the Hebcal event associated with this leyning |
300
324
  | [il] | <code>boolean</code> | <code>false</code> | in Israel |
301
325
 
302
- <a name="formatAliyahWithBook"></a>
303
-
304
- ## formatAliyahWithBook(a) ⇒ <code>string</code>
305
- Formats an aliyah object like "Numbers 28:9-28:15"
306
-
307
- **Kind**: global function
308
-
309
- | Param | Type | Description |
310
- | --- | --- | --- |
311
- | a | [<code>Aliyah</code>](#Aliyah) | aliyah |
312
-
313
- <a name="formatAliyahShort"></a>
314
-
315
- ## formatAliyahShort(aliyah, showBook) ⇒ <code>string</code>
316
- Formats an aliyah object like "Numbers 28:9-15"
317
-
318
- **Kind**: global function
319
-
320
- | Param | Type |
321
- | --- | --- |
322
- | aliyah | [<code>Aliyah</code>](#Aliyah) |
323
- | showBook | <code>boolean</code> |
324
-
325
326
  <a name="getTriennial"></a>
326
327
 
327
328
  ## getTriennial(year) ⇒ [<code>Triennial</code>](#Triennial)
@@ -346,14 +347,6 @@ Looks up the triennial leyning for this Parashat HaShavua
346
347
  | ev | <code>Event</code> | | |
347
348
  | [context] | <code>boolean</code> | <code>false</code> | returns a reading wrapper object which includes `date`, `yearNum` and `aliyot` |
348
349
 
349
- <a name="getTriennialForParshaHaShavua..reason"></a>
350
-
351
- ### getTriennialForParshaHaShavua~reason
352
- **Kind**: inner constant of [<code>getTriennialForParshaHaShavua</code>](#getTriennialForParshaHaShavua)
353
- **Todo**
354
-
355
- - [ ] update unit tests instead
356
-
357
350
  <a name="Aliyah"></a>
358
351
 
359
352
  ## Aliyah : <code>Object</code>
package/bin/leyning-csv CHANGED
@@ -29,6 +29,7 @@ for (let i = 0; i < numTriennialCycles; i++) {
29
29
  const yearOffset = (i - 1) * 3;
30
30
  const cycleStartYear = hyear - (yearNum - 1) + yearOffset;
31
31
  const filename = `triennial-${cycleStartYear}-${cycleStartYear+2}.csv`;
32
+ console.log(`Creating ${filename}`);
32
33
  const stream = fs.createWriteStream(filename, {flags: 'w'});
33
34
  writeTriennialCsv(stream, cycleStartYear);
34
35
  stream.end();