Module:Sandbox/Frietjes: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 8:
end
 
function p.boxifexists(frame)
local imagepage = frame.args[1]
localif captionnot =page then return (frame.args[2'no'] or '') end
if mw.title.new(page).exists then return (frame.args['yes'] or 'yes') end
local isleft = frame.args['isleft']
local iscenter =return (frame.args['iscenterno'] or '')
end
local upright = frame.args['upright'] or '1'
 
if (caption or '') ~= '' then
function p.lists(frame)
local targs = {}
local uprights = '\n' .. (frame.args['upright'1] or '1') .. '\n'
if isleft then
s = mw.ustring.gsub(s, '([\r\n])%*([^\r\n]*)', '%1<ul><li>%2</li></ul>')
targs['bodystyle'] = 'float:left;clear:left;margin:0.5em 1em 0.5em 0em'
s = mw.ustring.gsub(s, '([\r\n])#([^\r\n]*)', '%1<ol><li>%2</li></ol>')
elseif iscenter then
s = mw.ustring.gsub(s, '</ol>%s*([\r\n]*)<ol>', '%1')
targs['bodystyle'] = 'float:none;clear:both;margin:0.5em auto'
s = mw.ustring.gsub(s, '</ul>%s*([\r\n]*)<ul>', '%1')
end
s = mw.ustring.gsub(s, '^[\r\n](.*)[\r\n]$', '%1')
targs['image'] = '[[File:' .. image .. '|upright=' .. upright .. '|frameless]]'
return s
targs['caption'] = caption
return require('Module:Infobox').infobox(targs)
end
return '[[File:' .. image .. '|thumb]]'
end
 
Line 65 ⟶ 62:
function p.hasOSM(frame)
return getBestStatement(mw.wikibase.getEntityIdForCurrentPage(), 'P402') and 'yes' or 'no'
end
 
function p.chart(frame)
local chart = require('Module:Chart')['bar-chart']
return chart(frame)
end