Module:RSP/sandbox
Appearance
| This is the module sandbox page for Module:RSP. |
-- {{RSP row|name=Aaron Is Awesome|alias1=AIA|status=gu|deprecated=y|
-- summary={insert wikitext here}|domain1=example.org|domain2=example.com|
-- discussions=[[link|1]]<br/>[[VGRS link|A]]|last=2018|nid=334|nyr=2021}}
local p = {}
function make_shortcut(frame, shortcut)
return '<br/>' ..
frame:extensionTag(
'templatestyles',
'',
{ src = "Wikipedia:Reliable sources/Perennial sources/Shortcut/styles.css" }
) ..
-- NOTE: Original WP:RSPSHORTCUT template used {{no redirect|WP:WHATEVER}}
'<span class="wp-rsp-sc">[[' .. shortcut .. ']] 📌</span>'
end
function make_rsnl(frame, notice_id, name, notice_year, rfc)
return frame:expandTemplate{
title = 'rsnl',
args = { notice_id, name, notice_year, rfc = rfc }
}
end
p.row = function(frame)
local name = frame.args.name
local altname = frame.args.altname
local stat = frame.args.status
local shortcut = frame.args.shortcut
local discussions = frame.args.disc or ''
local comments = frame.args.comments
local notice_id = frame.args.nid
local notice_year = frame.args.nyr
local notice_is_stale = frame.args.nstale
local rfc = frame.args.rfc or 'y'
local url = frame.args.url
local rsnl = make_rsnl(frame, notice_id, name, notice_year, rfc)
local altline = ''
if altname then
altline = '<small>' .. altname .. '</small>'
end
if shortcut then
altline = altline .. ' ' .. make_shortcut(frame, shortcut)
end
local output = '\n|- class="s-' .. stat .. '" id="' .. name ..'"'
output = output .. '\n| ' .. '[[' .. name .. ']]' .. altline
output = output .. '\n| ' .. frame:expandTemplate{title = 'WP:RSPSTATUS', args = { stat }}
output = output .. '\n| ' .. rsnl .. '\n' .. discussions
output = output .. '\n| ' .. frame:expandTemplate{title = 'WP:RSPLAST', args = { notice_year, stale = notice_is_stale }}
output = output .. '\n| ' .. comments
output = output .. '\n| ' .. frame:expandTemplate{title = 'WP:RSPUSES', args = { url }}
return output
end
return p