Module:Sandbox/ProcrastinatingReader: Difference between revisions

Content deleted Content added
m ProcrastinatingReader moved page Module:Sandbox/ProcrastinatingReader/test to Module:Sandbox/ProcrastinatingReader without leaving a redirect
quick sample
Line 4:
local tableTools = require ('Module:TableTools')
 
function p.lsimain(frame)
local args = getArgs(frame), {
return (string.find(frame:getParent().args['first_aired'], 'dtstart') == nil)
wrappers = {
'Template:Sandbox/ProcrastinatingReader'
}
})
return p._widthbuild(argsframe)
end
 
function p.widthbuild(frame)
return frame:expandTemplate{ title = 'db-meta', args = {
local args = getArgs(frame)
'because </b>{{{rationale|{{{wording|{{{reason|{{{1}}}}}}}}}}}}<b>|&#32; as a page that needs to be deleted to merge histories, reverse a redirect, or perform other non-controversial technical tasks',
return p._width(args)
'Asserted to be non-controversial maintenance',
criterion = 'G6',
notes = 'etc',
summary = 'Housekeeping and routine (non-controversial) cleanup'
}}
end
 
function p._width_build(args)
local new_width = 140
local page = mw.title.makeTitle('File', args[1])
if not page.exists then
return new_width
end
 
local ratio = page.file.width / page.file.height
if ratio > 1.2 then
new_width = 160
elseif ratio < 0.8333 then
new_width = 120
end
 
return new_width
end