Module:LDSverse: Difference between revisions

Content deleted Content added
m added some abbreviations for the introduction to the Book of Mormon
Revamped how the Lectures on Faith are treated to match the D&C (their structural analogue on WS)
Line 48:
 
local lofBooks = {
["Lectures on Faith"] = {"lof", "l-o-f", "l-of-f", "loff", "lectures"}
["Lecture First"] = {"l1"},
["Lecture Second"] = {"l2"},
["Lecture Third"] = {"l3"},
["Lecture Fourth"] = {"l4"},
["Lecture Fifth"] = {"l5"},
["Lecture Sixth"] = {"l6"},
["Lecture Seventh"] = {"l7"}
}
 
Line 230 ⟶ 224:
if string.find(book, "^Section") then
if verse then
return "#" .. verse -- D&C sections just use the verse number
else
return "" -- if they're just citing a Section then no bookmark needed at all
end
end
if string.find(book, "^Lecture") then
if verse then
return "#" .. verse -- D&C sections just use the verse number
Line 261 ⟶ 263:
end
 
-- Special case for handling the Official Declarations in the D&C
local function handleOD(displayTextParam, chapter)
if chapter == "1" then
Line 267 ⟶ 270:
return "[https://www.churchofjesuschrist.org/study/scriptures/dc-testament/od/2?lang=eng " .. displayTextParam .. " 2]"
else
assert(false, "No such Official Declaration: " .. chapter)
end
end
Line 298 ⟶ 301:
local endVerseFlag = trimSpaces(args[8])
return displayTextParam, bookParam, chapterParam, verseParam, endVerseParam, endVerseFlag
end
 
local function getLectureOrdinal(lectureNum)
if lectureNum == "1" then return "First"
elseif lectureNum == "2" then return "Second"
elseif lectureNum == "3" then return "Third"
elseif lectureNum == "4" then return "Fourth"
elseif lectureNum == "5" then return "Fifth"
elseif lectureNum == "6" then return "Sixth"
elseif lectureNum == "7" then return "Seventh"
end
assert(false, "Lecture on Faith number <" .. lectureNum .. "> does not exist (should be between 1 and 7)")
end
 
Line 339 ⟶ 355:
end
end
-- Special case for Lectures on Faith
if fullBookName == "The Lectures on Faith" then
if chapterParam then
fullBookName = "Lecture " .. getLectureOrdinal(chapterParam)
else
fullBookName = nil -- The user has not provided a chapter (lecture) so this is treated as wanting to cite the LoF generally
end
end
if fullBookName then
wikiText = wikiText .. "/" .. fullBookName