Hi all,
I like to journal when reading the Bible and wanted to try using obsidian. Biggest missing component was actually getting passages into that flow. A few hours later and here we are with an alpha of my first plugin: the Bible Reference Plugin!
TL;DR:
- Create a link for a Bible passage reference (ex: “1 Cor 1:1-3”).
- Hover over the link (editor or preview).
- The plugin grabs the passage html and puts it in a separate note for use.
And that’s it. You now can hover over the link and it will render the passage html in the preview.
How it works:
- Plugin triggers on link “hover” events
- Checks if link text matches Bible Reference regex
- Checks if note already exists for the passage
- Reaches out to ESV.org for the passage data
- Throws the passage html into a new note
- Cleans up the link text with the passage canonical form
Gif is worth 1000 words:
Other Important Stuff:
- This is alpha, so standard “I’m not liable for breaking the universe” thing
- The ESV.org API requires a token which you need to generate on their website after creating an account (see README for details). I’ll see about making one to share (there are API limits), but for now you need your own. I think token generation is manual, so it may take a few days for them to respond.
- Speaking of, the ESV.org API has limits on request count and amount cached. IMPORTANT: this plugin is non-custodial so YOU are responsible for adhering to these limits.
- Maybe in the future, I will add automation to stay within the storage bounds (delete the oldest-used passage note to keep a cyclical cache), but for now, be mindful of what you are pulling. You can safely delete passage notes and they will be re-queried next time the reference link is previewed.
Even More:
- There are a handful of settings that the ESV.org API supports and I’ve added the ones that make sense. Configuration for these are in the settings.
- This is my first plugin and I have no idea what I’m doing. Would love feedback!
- Plugin is far from finished. I know it needs some cleanup. I literally wrote it today, so its thrown together.
- I will make it an official plugin when things are tested a bit more. For now you will need to install manually.
16 Likes
Thanks for sharing! I’m really interested to see how this will develops. What happens if you already have the passage in your system somewhere (such as a plain text bible)?
Right now im caching the passages by reference (a file gets created with the name “1 Corinthians 1:2-4”, for example). I got some information from ESV.org about downloading an entire copy of the bible which seems to include a custom (?) index of bible content which can be used for querying effectively. Without an index in the plain text bible, might be hard to reliably get the right passages.
After using this plugin myself for a few weeks, I think i’m going to overhaul the way the plugin works due to some unforeseen issues (illegal to have “:” in filenames, on-hover events dont make sense on mobile, etc). When I refactor things, I will think about setting things up in a way that can hook into other sources for the bible (other translations and local copies of the text)
2 Likes
Do you have a solution for the “:” yet, i love this plugin and thank you for it.
2 Likes
Hi there,
Just want to mention the Obsidian Bible Reference plugin I built. I release the first release in November 2021, without noticing @scottTomaszewski 's thread here.
The way of how the plugin works is different too.
It is a bit awkward, because the name is nearly the same. Even the function is different.
I adore this plug-in, however there is something either wreong in the plug-on or with ESV API.
There are 20-30 verses missing and when one is missing the numbers get off. It’s all fine until you hit Matthew 12:47 and then after that there are multiple spots broken.
So Matthew 47 in your plug-in is actually Matthew 48. Then because of this issue 50 gets omitted. Not sure how many times this happens but it’s 20-30 times there for you end up with several books that are messed up. I wish I had the time to go find all 20-30 but it took me days of going nuts just to figure out why scriptures were often not lining up with the right scripture.
My assumption since the code seems right is the API itself must be wrong or have some missing verses (ie in this case 47 is missing so all the values get bumped up one verse, at least until the next chapter?)
Update:
I did figure out the reason. The ESV has some verses omitted and when this happens in the plugin the verse is not “skipped” and so the next verse has the wrong number.
IE: Matthew 47 is omitted, but should still be counted as verse 47 but in the plugin the next verse which should be 48 is being numbered 47, then 48, 49 and 50 are also wrong.
The list of all the times this happens:
Matthew 12:47
Matthew 17:21
Matthew 18:11
Matthew 23:14
Mark 7:16
Mark 9:44
Mark 9:46
Mark 11:26
Mark 15:28
Luke 17:36
Luke 23:17
John 5:4
Acts 8:37
Acts 15:34
Acts 24:7
Acts 28:29
Romans 16:24