1.2.0 • Published 6 years ago

@flatland/sermon-note-parser v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Sermon Note Parser

At Flatland Church we want to provide our people the ability to take notes during our Sunday morning service as well as online afterward.

One of the challenges we were faced with was a reusable format for notes that can be written like Markdown but can contain fill-in notes, spots to take free notes, as well as a special format to indicate Bible verses.

The resulting parser creates a tree with 4 possible node types: text, fill_in, note, and verse.

Note Tree

A note tree node will consist of the following values:

PropertyDescriptionPresent On
typeThe type the node belongs to, one of: text, fill_in, note, or versetext, fill_in, note, verse
textThe content of the node, be it a line of text, the answer to fill-in, or verse contenttext, fill_in, verse
lineBreakAfterWhether a line break was present in the original document following this node. Always true for notetext, fill_in, note, verse
idA unique identifier of each node. This is useful for matching saved user generated data to the document.text, fill_in, note, verse
refData related to the verse in question.verse

Verse Ref

PropertyDescription
bookThe book of the Bible the verse comes from
chapterThe chapter of the book of the Bible the verse comes from
verseThe verse of the book of the Bible
versionThe version of the Bible the verse is quoting

Example:

[
    {
        type: 'text',
        text: '1. The most important thing to remember is ',
        id: 'abc123',
        lineBreakAfter: false,
    },
    {
        type: 'fill_in',
        text: 'Jesus',
        id: 'abc231',
        lineBreakAfter: false,
    },
    {
        type: 'note',
        id: 'abc312',
        lineBreakAfter: true,
    },
    {
        type: 'verse',
        id: 'abc213',
        lineBreakAfter: true,
        text: 'but whose delight is in the law of the LORD, and who meditates on his law day and night.',
        ref: {
            book: 'Psalm',
            chapter: 1,
            verse: 2,
        },
    },
]

Note Text Format

Our note text format (the input text) is designed to be able to work with standard markdown, so any additions we've created for fill-ins, notes, and verses should not clash with a standard markdown document.

Fill In

In order to put a fill-in-the-blank note into your text, simply enclose it with angle brackets:

1. The most important thing to remember is <Jesus> loves you

Note

Notes can be added anywhere in the document. A note is simply an asterisk (*) enclosed with angle brackets:

There are many times throughout the Bible where we see God's in action. <*>

Something to note here is that while you are free to use the resulting tree any way you like, for our use case we've made a business rule that notes will always be followed by a line break. Thus the lineBreakAfter prop will be set to true any time a note is present.

Verse

Verses are the most complicated of the bunch. In order to get the most bang for your buck you'll need to precede each verse with it's verse number enclosed in square brackets [14]. You'll also want to follow up your verse with what we call Verse Matter on the following line: | Book | Chapter | Version |. Here's an example:

[1] Blessed is the one who does not walk in step with the wicked or stand in the way that sinners take or sit in the company of mockers, [2] but whose delight is in the law of the LORD, and who meditates on his law day and night.
| Psalm | 1 | NIV |
1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago