Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alphapapa/sword-to-org

Convert Sword modules to Org-mode outlines
https://github.com/alphapapa/sword-to-org

bible emacs esword org-mode

Last synced: 3 months ago
JSON representation

Convert Sword modules to Org-mode outlines

Awesome Lists containing this project

README

        

* sword-to-org

This package uses [[https://crosswire.org/wiki/Frontends:Diatheke][=diatheke=]] to convert Sword modules to Org-mode outlines. For example, you can make an Org file containing the entire text of the ESV module as an outline structured by book/chapter/verse. Then you can add top-level headings for Old/New Testaments, and then you have the whole Bible as an Org file. Then you can do everything you can do in Org with the text of the Bible! Add footnotes, links, tags, properties, write your own commentaries under subheadings, organize research with TODO items, export with =org-export=, search with =helm-org-rifle=, etc. The list is endless.

[[screenshot.png]]

** Usage

First install [[https://crosswire.org/wiki/Frontends:Diatheke][=diatheke=]]. On Debian/Ubuntu it's in the =diatheke= package.

Open a buffer and run the command =sword-to-org-insert-outline=. Choose the module (e.g. Bible translation) to use, then input a passage reference or range (e.g. ~Gen 1~, ~Jn 1:1~, or even ~Gen-Rev~ —that last one will take a few moments), and an Org outline will be inserted in book/chapter/verse/text structure. Call the command with a universal prefix (=C-u=) to choose a different module.

The command =sword-to-org-insert-passage= inserts a passage as plain text with one-verse-per-line. Use prefix arguments to choose a different Sword module, and a double-prefix argument to insert as a single paragraph with reference at the end.

You may customize =sword-to-org-default-module= so you don't have to pick a module every time.

You may also use any of the =sword-to-org--= support functions in your own programs. Consult the docstrings for instructions and examples.

*** Export with Org Babel code block and macro

By including this code in your Org file, you can easily insert passages when exporting:

#+BEGIN_SRC org
,#+MACRO: refPara #+CALL: Diatheke(ref=$1, paragraph="t")
,#+MACRO: refLines #+CALL: Diatheke(ref=$1, paragraph="")

,#+NAME: Diatheke
,#+BEGIN_SRC emacs-lisp :var ref="" paragraph="" :exports results :results raw
(concat "#+BEGIN_QUOTE" "\n"
(sword-to-org--passage ref :paragraph (s-present? paragraph))
(when (s-present? paragraph)
(concat " (" ref ")")) "\n"
"#+END_QUOTE" "\n")
,#+END_SRC
#+END_SRC

Now you can use macros to insert references, like this:

#+BEGIN_SRC org
John explains that Jesus was with God in the beginning:

{{{refPara("John 1:1-3")}}}

And that Jesus is victorious:

{{{refLines("John 1:4-5")}}}
#+END_SRC

Which is exported as:

#+BEGIN_EXAMPLE
John explains that Jesus was with God in the beginning:

In the beginning was the Word, and the Word was with God,
and the Word was God. He was in the beginning with God. All
things were made through him, and without him was not any
thing made that was made. (John 1:1-3)

And that Jesus has conquered darkness:

John 1:4 In him was life, and the life was the light of men.

John 1:5 The light shines in the darkness, and the darkness
has not overcome it.
#+END_EXAMPLE

** Development

Contributions are welcome!

*** Ideas

**** MAYBE Rename, expand

Might want to rename to, say, =org-sword=, and add commands to search =diatheke= for keywords, etc.

** Credits

+ Thanks to [[https://github.com/syohex][Syohei YOSHIDA]] and [[https://github.com/purcell][Steve Purcell]] for their tireless work curating MELPA.
+ Thanks to [[https://github.com/clyde100][@clyde100]] for reporting a bug in the parsing and inspiring the =insert-passage= command and the Babel/export code above.

** License

GPLv3