Add embedded KJV support
This commit is contained in:
+6
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user