Content deleted Content added
add start parameter to get output in blocks |
limit examples to three; handle start and finish for partial lists |
||
Line 26:
-function to show formatURL and id for taxonomic databases
]]
local COUNTER_MAX = 390
local counter = function p.wikidataInfo( frame )
counter = frame.args['counter'] or
local start = frame.args['start'] or "a"
local finish = frame.args['finish'] or "zzz"
local wikitable = '{| class="wikitable sortable"\n' ..
Line 47 ⟶ 49:
local formatterURL = ""
if type(prop) == 'number' and prop > 0 and param > start and param < finish then
local item = mw.wikibase.getEntity('P'..prop) --('P5354')
counter = counter - 1
Line 104 ⟶ 106:
local links = ""
local exampleStatements = propItem:getBestStatements('P1855')
local nExamples = 0
--local statement = statements[1]
for _, statement in pairs( exampleStatements ) do
if nExamples == 3 then break end -- don't show more than 3 examples
if statement.mainsnak and statement.mainsnak.datavalue and statement.mainsnak.datavalue.value then
local examplesValue = statement.mainsnak.datavalue.value
Line 114 ⟶ 120:
local item = mw.wikibase.getEntity(exampleID)
counter = counter - 1
nExamples = nExamples + 1
if item and item ~= "" then
|