Jump to content

Module:Episode: Difference between revisions

From Semantic Stargate Wiki
Content deleted Content added
No edit summary
No edit summary
Line 4: Line 4:
function p.getInfo(frame)
function p.getInfo(frame)
local episode = string.lower(frame.args[1]) -- for ex. "chilren of the gods"
local episode = string.lower(frame.args[1]) -- for ex. "chilren of the gods"
local nmspace, episodelink, episodetitle = unpack(data[episode] or {})
local nmspace, episodelink, episodetitle = unpack(data[episode])
if nmspace == "" or nil then
if nmspace == "" or nil then
return string.format("[[%s|%s]]", episodelink, episodetitle)
return string.format("[[%s|%s]]", episodelink, episodetitle)

Revision as of 16:21, 21 July 2025

Documentation icon Module documentation[create]
local data = mw.loadData("Module:Episode/data")
local p={}

function p.getInfo(frame)
	local episode = string.lower(frame.args[1]) -- for ex. "chilren of the gods"
	local nmspace, episodelink, episodetitle = unpack(data[episode])
	if nmspace == "" or nil then
		return string.format("[[%s|%s]]", episodelink, episodetitle)
		else
			return string.format("[[%s:%s|%s]]", nmespace, episodelink, episodetitle)
	end
end

return p