ScriptureStudy

A set of tools to study the Bible.

⚠️ Disclaimer

This is not affiliated to BibleGateway in any way.

When using this tool you must honour the copyright of different translations of the Bible (see BibleGateway's overview). Using the scripts with some versions is clearly breaking the copyright, that is not the intended use of the code in this repository.

WEB and NET are used by default:

  • The WEB Bible is open.
  • The NET translation, has very generous copyright and should be permissible for personal study as well.

Download

To download the Bible from BibleGateway run the following script.

It requires Node.js to be installed.

$ cd scrapper
$ npm install
$ npm build
$ cd ..
$ mkdir -p bibles/{NET,WEB}
$ ./bin/download NET WEB

Convert to Json

Convert the content of each chapter to a JSON format. The JSON format is used to power the app.

This requires to first build and install the Rust script on html2json and to have run the Download step as well, which is used as the input.

The script uses GNU's parallel.

$ cd html2json
$ cargo install --path .
$ cd ..
$ ./bin/extract-all

Build the index

The app also requires an index. The make-index script fetches all the chapter titles in order and builds an index of the Bible.

$ ./bin/make-index
$ cp index.json bibles/index.json

Run the app

To run the app first generate the JSON for at least one Bible. The default ones are NET and WEB (which have permisive copyrights), if you choose different ones make sure to set the environment variables:

export NEXT_PUBLIC_DEFAULT_VERSION='NET'
export NEXT_PUBLIC_AVAILABLE_VERSIONS='NET,WEB'
export NEXT_PUBLIC_API_URL='http://localhost:8080'

Then serve the bibles directory from the previous steps (Download, Convert to Json, and Build the index).

$ serve --cors bibles -l 8080

And finally run the app:

$ cd app
$ yarn install
$ yarn dev