Jump to content


Photo

Converting a commentary to User Notes


  • Please log in to reply
2 replies to this topic

#1 jlm

jlm

    Silver

  • Active Members
  • PipPipPip
  • 178 posts
  • Gender:Male
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS, Android

Posted 25 March 2019 - 11:44 AM

I'd like to let the Accordance community know about something I'm slowly working on. I'm converting an old public domain commentary into User Notes so that it will scroll with the text. Accordance doesn't offer a way to create a User Reference Tool, but the User Notes import can be used to achieve something similar.

 

I'm preparing the text in Markdown. First level headings are books, second level headings are chapters, and third level headings are verses. A Python script reads the Markdown (treating it as plain text) and splits it at third level headings (the commentary on a verse or verses). The chapter heading becomes the name of the file ("### Luke 2:14" becomes "Luke 2_14.rtf") and the content is created by piping the Markdown through pandoc.

 

Since I found the commentary online in HTML and got permission to convert it for Accordance, I just have to add the third level headings to split it into verses and enhance the text as I wish. I'm tagging Scripture references and sometimes marking page numbers, chiefly for proofreading.

 

If at some point in the future Accordance does support the creation of User Reference Tools, I already have the text prepared and just have to convert it into whatever the importer will read.

 

There are some limitations to using User Notes for a commentary: RTF import doesn't support footnotes or small capitals, but in the text I'm converting, footnotes are rare and small capitals are not necessary for understanding the text.

 

A commentary in User Notes has the advantage on iOS that it will pop up in a little window if you tap on the icon, so you can have a main text, something that scrolls in parallel, and also see the commentary. However, having lots of commentaries in this form would not be ideal, because all the user notes share icons (distinguished for one note or multiple notes on the verse), and they all pop up together or show up in instant details together.


  • R. Mansfield, Unix, Fabian and 1 other like this

#2 Joel Arnold

Joel Arnold

    Silver

  • Active Members
  • PipPipPip
  • 121 posts
  • Gender:Male
  • Location:Manila Philippines
  • Accordance Version:12.x
  • Platforms:Mac OS X, iOS

Posted 20 October 2019 - 07:26 PM

This sounds FABULOUS. I would love to get an update on this or even access to your Python Script, an example of the text you prepared and your Pandoc settings. I'm trying to turn something pretty simple like this into a user note that will scroll parallel to my Bible:

 

Matthew 1:1 [user note heading - where it scrolls to]

Genesis 5:1 [user note content]

 

Matthew 1:2 [user note heading - where it scrolls to]

1 Chronicles 1:34 [user note content]

 

Matthew 1:3 [user note heading - where it scrolls to]

Ruth 4:12

 

Matthew 1:3 [user note heading - where it scrolls to]

Ruth 4:18–19 [user note content]

 

Matthew 1:3 [user note heading - where it scrolls to]

1 Chronicles 2:4–5 [user note content]



#3 jlm

jlm

    Silver

  • Active Members
  • PipPipPip
  • 178 posts
  • Gender:Male
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS, Android

Posted 21 October 2019 - 12:50 PM

I've made the code publicly accessible as a git repository: https://gitlab.com/j...reat-commentary

At that address you can browse and download the code. I updated the README to explain how it works.

 

You could make the notes with a Markdown text file something like this:

### Matthew 1:1
Genesis 5:1

### Matthew 1:2
1 Chronicles 1:34

That will get the text into the notes, but the Accordance User Notes importer does not automatically link verse references. You have to tag them yourself. This would work:

### Matthew 1:1
[Genesis 5:1](Genesis 5:1)

### Matthew 1:2
[1 Chronicles 1:34](1Chronicles 1:34)

If you find it tedious to repeat the citations and can write a pandoc filter in Lua or Python, you could prepare the Markdown like this:

### Matthew 1:1
[Genesis 5:1]{.vref}

### Matthew 1:2
[1 Chronicles 1:34]{.vref}

and then write a filter that looks for spans with the vref class and transforms them into links, using Lua patterns or regular expressions to reformat the reference as necessary: no space between book number and name, hyphens instead of en dashes, etc.

 

Edit: I've noticed you have multiple entries for Matthew 1:3. My script (mkRTFnotes.py) won't handle that. You need to combine the content into a single note:

### Matthew 1:3
Ruth 4:12

Ruth 4:18–19

1 Chronicles 2:4–5

Alternatively, use my script as a model to write your own that reads whatever format it's easy for you to generate, combines the references, and pipes Markdown (with verse references linked) into pandoc to produce the RTF files.


Edited by jlm, 21 October 2019 - 12:59 PM.

  • jarcher and Fabian like this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users