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.