Module:Common: Difference between revisions

From DataTrek
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
local p = {}
local p = {}
function p.SiteAllP()
function p.SiteAllP()
local MaxP = 10
local MaxP = 20
local AllP = {}
local AllP = {}
Line 11: Line 11:
     end
     end
return table.concat(AllP, string.char(10))
return table.concat(AllP, "<br />" .. string.char(10))
end
end
return p
return p

Revision as of 00:08, 10 June 2020

Documentation for this module may be created at Module:Common/doc

-- Keyword: wikitrek
local p = {}
function p.SiteAllP()
	local MaxP = 20
	local AllP = {}
	
	for PNumber = 1, MaxP, 1 do
      if mw.wikibase.entityExists('P' .. PNumber) then
      	AllP[#AllP + 1] = 'P' .. PNumber
      end
    end
	
	return table.concat(AllP, "<br />" .. string.char(10))
end
return p