Organising The Bible in Obsidian

Hi everybody !

I’ve just released an early alpha for a plugin I’ve been building for my bible studies within Obsidian. It allows linking to a range of headings, not only one heading, using an extended [[Page#HeadingA#HeadingB]] format. Bible link to a verse range is something I’ve been struggling with for a long time within Obsidian, with some hackish solutions I was never satisfied with !

Hopefully that plugin could become useful for some of you (at least, it will be for me).
Any help on the development and/or debugging / testing / feedback is very welcome.

EDIT : I got a few questions, so for those who wonder : the plugin is not yet available on the official community list (request pending) but meanwhile you can install it using @TfTHacker’s awesome Obsidian42 - BRAT plugin.

5 Likes

Greetings~

New & improved Berean Study Bible with Strongs definitions.

5 Likes

That looks like a great solution to the seemingly-perpetual problem of linking to a range of verses. Thanks for all the work you put into it!

1 Like

Awesome project. Would you mind giving us a hint on how that Bible was built ? I guess you have coded some scripts to parse the BSB and build a markdownized version of it ?

1 Like

Thank you @Limezy . I appreciate your interest and would be happy to share a bit of my workflow.

For this project, the BSB text along with the mapping to the strongs numbers was derived from BibleHub.com / OpenBible.

I used a variety of tools (mostly CLI) to parse the HTML into text:

curl
wget
html2md
jq
htmlq
xq

The data for the strongs lexicon was originally derived (many years ago) from multiple sources for a personal Bible study app I use. The data is stored in a local MySQL database for queries.

For examples:

curl --silent https://biblehub.com/text/john/3-16.htm | htmlq --text '.eng'

returns:

Thus
for
loved
 -
God
the
world,
that
the
Son,
the
only begotten,
He gave,
so that
everyone
 -
believing
in
Him
not
should perish,
but
should have
life
eternal.

Then, this command grabs the matching strongs numbers

curl --silent https://biblehub.com/text/john/3-16.htm | htmlq --text '.maintext tr a[title^="Strong"]'

returns:

3779
1063
25
3588
2316
3588
2889
5620
3588
5207
3588
3439
1325
2443
3956
3588
4100
1519
846
3361
622
235
2192
2222
166

This data is then processed further with a variety of custom bash & PHP scripts to create the markdown and linking.

For example:

#!/bin/bash
BOOK     = $1
CHAPTER  = $2
VERSE    = $3
COVENANT = $4

syslog -s "----"
syslog -s "Book: ${BOOK}, Chapter: ${CHAPTER}, Verse: ${VERSE}"

strongs = `/usr/bin/curl --silent https://openbible.com/strongs/${BOOK}/${CHAPTER}-${VERSE}.htm | /usr/local/bin/htmlq --text 'span.str a:only-child' | sed "s;Strong's\ ;;g" | sed 's;:;;g'`
words   = `/usr/bin/curl --silent https://openbible.com/strongs/${BOOK}/${CHAPTER}-${VERSE}.htm | /usr/local/bin/htmlq --text '.word'`

# echo "---";
# echo ${words};
# echo "---";
# echo ${strongs};
# echo "---";

syslog -s "----"
syslog -s "Words: ${words}"
syslog -s "----"
syslog -s "Strongs: ${strongs}"

SAVEIFS = $IFS       # Save current IFS (Internal Field Separator)
IFS     = $'\n'      # Change IFS to newline char
wd_arr  = ($words)   # split the `names` string into an array by the same name
st_arr  = ($strongs) # split the `names` string into an array by the same name
IFS     = $SAVEIFS   # Restore original IFS

verse=''
for index in "${!st_arr[@]}"
do
  if [ ${COVENANT} == '1' ]; then 
    verse += "${wd_arr[$index]}[[H${st_arr[${index}]%:*}]]"
  else
    verse += "${wd_arr[$index]}[[G${st_arr[${index}]%:*}]]"
  fi
done

echo ${verse}
exit
<?php

$cmd = '/path/to/lex.sh '.str_replace(" ", "_", strtolower($cmd_bk)).' '.$i.' '.$val->verse.' '.$book->covenant;;

echo "⏰ ".date("H:i:s").PHP_EOL;
echo '> running command: '.$cmd.PHP_EOL;

exec($cmd, $output, $retval);

echo "# Returned with status $retval and output:".PHP_EOL;

echo $output[0].PHP_EOL; // print_r($output);

// $md .= str_replace("�","",str_replace(" ]]","]]",str_replace("[[HHebrew]]","[[H0000]]",$output[0]))).PHP_EOL.PHP_EOL;

$find    = array("�"," ]]","[[HHebrew]]","[[H0]]");
$replace = array("","]]","","");
$md     .= str_replace($find,$replace,$output[0]).PHP_EOL.PHP_EOL;

// ...

I enjoy scripting and working with data, so projects like this are challenging and good practice.

As a side note, I am currently available for “consulting” work. I can help with just about any interesting Obsidian Vault data/import/export project. And, of course, I’m happy to answer any questions anyone has here on the forum.

Thanks for these insights, that’s truely impressive !
I do a lot of these kind of parsing projects, also to 'markdownize" Bibles or Theology texts.
It’s fun but quite challenging !

Hithere,

I wrote an Application which fetches german Versions from bibleserver.com.

It automatically makes the matching folders and files for the Bible-Linker.

Bible-Crawler-Rust

If you want to have more Versions in other languages, you can open an Issue.

I hope this helps.

Greetings,
Simerl

1 Like