-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c10dc89
Showing
15 changed files
with
33,448 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
release/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
NAME ?= av-roam | ||
VERSION ?= $(shell git rev-parse --short HEAD) | ||
ARTIFACT ?= $(NAME)_$(VERSION).tar.gz | ||
export | ||
|
||
.DEFAULT_GOAL := build | ||
.PHONY: build test clean | ||
|
||
release: | ||
mkdir release | ||
release/*.md: release | ||
cd release; ../generate.awk ../av.input | ||
release/$(ARTIFACT): release/*.md | ||
cd release; tar czf $(ARTIFACT) *.md | ||
build: release/$(ARTIFACT) | ||
|
||
test/output: | ||
mkdir test/output | ||
test: test/output | ||
test/run.sh | ||
|
||
clean: | ||
rm -f release/* test/output/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# av-roam | ||
Generates a King James ([Authorized Version](https://en.wikipedia.org/wiki/King_James_Version)) text that is formatted for import into a Roam Research database. | ||
|
||
It uses Roam markdown and [LaTeX](https://en.wikipedia.org/wiki/LaTeX) features to approximate the original print as much as possible. | ||
|
||
![note italicized words, section headers, and special treatment of YHWH](doc/example.png) | ||
|
||
## Features | ||
|
||
1. One chapter per note, one verse per block. | ||
1. Navigational metadata: *Previous/Next* chapter links and `#<Book>` tags | ||
1. _italicized_ words to indicate translation additions | ||
1. _yhwh_ formatted LORD as in the original print | ||
1. original print paragraph markings and chapter notes | ||
1. KJV Cambridge | ||
1. Table of Contents Page: `KJV` | ||
|
||
## Usage | ||
|
||
1. [Download the current release](https://github.com/pmbauer/av-roam/releases/download/5fa7989/av-roam_5fa7989.tar.gz) and extract locally | ||
2. Use Roam Research `...` menu and select `Import Files` | ||
3. Choose chapters you wish to import. | ||
|
||
## Import Everything | ||
Note that importing a corpus as large as the entire Bible *will* impact your database's performance, so for now it's recommended to import chapters ad-hoc. | ||
|
||
But if you still wish to import everything, there is a [public KJV Roam](https://roamresearch.com/#/app/KJV). | ||
From there you can JSON-export the contents and import into your personal database. | ||
N.B. that version is missing a number of features from the original AV translation: _italicized_ words to indicate translation word additions, footnotes, chapter and section headings (e.g. Psalms 119) | ||
|
||
## Building | ||
```bash | ||
# builds release artifact | ||
make | ||
make build | ||
|
||
# run tests | ||
make test | ||
|
||
# clean up | ||
make clean | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env gawk -f | ||
|
||
function acopy(a, b) { | ||
delete b | ||
for (k in a) { | ||
b[k] = a[k] | ||
} | ||
} | ||
|
||
BEGIN { | ||
delete verses; delete current; delete previous; | ||
kjv_toc = "KJV.md" | ||
OFS="" | ||
} | ||
|
||
# collect :::SET K V state | ||
match($0, /^:::SET\s+(\w+)\s+(.*)/, ord) { | ||
if (length(verses) > 0 && length(current)==0) { | ||
acopy(meta, current) | ||
} | ||
meta[ord[1]] = ord[2]; | ||
} | ||
|
||
# begin TOC | ||
match($0, /^:::SET\s+TESTAMENT\s+(.*)/, ord) { | ||
print "- [[", ord[1], " Testament]]" >> kjv_toc | ||
} | ||
|
||
match($0, /^:::SET\s+BOOK\s+(.*)/, ord) { | ||
meta["BOOKCHAPTER"] = ord[1] | ||
print " - [[", ord[1], "]]" >> kjv_toc | ||
} | ||
|
||
match($0, /^:::SET\s+CHAPTER\s+(.*)/, ord) { | ||
if (ord[1] != "END") { | ||
print " - [[", meta["BOOKCHAPTER"], " ", ord[1], "]]" >> kjv_toc | ||
} | ||
} | ||
# end TOC | ||
|
||
# flush signal, print chapter | ||
/^:::SET\s+CHAPTER\s.*/ { | ||
if (length(verses) > 0) { | ||
of = current["BOOKCHAPTER"] " " current["CHAPTER"] ".md"; | ||
if (length(previous)!=0) { | ||
print "- Previous:: [[", previous["BOOKCHAPTER"], " ", previous["CHAPTER"], "]]" >> of | ||
} | ||
if (meta["CHAPTER"]!="END") { | ||
print "- Next:: [[", meta["BOOKCHAPTER"], " ", meta["CHAPTER"], "]]" >> of | ||
} | ||
print "- Tags:: #Bible #KJV #[[", current["BOOK"], "]]" >> of | ||
for (i = 1; i <= length(verses); i++) { | ||
print "- ", verses[i] >> of | ||
} | ||
delete verses | ||
|
||
acopy(current, previous) | ||
delete current | ||
} | ||
} | ||
|
||
/^:::.*/ { next } | ||
|
||
# push a verse | ||
{ verses[length(verses)+1]=$0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- Next:: [[1 Testing 2]] | ||
- Tags:: #Bible #KJV #[[1 Testing]] | ||
- 1 THIS is the first verse of chapter 1 | ||
- 2 A second verse | ||
- > a footnote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Previous:: [[1 Testing 1]] | ||
- Next:: [[Psalm 1]] | ||
- Tags:: #Bible #KJV #[[1 Testing]] | ||
- **a non-verse heading** | ||
- 1 A second chapter verse | ||
- 2 A second chapter second verse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- Previous:: [[Psalm 1]] | ||
- Tags:: #Bible #KJV #[[A Book]] | ||
- 1 Not much more to go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- [[Test Testament]] | ||
- [[1 Testing]] | ||
- [[1 Testing 1]] | ||
- [[1 Testing 2]] | ||
- [[Psalms]] | ||
- [[Psalm 1]] | ||
- [[A Book]] | ||
- [[A Book 1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Previous:: [[1 Testing 2]] | ||
- Next:: [[A Book 1]] | ||
- Tags:: #Bible #KJV #[[Psalms]] | ||
- 1 Verse the first | ||
- 2 Verse the second | ||
- 3 Verse the third |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
:::SET TESTAMENT Test | ||
:::SET BOOK 1 Testing | ||
:::SET TITLE The First Test General of Testing | ||
:::SET CHAPTER 1 | ||
1 THIS is the first verse of chapter 1 | ||
2 A second verse | ||
> a footnote | ||
:::SET CHAPTER 2 | ||
**a non-verse heading** | ||
1 A second chapter verse | ||
2 A second chapter second verse | ||
:::SET BOOK Psalms | ||
:::SET TITLE Book Of Psalms | ||
:::SET BOOKCHAPTER Psalm | ||
:::SET CHAPTER 1 | ||
1 Verse the first | ||
2 Verse the second | ||
3 Verse the third | ||
:::SET BOOK A Book | ||
:::SET TITLE A Book | ||
:::SET CHAPTER 1 | ||
1 Not much more to go | ||
:::SET CHAPTER END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
pushd test/output | ||
rm -f *.md | ||
../../generate.awk ../fixture.input | ||
popd | ||
|
||
diff -bur test/expected test/output |