Jump to content

Module:Taxonbar/confdoc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tom.Reding (talk | contribs) at 19:44, 12 April 2018 (test if tostring() is necessary). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

require('Module:No globals')

local conf = require( "Module:Taxonbar/conf" ) -- configuration module

local p = {}
	
function p.confdoc( frame )
	local doctable = '{| class="wikitable sortable"\n' .. 
					 '|-\n' .. 
					 '! Parameter !! data-sort-type=number style="white-space: nowrap;"| Wikidata ID !! Authority !! Description'
	
	for _, db in pairs( conf.databases ) do
		local param = mw.ustring.lower(db[1])
		local prop = db[3]
		if type(prop) == 'number' then
			local TaxonbarProperty = frame:expandTemplate{ title = 'Taxonbar/Property', args = { prop } }
			doctable = doctable .. '\n' .. 
					   '|-\n' .. 
					   '|' .. param .. '||' .. TaxonbarProperty
		end
	end
	
	doctable = doctable .. '\n|}'
	return doctable
end

return p