Module: Ref/ssm: Difference between revisions
From A Wiki of Ice and Fire
No edit summary |
mNo edit summary |
||
| Line 16: | Line 16: | ||
local lang = mw.language.getContentLanguage() | local lang = mw.language.getContentLanguage() | ||
local date_text = lang:formatDate("F j, Y", date) | local date_text = lang:formatDate("F j, Y", date) | ||
return "[[So Spake Martin]]: ''[https://www.westeros.org/Citadel/SSM/Entry/ | return mw.ustring.format( | ||
"[[So Spake Martin]]: ''[https://www.westeros.org/Citadel/SSM/Entry/%d %s]'' (%s)", | |||
number, | |||
title, | |||
date_text | |||
) | |||
end | end | ||
return p | return p | ||
Revision as of 15:52, 1 November 2023
Documentation for this module may be created at Module:Ref/ssm/doc
local data = require('Module:Ref/ssm/data')
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
function p._main(args)
local number = tonumber(args[1])
local article = data[number]
local title = article.title
local date = article.date
local lang = mw.language.getContentLanguage()
local date_text = lang:formatDate("F j, Y", date)
return mw.ustring.format(
"[[So Spake Martin]]: ''[https://www.westeros.org/Citadel/SSM/Entry/%d %s]'' (%s)",
number,
title,
date_text
)
end
return p