Add embedded KJV support

This commit is contained in:
2026-06-14 07:46:21 -05:00
parent 2d78d8e5c0
commit 544062902b
8 changed files with 31857 additions and 3 deletions
+6 -3
View File
@@ -8,6 +8,7 @@ import cliutils, docopt, zero_functional
import ./api_bible
import ./esv
import ./kjv
proc formatMarkdown(raw, translation: string): string =
var reference = ""
@@ -77,6 +78,8 @@ proc fetchPassages(reference, translation: string, cfg: CombinedConfig): seq[str
reference,
cfg.getVal("esv-api-token"),
cfg.getVal("esv-api-root", "https://api.esv.org"))
of "akjv", "kjv":
kjv.fetchPassages(reference)
of "amp", "nkjv", "niv":
api_bible.fetchPassages(
reference,
@@ -89,7 +92,7 @@ proc fetchPassages(reference, translation: string, cfg: CombinedConfig): seq[str
else:
raise newException(ValueError,
"unsupported translation '" & translation &
"'; supported translations: amp, esv, nkjv, niv")
"'; supported translations: akjv, amp, esv, kjv, nkjv, niv")
when isMainModule:
const USAGE = """Usage:
@@ -107,8 +110,8 @@ Options:
-t, --translation <translation>
Select a specific translation. Supported values
are 'amp', 'esv', 'nkjv', and 'niv'. Defaults
to 'esv'.
are 'akjv', 'amp', 'esv', 'kjv', 'nkjv', and
'niv'. Defaults to 'esv'.
--esv-api-token <token> Provide the API token on the command line. By
default this will be read either from the