Skip to content

alphapapa/sword-to-org

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sword-to-org

This package uses =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 =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:

#+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

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

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")}}}

Which is exported as:

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.

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 Syohei YOSHIDA and Steve Purcell for their tireless work curating MELPA.
  • Thanks to @clyde100 for reporting a bug in the parsing and inspiring the insert-passage command and the Babel/export code above.

License

GPLv3

About

Convert Sword modules to Org-mode outlines

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published