New Plugin: Bible Reference Plugin (Alpha)

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:

  1. Create a link for a Bible passage reference (ex: “1 Cor 1:1-3”).
  2. Hover over the link (editor or preview).
  3. 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.
9 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)

1 Like

Do you have a solution for the “:” yet, i love this plugin and thank you for it.

1 Like