Modül:Bibleverse
-- This module implements Template:Bibleverse
local p = {}
--codes from bvf that may be in use
local version_num_codes = { [9] = 'kjv', [31] = 'niv', [45] = 'amp', [49] = 'nasb', [64] = 'nivuk', [51] = 'nlt', [65] = 'msg', [76] = 'nirv', [105] = 'he', [104] = 'jps', [120] = 'opb', [121] = 'bb', [122] = 'bbc', [123] = 'bbl', [131] = 'nrsv',
}
--possible book inputs, based on Chicago Manual
local book_aliases = { ['genesis'] = {'gen', 'gn'}, --old testament/tanakh ['exodus'] = {'exod', 'ex'}, ['leviticus'] = {'lev', 'lv'}, ['numbers'] = {'num', 'nm'}, ['deuteronomy'] = {'deut', 'dt'}, ['joshua'] = {'josh' , 'jo'}, ['judges'] = {'judg', 'jgs'}, ['ruth'] = {'ru'}, ['1_samuel'] = {'1sam', '1sm'}, ['2_samuel'] = {'2sam', '2sm'}, ['1_kings'] = {'1kgs'}, ['2_kings'] = {'2kgs'}, ['1_chronicles'] = {'1chron', '1chr'}, ['2_chronicles'] = {'2chron', '2chr'}, ['ezra'] = {'ezr'}, ['nehemiah'] = {'neh'}, ['esther'] = {'est'}, ['job'] = {'jb'}, ['psalms'] = {'ps', 'pss', 'psalm'}, ['proverbs'] = {'prov', 'prv'}, ['ecclesiastes'] = {'eccles', 'eccl', 'qoheleth'}, ['song_of_solomon'] = {'songofsol', 'songofsongs', 'song', 'sg', 'canticles', 'canticleofcanticles'}, ['isaiah'] = {'isa', 'is', 'yeşaya'}, ['jeremiah'] = {'jer'}, ['lamentations'] = {'lam'}, ['ezekiel'] = {'ezek', 'ez'}, ['daniel'] = {'dan', 'dn'}, ['hosea'] = {'hos'}, ['joel'] = {'jl'}, ['amos'] = {'am'}, ['obadiah'] = {'obad', 'ob'}, ['jonah'] = {'jon'}, ['micah'] = {'mic', 'mi'}, ['nahum'] = {'nah', 'na'}, ['habakkuk'] = {'hab', 'hb'}, ['zephaniah'] = {'zeph', 'zep'}, ['haggai'] = {'hag', 'hg'}, ['zechariah'] = {'zech', 'zec'}, ['malachi'] = {'mal'}, ['baruch'] = {'bar'}, --apocrypha/deuterocanon ['ecclesiasticus'] = {'ecclus', 'wisdomofsirach', 'sirach', 'sir'}, ['1_esdras'] = {'1esd'}, ['2_esdras'] = {'2esd'}, ['judith'] = {'jth', 'jdt'}, ['1_maccabees'] = {'1macc', '1mc'}, ['2_maccabees'] = {'2macc', '2mc'}, ['3_maccabees'] = {'3macc', '3mc'}, ['4_maccabees'] = {'4macc', '4mc'}, ['prayer_of_manasseh'] = {'profman', 'prayerofmanasses'}, ['susanna'] = {'sus'}, ['tobit'] = {'tob', 'tb'}, ['wisdom_of_solomon'] = {'ws', 'wisdom', 'wisofsol'}, ['prayer_of_azariah'] = {'prayerofazariahandhymnofthethreechildren'}, ['rest_of_esther'] = {'additionstoesther'}, ['bel_and_the_dragon'] = {'bel'}, ['epistle_of_jeremiah'] = {'letterofjeremiah'}, ['matthew'] = {'matt', 'mt'}, --new testament ['mark'] = {'mk'}, ['luke'] = {'lk'}, ['john'] = {'jn'}, ['acts'] = {'actsoftheapostles'}, ['romans'] = {'rom'}, ['1_corinthians'] = {'1cor'}, ['2_corinthians'] = {'2cor'}, ['galatians'] = {'gal'}, ['ephesians'] = {'eph'}, ['philippians'] = {'phil'}, ['colossians'] = {'col'}, ['1_thessalonians'] = {'1thess', '1thes'}, ['2_thessalonians'] = {'2thess', '2thes'}, ['1_timothy'] = {'1tim', '1tm'}, ['2_timothy'] = {'2tim', '2tm'}, ['titus'] = {'ti'}, ['philemon'] = {'philem', 'phlm'}, ['hebrews'] = {'heb'}, ['james'] = {'jas'}, ['1_peter'] = {'1pet', '1pt'}, ['2_peter'] = {'2pet', '2pt'}, ['1_john'] = {'1jn'}, ['2_john'] = {'2jn'}, ['3_john'] = {'3jn'}, ['jude'] = {'jude'}, ['revelation'] = {'rev', 'apocalypse', 'apoc', 'rv'},
}
local apoc = { ['1_esdras'] = true, ['2_esdras'] = true, ['judith'] = true, ['1_maccabees'] = true, ['2_maccabees'] = true, ['3_maccabees'] = true, ['4_maccabees'] = true, ['prayer_of_manasseh'] = true, ['susanna'] = true, ['tobit'] = true, ['wisdom_of_solomon'] = true, ['prayer_of_azariah'] = true, ['rest_of_esther'] = true, ['bel_and_the_dragon'] = true, ['epistle_of_jeremiah'] = true, ['sirach'] = true, ['ecclesiasticus'] = true,
}
--these books only have one chapter, have to be handled differently
local no_chapters = { ['obadiah'] = true, ['epistle_of_jeremiah'] = true, ['prayer_of_azariah'] = true, ['susanna'] = true, ['bel_and_the_dragon'] = true, ['prayer_of_manasseh'] = true, ['philemon'] = true, ['2_john'] = true, ['3_john'] = true, ['jude'] = true,
}
--sets the website to be used for each version, biblegateway is the fallback so don't define any for it
local site_tbl = { nrsv = 'oremus', nrsvae = 'oremus', kjv = 'wikisource', asv = 'wikisource', wyc = 'wikisource', ws = 'wikisource', web = 'wikisource', he = 'mechon_mamre', jps = 'mechon_mamre', niv = 'biblica', nivuk = 'biblica', nirv = 'biblica', nab = 'usccb', bb = 'bible_hub', bbc = 'bible_hub', bbl = 'bible_hub', opb = 'bible_hub', esv = 'esv_bible',
}
--pattern for the url of each site using _book etc. (underscore then letters [a-z]) for variables
local urlpat_tbl = { oremus = 'https://bible. oremus.