Module:ChapterLink

require('Module:StrManip')

local p = {}

function p.main local link = "" local vol = "" local ch = "" local chName = "" link = mw.getCurrentFrame.args[1] vol = mw.getCurrentFrame.args[2] ch = mw.getCurrentFrame.args[3] chName = mw.getCurrentFrame.args[4] mw.logObject("ch " .. ch) if (ch == "") then ch = "nilll" end if (vol == "") then vol = "nilll" end if (chName == "") then chName = "nilll" end

if not (link:find("http")) then link = "https://" .. link end local str = "" if not (vol:find("nilll")) then str = str .. "Volume " .. vol if not (ch:find("nilll")) then str = str .. " &#124; "		end end if not (ch:find("nilll")) then str = str .. "Chapter " .. ch		if not (chName:find("nilll")) then str = str .. " - "		end end if not (chName:find("nilll")) then str = str .. chName end local wikiLink = "[" .. link .. " " .. str .. "]"	mw.logObject(wikiLink) return wikiLink --mw.getCurrentFrame.args[2] end

return p