@hebcal/leyning 5.0.0 → 6.0.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 +198 -171
- package/dist/bundle.js +235 -848
- package/dist/bundle.min.js +2 -2
- package/dist/index.js +170 -720
- package/dist/index.mjs +163 -717
- package/leyning.d.ts +84 -50
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,27 +3,10 @@ Javascript Torah Reading API for Parashat HaShavua and holidays
|
|
|
3
3
|
|
|
4
4
|
[](https://circleci.com/gh/hebcal/hebcal-leyning)
|
|
5
5
|
|
|
6
|
-
This package includes both traditional (full kriyah)
|
|
6
|
+
This package includes both traditional (full kriyah) and weekday
|
|
7
7
|
Torah readings.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
similar to the one used in ancient Israel during the rabbinic period. In
|
|
11
|
-
this system, the traditional parashiot are each divided into three shorter
|
|
12
|
-
segments, and the whole Torah is completed once every three years. The
|
|
13
|
-
system has both advantages and disadvantages, but its ability to shorten
|
|
14
|
-
the length of Torah reading without sacrificing the complete reading of the
|
|
15
|
-
Torah on a regular basis has made it the choice of some synagogues in the
|
|
16
|
-
Conservative Movement.”
|
|
17
|
-
|
|
18
|
-
[A Complete Triennial System for Reading the Torah, Committee on Jewish Law and Standards of the Rabbinical Assembly](https://www.rabbinicalassembly.org/sites/default/files/public/halakhah/teshuvot/19861990/eisenberg_triennial.pdf)
|
|
19
|
-
|
|
20
|
-
Update December 2021: In November 2020, the CJLS modified the triennial
|
|
21
|
-
cycle for some combined parshiyot to change the reading for year 3 to be
|
|
22
|
-
the third section of the parashah.
|
|
23
|
-
|
|
24
|
-
[Modification of the Triennial Cycle Readings for Combined Parashot in Certain Years](https://www.rabbinicalassembly.org/sites/default/files/2021-09/cohen-triennial.pdf), Rabbi Miles B. Cohen
|
|
25
|
-
|
|
26
|
-
Update August 2022: Incorporated [An Emendation to Richard Eisenberg’s Complete Triennial System for Reading Torah, to Address a Rare Situation](https://www.rabbinicalassembly.org/sites/default/files/public/halakhah/teshuvot/2011-2020/heller-triennial-emendation.pdf), Rabbi Joshua Heller, 2012
|
|
9
|
+
Triennial Torah Readings have moved to [@hebcal/triennial](https://github.com/hebcal/hebcal-triennial)
|
|
27
10
|
|
|
28
11
|
## Installation
|
|
29
12
|
```bash
|
|
@@ -33,8 +16,7 @@ $ npm install @hebcal/leyning
|
|
|
33
16
|
## Synopsis
|
|
34
17
|
```javascript
|
|
35
18
|
import {HebrewCalendar, HDate, Event} from '@hebcal/core';
|
|
36
|
-
import {getLeyningForParshaHaShavua,
|
|
37
|
-
formatAliyahWithBook} from '@hebcal/leyning';
|
|
19
|
+
import {getLeyningForParshaHaShavua, formatAliyahWithBook} from '@hebcal/leyning';
|
|
38
20
|
|
|
39
21
|
const events = HebrewCalendar.calendar({sedrot: true, noHolidays: true});
|
|
40
22
|
const ev = events.find((ev) => ev.getDesc() == 'Parashat Pinchas');
|
|
@@ -50,26 +32,12 @@ for (const [num, aliyah] of Object.entries(reading.fullkriyah)) {
|
|
|
50
32
|
str += ` (${aliyah.v} verses)`;
|
|
51
33
|
console.log(`${number}: ${str}`);
|
|
52
34
|
}
|
|
53
|
-
const triReading = getTriennialForParshaHaShavua(ev);
|
|
54
|
-
for (const [num, aliyah] of Object.entries(triReading)) {
|
|
55
|
-
const number = num == 'M' ? 'maftir' : `aliyah ${num}`;
|
|
56
|
-
const str = formatAliyahWithBook(aliyah);
|
|
57
|
-
console.log(`Triennial ${number}: ${str}`);
|
|
58
|
-
}
|
|
59
35
|
```
|
|
60
36
|
|
|
61
|
-
## Classes
|
|
62
|
-
|
|
63
|
-
<dl>
|
|
64
|
-
<dt><a href="#Triennial">Triennial</a></dt>
|
|
65
|
-
<dd><p>Triennial Torah readings</p>
|
|
66
|
-
</dd>
|
|
67
|
-
</dl>
|
|
68
|
-
|
|
69
37
|
## Constants
|
|
70
38
|
|
|
71
39
|
<dl>
|
|
72
|
-
<dt><a href="#BOOK">BOOK</a></dt>
|
|
40
|
+
<dt><a href="#BOOK">BOOK</a> : <code>Array.<string></code></dt>
|
|
73
41
|
<dd><p>Names of the books of the Torah. BOOK[1] === 'Genesis'</p>
|
|
74
42
|
</dd>
|
|
75
43
|
</dl>
|
|
@@ -77,9 +45,16 @@ for (const [num, aliyah] of Object.entries(triReading)) {
|
|
|
77
45
|
## Functions
|
|
78
46
|
|
|
79
47
|
<dl>
|
|
80
|
-
<dt><
|
|
81
|
-
<dd><p>
|
|
82
|
-
|
|
48
|
+
<dt><a href="#parshaToString">parshaToString(parsha)</a> ⇒ <code>string</code></dt>
|
|
49
|
+
<dd><p>Formats parsha as a string</p>
|
|
50
|
+
</dd>
|
|
51
|
+
<dt><a href="#clone">clone(src)</a> ⇒ <code>any</code></dt>
|
|
52
|
+
<dd><p>Makes a deep copy of the src object using JSON stringify and parse</p>
|
|
53
|
+
</dd>
|
|
54
|
+
<dt><a href="#calculateNumVerses">calculateNumVerses(aliyah)</a> ⇒ <code>number</code></dt>
|
|
55
|
+
<dd><p>Calculates the number of verses in an aliyah or haftara based on
|
|
56
|
+
the <code>b</code> (begin verse), <code>e</code> (end verse) and <code>k</code> (book).
|
|
57
|
+
Modifies <code>aliyah</code> by setting the <code>v</code> field.</p>
|
|
83
58
|
</dd>
|
|
84
59
|
<dt><a href="#formatAliyahWithBook">formatAliyahWithBook(a)</a> ⇒ <code>string</code></dt>
|
|
85
60
|
<dd><p>Formats an aliyah object like "Numbers 28:9-28:15"</p>
|
|
@@ -87,16 +62,45 @@ CAUTION: Modifies the <code>aliyot</code> parameter instead of making a copy.</p
|
|
|
87
62
|
<dt><a href="#formatAliyahShort">formatAliyahShort(aliyah, showBook)</a> ⇒ <code>string</code></dt>
|
|
88
63
|
<dd><p>Formats an aliyah object like "Numbers 28:9-15"</p>
|
|
89
64
|
</dd>
|
|
90
|
-
<dt><a href="#
|
|
91
|
-
<dd><p>
|
|
65
|
+
<dt><a href="#sumVerses">sumVerses(aliyot)</a> ⇒ <code>number</code></dt>
|
|
66
|
+
<dd><p>Returns the total number of verses in an array of Aliyah (or haftarah) objects</p>
|
|
92
67
|
</dd>
|
|
93
|
-
<dt><a href="#
|
|
94
|
-
<dd><p>
|
|
95
|
-
|
|
68
|
+
<dt><a href="#makeLeyningParts">makeLeyningParts(aliyot)</a> ⇒ <code><a href="#Aliyah">Array.<Aliyah></a></code></dt>
|
|
69
|
+
<dd><p>Summarizes an <code>AliyotMap</code> by collapsing all adjacent aliyot.
|
|
70
|
+
Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)</p>
|
|
71
|
+
</dd>
|
|
72
|
+
<dt><a href="#makeSummaryFromParts">makeSummaryFromParts(parts)</a> ⇒ <code>string</code></dt>
|
|
73
|
+
<dd><p>Returns a string representation of the leyning parts.
|
|
74
|
+
Separate verse ranges read from the same book are separated
|
|
75
|
+
by commas, e.g. <code>Isaiah 6:1-7:6, 9:5-6</code>.
|
|
76
|
+
Verse ranges from different books are separated by semicolons,
|
|
77
|
+
e.g. <code>Genesis 21:1-34; Numbers 29:1-6</code>.</p>
|
|
96
78
|
</dd>
|
|
97
79
|
<dt><a href="#makeLeyningSummary">makeLeyningSummary(aliyot)</a> ⇒ <code>string</code></dt>
|
|
98
80
|
<dd><p>Makes a summary of the leyning, like "Genesis 6:9-11:32"</p>
|
|
99
81
|
</dd>
|
|
82
|
+
<dt><a href="#hasFestival">hasFestival(holiday)</a> ⇒ <code>boolean</code></dt>
|
|
83
|
+
<dd><p>Is there a special festival Torah Reading for <code>holiday</code>?</p>
|
|
84
|
+
</dd>
|
|
85
|
+
<dt><a href="#lookupFestival">lookupFestival(holiday)</a> ⇒ <code>any</code></dt>
|
|
86
|
+
<dd><p>Returns the raw metadata for festival reading for <code>holiday</code></p>
|
|
87
|
+
</dd>
|
|
88
|
+
<dt><a href="#getLeyningKeyForEvent">getLeyningKeyForEvent(ev, [il])</a> ⇒ <code>string</code></dt>
|
|
89
|
+
<dd><p>Based on the event date, type and title, finds the relevant leyning key</p>
|
|
90
|
+
</dd>
|
|
91
|
+
<dt><a href="#specialReadings">specialReadings(hd, il, aliyot, reason)</a> ⇒ <code><a href="#Aliyah">Aliyah</a></code> | <code><a href="#Aliyah">Array.<Aliyah></a></code></dt>
|
|
92
|
+
<dd><p>Determines if the regular parashat haShavua coincides with an event that requires
|
|
93
|
+
a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
|
|
94
|
+
Chodesh or Machar Chodesh, etc.).</p>
|
|
95
|
+
<p>If a special maftir occurs, modifies <code>aliyot</code> to replace <code>M</code> and sets <code>reason.M</code>
|
|
96
|
+
(and in some cases modifies the 6th and 7th aliyah, setting <code>reason['7']</code>).</p>
|
|
97
|
+
<p>If a special Haftarah applies, returns the Haftarah object and sets <code>reason.haftara</code>.
|
|
98
|
+
If no special Haftarah, returns <code>undefined</code></p>
|
|
99
|
+
</dd>
|
|
100
|
+
<dt><a href="#getLeyningForHoliday">getLeyningForHoliday(ev, [il])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
|
|
101
|
+
<dd><p>Looks up leyning for a given holiday. Returns some
|
|
102
|
+
of full kriyah aliyot, special Maftir, special Haftarah</p>
|
|
103
|
+
</dd>
|
|
100
104
|
<dt><a href="#getLeyningForHolidayKey">getLeyningForHolidayKey(key, [cholHaMoedDay])</a> ⇒ <code><a href="#Leyning">Leyning</a></code></dt>
|
|
101
105
|
<dd><p>Looks up leyning for a given holiday key. Key should be an
|
|
102
106
|
(untranslated) string used in holiday-readings.json. Returns some
|
|
@@ -118,14 +122,11 @@ reading for that day (see <a href="#getLeyningForHoliday">getLeyningForHoliday</
|
|
|
118
122
|
Parashat haShavua, containing only the <code>weekday</code> aliyot (no <code>fullkriyah</code>).</p>
|
|
119
123
|
<p>Otherwise, returns <code>undefined</code>.</p>
|
|
120
124
|
</dd>
|
|
121
|
-
<dt><a href="#
|
|
122
|
-
<dd><p>
|
|
125
|
+
<dt><a href="#lookupParsha">lookupParsha(parsha)</a> ⇒ <code><a href="#ParshaMeta">ParshaMeta</a></code></dt>
|
|
126
|
+
<dd><p>Returns the parsha metadata</p>
|
|
123
127
|
</dd>
|
|
124
|
-
<dt><a href="#
|
|
125
|
-
<dd><p>
|
|
126
|
-
</dd>
|
|
127
|
-
<dt><a href="#getTriennialHaftaraForHoliday">getTriennialHaftaraForHoliday(key, yearNum)</a> ⇒ <code>Object</code></dt>
|
|
128
|
-
<dd><p>Looks up the alternative triennial Haftara for a holiday</p>
|
|
128
|
+
<dt><a href="#writeCsvLines">writeCsvLines(stream, ev, reading, il, isParsha)</a></dt>
|
|
129
|
+
<dd><p>Formats reading for CSV</p>
|
|
129
130
|
</dd>
|
|
130
131
|
</dl>
|
|
131
132
|
|
|
@@ -141,126 +142,150 @@ Parashat haShavua, containing only the <code>weekday</code> aliyot (no <code>ful
|
|
|
141
142
|
<dt><a href="#Leyning">Leyning</a> : <code>Object</code></dt>
|
|
142
143
|
<dd><p>Leyning for a parsha hashavua or holiday</p>
|
|
143
144
|
</dd>
|
|
144
|
-
<dt><a href="#
|
|
145
|
-
<dd><p>
|
|
145
|
+
<dt><a href="#ParshaMeta">ParshaMeta</a> : <code>Object</code></dt>
|
|
146
|
+
<dd><p>Parsha metadata</p>
|
|
146
147
|
</dd>
|
|
147
148
|
</dl>
|
|
148
149
|
|
|
149
|
-
<a name="
|
|
150
|
+
<a name="BOOK"></a>
|
|
150
151
|
|
|
151
|
-
##
|
|
152
|
-
|
|
152
|
+
## BOOK : <code>Array.<string></code>
|
|
153
|
+
Names of the books of the Torah. BOOK[1] === 'Genesis'
|
|
153
154
|
|
|
154
|
-
**Kind**: global
|
|
155
|
+
**Kind**: global constant
|
|
156
|
+
**Read only**: true
|
|
157
|
+
<a name="parshaToString"></a>
|
|
155
158
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
* _instance_
|
|
159
|
-
* [.getReading(parsha, yearNum)](#Triennial+getReading) ⇒ <code>Object.<string, Aliyah></code>
|
|
160
|
-
* [.getStartYear()](#Triennial+getStartYear) ⇒ <code>number</code>
|
|
161
|
-
* [.debug()](#Triennial+debug) ⇒ <code>string</code>
|
|
162
|
-
* _static_
|
|
163
|
-
* [.getYearNumber(year)](#Triennial.getYearNumber) ⇒ <code>number</code>
|
|
164
|
-
* [.getCycleStartYear(year)](#Triennial.getCycleStartYear) ⇒ <code>number</code>
|
|
159
|
+
## parshaToString(parsha) ⇒ <code>string</code>
|
|
160
|
+
Formats parsha as a string
|
|
165
161
|
|
|
166
|
-
|
|
162
|
+
**Kind**: global function
|
|
167
163
|
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
| Param | Type |
|
|
165
|
+
| --- | --- |
|
|
166
|
+
| parsha | <code>Array.<string></code> |
|
|
170
167
|
|
|
168
|
+
<a name="clone"></a>
|
|
171
169
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
| [hebrewYear] | <code>number</code> | Hebrew Year (default current year) |
|
|
170
|
+
## clone(src) ⇒ <code>any</code>
|
|
171
|
+
Makes a deep copy of the src object using JSON stringify and parse
|
|
175
172
|
|
|
176
|
-
|
|
173
|
+
**Kind**: global function
|
|
177
174
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
| Param | Type |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| src | <code>any</code> |
|
|
181
178
|
|
|
182
|
-
|
|
183
|
-
| --- | --- | --- |
|
|
184
|
-
| parsha | <code>string</code> | parsha name ("Bereshit" or "Achrei Mot-Kedoshim") |
|
|
185
|
-
| yearNum | <code>number</code> | 0 through 2 for which year of Triennial cycle |
|
|
179
|
+
<a name="calculateNumVerses"></a>
|
|
186
180
|
|
|
187
|
-
<
|
|
181
|
+
## calculateNumVerses(aliyah) ⇒ <code>number</code>
|
|
182
|
+
Calculates the number of verses in an aliyah or haftara based on
|
|
183
|
+
the `b` (begin verse), `e` (end verse) and `k` (book).
|
|
184
|
+
Modifies `aliyah` by setting the `v` field.
|
|
188
185
|
|
|
189
|
-
|
|
190
|
-
**Kind**: instance method of [<code>Triennial</code>](#Triennial)
|
|
191
|
-
<a name="Triennial+debug"></a>
|
|
186
|
+
**Kind**: global function
|
|
192
187
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
<
|
|
188
|
+
| Param | Type |
|
|
189
|
+
| --- | --- |
|
|
190
|
+
| aliyah | [<code>Aliyah</code>](#Aliyah) |
|
|
196
191
|
|
|
197
|
-
|
|
198
|
-
Returns triennial year 1, 2 or 3 based on this Hebrew year
|
|
192
|
+
<a name="formatAliyahWithBook"></a>
|
|
199
193
|
|
|
200
|
-
|
|
194
|
+
## formatAliyahWithBook(a) ⇒ <code>string</code>
|
|
195
|
+
Formats an aliyah object like "Numbers 28:9-28:15"
|
|
196
|
+
|
|
197
|
+
**Kind**: global function
|
|
201
198
|
|
|
202
199
|
| Param | Type | Description |
|
|
203
200
|
| --- | --- | --- |
|
|
204
|
-
|
|
|
201
|
+
| a | [<code>Aliyah</code>](#Aliyah) | aliyah |
|
|
202
|
+
|
|
203
|
+
<a name="formatAliyahShort"></a>
|
|
205
204
|
|
|
206
|
-
<
|
|
205
|
+
## formatAliyahShort(aliyah, showBook) ⇒ <code>string</code>
|
|
206
|
+
Formats an aliyah object like "Numbers 28:9-15"
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
Returns Hebrew year that this 3-year triennial cycle began
|
|
208
|
+
**Kind**: global function
|
|
210
209
|
|
|
211
|
-
|
|
210
|
+
| Param | Type |
|
|
211
|
+
| --- | --- |
|
|
212
|
+
| aliyah | [<code>Aliyah</code>](#Aliyah) |
|
|
213
|
+
| showBook | <code>boolean</code> |
|
|
212
214
|
|
|
213
|
-
|
|
214
|
-
| --- | --- | --- |
|
|
215
|
-
| year | <code>number</code> | Hebrew year |
|
|
215
|
+
<a name="sumVerses"></a>
|
|
216
216
|
|
|
217
|
-
<
|
|
217
|
+
## sumVerses(aliyot) ⇒ <code>number</code>
|
|
218
|
+
Returns the total number of verses in an array of Aliyah (or haftarah) objects
|
|
218
219
|
|
|
219
|
-
|
|
220
|
-
Names of the books of the Torah. BOOK[1] === 'Genesis'
|
|
220
|
+
**Kind**: global function
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
| Param | Type |
|
|
223
|
+
| --- | --- |
|
|
224
|
+
| aliyot | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) |
|
|
224
225
|
|
|
225
|
-
|
|
226
|
-
***Deprecated***
|
|
226
|
+
<a name="makeLeyningParts"></a>
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
## makeLeyningParts(aliyot) ⇒ [<code>Array.<Aliyah></code>](#Aliyah)
|
|
229
|
+
Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
|
|
230
|
+
Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
|
|
230
231
|
|
|
231
232
|
**Kind**: global function
|
|
232
233
|
|
|
233
|
-
| Param | Type |
|
|
234
|
-
| --- | --- |
|
|
235
|
-
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
236
|
-
| showBook | <code>boolean</code> | display the book name in the `verses` field (e.g. for special Maftir) |
|
|
234
|
+
| Param | Type |
|
|
235
|
+
| --- | --- |
|
|
236
|
+
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
237
237
|
|
|
238
|
-
<a name="
|
|
238
|
+
<a name="makeSummaryFromParts"></a>
|
|
239
239
|
|
|
240
|
-
##
|
|
241
|
-
|
|
240
|
+
## makeSummaryFromParts(parts) ⇒ <code>string</code>
|
|
241
|
+
Returns a string representation of the leyning parts.
|
|
242
|
+
Separate verse ranges read from the same book are separated
|
|
243
|
+
by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
|
|
244
|
+
Verse ranges from different books are separated by semicolons,
|
|
245
|
+
e.g. `Genesis 21:1-34; Numbers 29:1-6`.
|
|
242
246
|
|
|
243
247
|
**Kind**: global function
|
|
244
248
|
|
|
245
|
-
| Param | Type |
|
|
246
|
-
| --- | --- |
|
|
247
|
-
|
|
|
249
|
+
| Param | Type |
|
|
250
|
+
| --- | --- |
|
|
251
|
+
| parts | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) |
|
|
248
252
|
|
|
249
|
-
<a name="
|
|
253
|
+
<a name="makeLeyningSummary"></a>
|
|
250
254
|
|
|
251
|
-
##
|
|
252
|
-
|
|
255
|
+
## makeLeyningSummary(aliyot) ⇒ <code>string</code>
|
|
256
|
+
Makes a summary of the leyning, like "Genesis 6:9-11:32"
|
|
253
257
|
|
|
254
258
|
**Kind**: global function
|
|
255
259
|
|
|
256
260
|
| Param | Type |
|
|
257
261
|
| --- | --- |
|
|
258
|
-
|
|
|
259
|
-
|
|
262
|
+
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
263
|
+
|
|
264
|
+
<a name="hasFestival"></a>
|
|
265
|
+
|
|
266
|
+
## hasFestival(holiday) ⇒ <code>boolean</code>
|
|
267
|
+
Is there a special festival Torah Reading for `holiday`?
|
|
268
|
+
|
|
269
|
+
**Kind**: global function
|
|
270
|
+
|
|
271
|
+
| Param | Type |
|
|
272
|
+
| --- | --- |
|
|
273
|
+
| holiday | <code>string</code> |
|
|
274
|
+
|
|
275
|
+
<a name="lookupFestival"></a>
|
|
276
|
+
|
|
277
|
+
## lookupFestival(holiday) ⇒ <code>any</code>
|
|
278
|
+
Returns the raw metadata for festival reading for `holiday`
|
|
279
|
+
|
|
280
|
+
**Kind**: global function
|
|
281
|
+
|
|
282
|
+
| Param | Type |
|
|
283
|
+
| --- | --- |
|
|
284
|
+
| holiday | <code>string</code> |
|
|
260
285
|
|
|
261
286
|
<a name="getLeyningKeyForEvent"></a>
|
|
262
287
|
|
|
263
|
-
## getLeyningKeyForEvent(
|
|
288
|
+
## getLeyningKeyForEvent(ev, [il]) ⇒ <code>string</code>
|
|
264
289
|
Based on the event date, type and title, finds the relevant leyning key
|
|
265
290
|
|
|
266
291
|
**Kind**: global function
|
|
@@ -268,12 +293,34 @@ Based on the event date, type and title, finds the relevant leyning key
|
|
|
268
293
|
|
|
269
294
|
| Param | Type | Default | Description |
|
|
270
295
|
| --- | --- | --- | --- |
|
|
271
|
-
|
|
|
296
|
+
| ev | <code>Event</code> | | event |
|
|
272
297
|
| [il] | <code>boolean</code> | <code>false</code> | true if Israel holiday scheme |
|
|
273
298
|
|
|
299
|
+
<a name="specialReadings"></a>
|
|
300
|
+
|
|
301
|
+
## specialReadings(hd, il, aliyot, reason) ⇒ [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah)
|
|
302
|
+
Determines if the regular parashat haShavua coincides with an event that requires
|
|
303
|
+
a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
|
|
304
|
+
Chodesh or Machar Chodesh, etc.).
|
|
305
|
+
|
|
306
|
+
If a special maftir occurs, modifies `aliyot` to replace `M` and sets `reason.M`
|
|
307
|
+
(and in some cases modifies the 6th and 7th aliyah, setting `reason['7']`).
|
|
308
|
+
|
|
309
|
+
If a special Haftarah applies, returns the Haftarah object and sets `reason.haftara`.
|
|
310
|
+
If no special Haftarah, returns `undefined`
|
|
311
|
+
|
|
312
|
+
**Kind**: global function
|
|
313
|
+
|
|
314
|
+
| Param | Type |
|
|
315
|
+
| --- | --- |
|
|
316
|
+
| hd | <code>HDate</code> |
|
|
317
|
+
| il | <code>boolean</code> |
|
|
318
|
+
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
319
|
+
| reason | <code>Object.<string, string></code> |
|
|
320
|
+
|
|
274
321
|
<a name="getLeyningForHoliday"></a>
|
|
275
322
|
|
|
276
|
-
## getLeyningForHoliday(
|
|
323
|
+
## getLeyningForHoliday(ev, [il]) ⇒ [<code>Leyning</code>](#Leyning)
|
|
277
324
|
Looks up leyning for a given holiday. Returns some
|
|
278
325
|
of full kriyah aliyot, special Maftir, special Haftarah
|
|
279
326
|
|
|
@@ -282,20 +329,9 @@ of full kriyah aliyot, special Maftir, special Haftarah
|
|
|
282
329
|
|
|
283
330
|
| Param | Type | Default | Description |
|
|
284
331
|
| --- | --- | --- | --- |
|
|
285
|
-
|
|
|
332
|
+
| ev | <code>Event</code> | | the Hebcal event associated with this leyning |
|
|
286
333
|
| [il] | <code>boolean</code> | <code>false</code> | true if Israel holiday scheme |
|
|
287
334
|
|
|
288
|
-
<a name="makeLeyningSummary"></a>
|
|
289
|
-
|
|
290
|
-
## makeLeyningSummary(aliyot) ⇒ <code>string</code>
|
|
291
|
-
Makes a summary of the leyning, like "Genesis 6:9-11:32"
|
|
292
|
-
|
|
293
|
-
**Kind**: global function
|
|
294
|
-
|
|
295
|
-
| Param | Type |
|
|
296
|
-
| --- | --- |
|
|
297
|
-
| aliyot | <code>Object.<string, Aliyah></code> |
|
|
298
|
-
|
|
299
335
|
<a name="getLeyningForHolidayKey"></a>
|
|
300
336
|
|
|
301
337
|
## getLeyningForHolidayKey(key, [cholHaMoedDay]) ⇒ [<code>Leyning</code>](#Leyning)
|
|
@@ -364,41 +400,31 @@ Otherwise, returns `undefined`.
|
|
|
364
400
|
| hdate | <code>HDate</code> | Hebrew Date |
|
|
365
401
|
| il | <code>boolean</code> | in Israel |
|
|
366
402
|
|
|
367
|
-
<a name="
|
|
403
|
+
<a name="lookupParsha"></a>
|
|
368
404
|
|
|
369
|
-
##
|
|
370
|
-
|
|
405
|
+
## lookupParsha(parsha) ⇒ [<code>ParshaMeta</code>](#ParshaMeta)
|
|
406
|
+
Returns the parsha metadata
|
|
371
407
|
|
|
372
408
|
**Kind**: global function
|
|
373
409
|
|
|
374
|
-
| Param | Type |
|
|
375
|
-
| --- | --- |
|
|
376
|
-
|
|
|
377
|
-
|
|
378
|
-
<a name="getTriennialForParshaHaShavua"></a>
|
|
379
|
-
|
|
380
|
-
## getTriennialForParshaHaShavua(ev, [context]) ⇒ [<code>TriennialAliyot</code>](#TriennialAliyot) \| <code>Object.<string, Aliyah></code>
|
|
381
|
-
Looks up the triennial leyning for this Parashat HaShavua
|
|
382
|
-
|
|
383
|
-
**Kind**: global function
|
|
384
|
-
**Returns**: [<code>TriennialAliyot</code>](#TriennialAliyot) \| <code>Object.<string, Aliyah></code> - a map of aliyot 1-7 plus "M"
|
|
385
|
-
|
|
386
|
-
| Param | Type | Default | Description |
|
|
387
|
-
| --- | --- | --- | --- |
|
|
388
|
-
| ev | <code>Event</code> | | |
|
|
389
|
-
| [context] | <code>boolean</code> | <code>false</code> | returns a reading wrapper object which includes `date`, `yearNum` and `aliyot` |
|
|
410
|
+
| Param | Type |
|
|
411
|
+
| --- | --- |
|
|
412
|
+
| parsha | <code>string</code> \| <code>Array.<string></code> |
|
|
390
413
|
|
|
391
|
-
<a name="
|
|
414
|
+
<a name="writeCsvLines"></a>
|
|
392
415
|
|
|
393
|
-
##
|
|
394
|
-
|
|
416
|
+
## writeCsvLines(stream, ev, reading, il, isParsha)
|
|
417
|
+
Formats reading for CSV
|
|
395
418
|
|
|
396
419
|
**Kind**: global function
|
|
397
420
|
|
|
398
421
|
| Param | Type |
|
|
399
422
|
| --- | --- |
|
|
400
|
-
|
|
|
401
|
-
|
|
|
423
|
+
| stream | <code>fs.WriteStream</code> |
|
|
424
|
+
| ev | <code>Event</code> |
|
|
425
|
+
| reading | [<code>Leyning</code>](#Leyning) |
|
|
426
|
+
| il | <code>boolean</code> |
|
|
427
|
+
| isParsha | <code>boolean</code> |
|
|
402
428
|
|
|
403
429
|
<a name="Aliyah"></a>
|
|
404
430
|
|
|
@@ -441,7 +467,7 @@ Leyning for a parsha hashavua or holiday
|
|
|
441
467
|
| --- | --- | --- |
|
|
442
468
|
| name | [<code>LeyningNames</code>](#LeyningNames) | |
|
|
443
469
|
| [parsha] | <code>Array.<string></code> | An array of either 1 (regular) or 2 (doubled parsha). `undefined` for holiday readings |
|
|
444
|
-
| [parshaNum] | <code>
|
|
470
|
+
| [parshaNum] | <code>number</code> | 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings |
|
|
445
471
|
| summary | <code>string</code> | Such as `Genesis 1:1 - 6:8` |
|
|
446
472
|
| haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) |
|
|
447
473
|
| haftara | <code>string</code> | Haftarah, such as `Isaiah 42:5 – 43:11` |
|
|
@@ -453,19 +479,20 @@ Leyning for a parsha hashavua or holiday
|
|
|
453
479
|
| [weekday] | <code>Object.<string, Aliyah></code> | Optional map of weekday Torah Readings aliyot `1` through `3` for Monday and Thursday |
|
|
454
480
|
| [reason] | <code>Object.<string, string></code> | Explanations for special readings, keyed by aliyah number, `M` for maftir or `haftara` for Haftarah |
|
|
455
481
|
|
|
456
|
-
<a name="
|
|
482
|
+
<a name="ParshaMeta"></a>
|
|
457
483
|
|
|
458
|
-
##
|
|
459
|
-
|
|
484
|
+
## ParshaMeta : <code>Object</code>
|
|
485
|
+
Parsha metadata
|
|
460
486
|
|
|
461
487
|
**Kind**: global typedef
|
|
462
488
|
**Properties**
|
|
463
489
|
|
|
464
490
|
| Name | Type | Description |
|
|
465
491
|
| --- | --- | --- |
|
|
466
|
-
|
|
|
467
|
-
|
|
|
468
|
-
|
|
|
469
|
-
|
|
|
470
|
-
| [
|
|
471
|
-
|
|
|
492
|
+
| num | <code>number</code> | 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings |
|
|
493
|
+
| hebrew | <code>string</code> | parsha name in Hebrew with niqud |
|
|
494
|
+
| book | <code>number</code> | 1 for Genesis, 2 for Exodus, 5 for Deuteronomy |
|
|
495
|
+
| haft | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) |
|
|
496
|
+
| [seph] | [<code>Aliyah</code>](#Aliyah) \| [<code>Array.<Aliyah></code>](#Aliyah) | Haftarah object(s) for Sephardim |
|
|
497
|
+
| fullkriyah | <code>Object.<string, Array.<string>></code> | Map of aliyot `1` through `7` plus `M` for maftir |
|
|
498
|
+
| weekday | <code>Object.<string, Array.<string>></code> | Map of weekday Torah Readings aliyot `1` through `3` for Monday and Thursday |
|