Module:Sandbox/Frietjes: Difference between revisions

Content deleted Content added
No edit summary
Tag: Reverted
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 8:
end
 
function p.precisionifexists(frame)
returnpage = math_module._precision(frame.args[1])
if not page then return (frame.args['no'] or '') end
if mw.title.new(page).exists then return (frame.args['yes'] or 'yes') end
return (frame.args['no'] or '')
end
 
function p.heightlists(frame)
local precs = math_module'\n' ._precision. (frame.args[1] or '') .. '\n'
s = mw.ustring.gsub(s, '([\r\n])%*([^\r\n]*)', '%1<ul><li>%2</li></ul>')
local adj = (prec == 1) and 'ri3' or 'ri2'
s = mw.ustring.gsub(s, '([\r\n])#([^\r\n]*)', '%1<ol><li>%2</li></ol>')
return adj
s = mw.ustring.gsub(s, '</ol>%s*([\r\n]*)<ol>', '%1')
s = mw.ustring.gsub(s, '</ul>%s*([\r\n]*)<ul>', '%1')
s = mw.ustring.gsub(s, '^[\r\n](.*)[\r\n]$', '%1')
return adjs
end
 
function p.precision(frame)
return math_module._precision(frame.args[1])
end
 
Line 51 ⟶ 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