Difference between revisions of "Module:Taxonbar/confdoc"
Jump to navigation
Jump to search
blackwiki>Tom.Reding m (Update) |
blackwiki>Tom.Reding m (var ce) |
||
| Line 6: | Line 6: | ||
function p.confdoc( frame ) | function p.confdoc( frame ) | ||
| − | local | + | local wikitable = '{| 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 | for _, db in pairs( conf.databases ) do | ||
| Line 15: | Line 15: | ||
if type(prop) == 'number' and prop > 0 then | if type(prop) == 'number' and prop > 0 then | ||
local TaxonbarProperty = frame:expandTemplate{ title = 'Taxonbar/Property', args = { prop } } | local TaxonbarProperty = frame:expandTemplate{ title = 'Taxonbar/Property', args = { prop } } | ||
| − | + | wikitable = wikitable .. '\n' .. | |
| − | + | '|-\n' .. | |
| − | + | '|' .. param .. '||' .. TaxonbarProperty | |
end | end | ||
end | end | ||
| − | return | + | return wikitable .. '\n|}' |
end | end | ||
return p | return p | ||
Revision as of 14:20, 13 June 2018
| This module depends on the following other modules: |
| Related pages |
|---|
About
This module allows Module:Taxonbar/conf to automatically update its own documentation table of Wikidata taxon ID properties on Template:Taxonbar/doc.
Usage
{{#invoke:Taxonbar/confdoc|confdoc}}
require('Module:No globals')
local conf = require( "Module:Taxonbar/conf" ) -- configuration module
local p = {}
function p.confdoc( frame )
local wikitable = '{| 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' and prop > 0 then
local TaxonbarProperty = frame:expandTemplate{ title = 'Taxonbar/Property', args = { prop } }
wikitable = wikitable .. '\n' ..
'|-\n' ..
'|' .. param .. '||' .. TaxonbarProperty
end
end
return wikitable .. '\n|}'
end
return p