Coder Social home page Coder Social logo

biblegateway-to-obsidian's Introduction

BibleGateway-to-Obsidian

This script adapts jgclark's BibleGateway-to-Markdown script to export for use in Obsidian. It accompanies a Bible Study in Obsidian Kit that gets you hands-on with using Scripture in your personal notes.

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 its 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).


You can help me keep creating tools like this by buying me a coffee ☕️.

Buy Me A Coffee

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 WEB 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).
  • A text editor is no longer necessary but if you're on Windows you might need to install perl.

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. Install scripts

Put both scripts (bg2md.rb and bg2obs.sh) in the same directory, open your terminal application, and navigate to that directory with commands like the following:

  • pwd Show your current directory
  • ls List all contents in the current directory
  • cd Enter a subdirectory (e.g., cd Desktop)
  • cd .. Brings you 'up' one directory

2. Run the script

Once you have navigated to the directory containing both scripts, 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.

Several options are available via command-line switches. Type bash bg2obs.sh -h at any time to display them.

Script option summary

Option Description
-v [VERSION] Specify the version of the Bible to download (default is WEB)
-b Set words of Jesus in bold (default is Off)
-e Include editorial headers (default is Off)
-a Create an alias in the YAML front matter with a more user-friendly chapter title (e.g., "Genesis 1") (default is Off)
-i Show progress information while the script is running (i.e. "verbose" mode) (default is Off)
-h Display help

Example usage

Command Description
bash bg2obs.sh -i -v NIV Download a copy of the NIV Bible with no other options.
bash bg2obs.sh -b Download a copy of the WEB Bible (default) with Jesus' words in bold.
bash bg2obs.sh -v NET -beai Download a copy of the NET Bible with all options enabled.

3. Format the text in a text editor

Some crossreferences are sometimes still included, run \<crossref intro.*crossref\> to delete.

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 want to download a different translation, specify the version using the -v command-line switch as documented above. The list of abbreviations is available on the Bible Gateway site under the version drop-down menu in the search bar. Make sure to honour copyright guidelines. The script has not been tested with all versions of the Bible available at Bible Gateway, though most of the more commonly-used ones should work.

A fork of this repo supports Catholic translations: mkudija/BibleGateway-to-Obsidian-Catholic.

Troubleshooting ⚠️

Below are steps to common issues when using the script. If this still doesn't solve your issue, feel free to get in touch and I will attempt to fix it!

Problems loading ruby/gems

An error like this indicates ruby or the gems aren't installed properly: in require: cannot load such file -- colorize (LoadError)

Solutions

  • Have a look at the bg2md installation guide to make sure you installed ruby and gems properly.
  • Run the gem install with admin privileges: sudo gem install colorize optparse clipboard.
  • Re-install ruby and gems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.