BibleGateway-to-Obsidian Script
👉 Download the script to import on github. There you can also find the most recent documentation.
I simplified and documented usage as much as possible. So even if you are not familiar with scripting, you will be walked through it. If you run into issues, feel free to Get in contact. If you receive value from, consider to join in Support 🤝.
Find the documentation for the script below.
BibleGateway-to-Obsidian
This script adapts jgclark’s wonderful BibleGateway-to-Markdown script to export well for use in Obsidian.
What the script does is fetch the text from Bible Gateway and save it as formatted markdown file. Each chapter is saved as one file and navigation between files as well as a book-file is automatically created. All of the chapter files of a book are saved in it’s numbered folder.
This script is intended to be as simple as possible to use, even if you have no idea about Scripting. If you have any questions, please reach out to me either on github or Discord (selfire#3095).
Important Disclaimers
- This is not affiliated to, or approved by, BibleGateway.com. In my understanding it fits into the conditions of usage but I make no guarantee regarding the usage of the script, it is at your own disgression.
- By default, the version is set to the NET Bible. You can change the version, as long as you honour the copyright standards of different translations of the Bible (See: BibleGateways overview).
- I have little experience in scripting–through this project I taught myself bash and regex basics. If you run into issues or have a way to simplify this script, please raise an issue or reach out on Discord (
selfire#3095).
Installation
Here are the tools we are going to use:
- Our command line (Terminal)
- A text editor (like Atom).
Setting ruby up
Updating
In order to run the scripts, we will need to install ruby. Ruby comes pre-installed on MacOS but if you run into issues, update to the latest version.
Downloading BibleGateway-to-Markdown.rb
Follow the instructions to download and set up jgclark’s BibleGateway-to-Markdown.
Usage
1. Navigate to the directory in which both scripts are located.
Open terminal. Use the following command to navigate to the folder in which both scripts are located:
pwdShow your current directorylsList all contents in the current directorycdEnter ‘down’ in a subdirectory (E.g.cd Desktop)cd ..Brings you ‘up’ one directory
2. Run the script
Once you are in the directory, run bash bg2obs.sh. This will run the bash script.
NOTE: In this directory, a folder called Scripture with subfolders like 01 - Genesis, 02 - Exodus and so on will be created.
Within the bg2obs.sh file you have the options to include headers and set the words of Jesus to bold. By default, both options are set to false.
3. Format the text in a text editor
We will need to format the output to work well in Obsidian.
- Open Atom (or the like).
- Open the
Scripturefolder withFile > Add Project Folder…(orShift + Command + O - Open project-wide search with
Shift + Command + F
Next up we are going to run two Regex-searches to find and replace in our whole project.
- Enable Regex. Click the
.*Icon. - Run the first search. This clears unnecessary headers:
- Find:
#.*(#####\D[1]\D) - Replace:
#$1 - file:
*.md
- Run the second search. This formats verses into h6:
- Find:
######\s([0-9]\s|[0-9][0-9]\s|[0-9][0-9][0-9]\s) - Replace:
\n\nv$1\n - file:
*.md
There you go! Now, just move the “Scripture” folder into your Obsidian vault. You can use the provided The Bible.md file as an overview file.
Translations
This script downloads the World English Bible by default. If you wish to use a different translation, open the bg2obs.sh file in a text editor and follow the annotations in there (It is just changing one line). Make sure to honour copyright guidelines.