Module:WikidataIB and Module:WikidataIB/sandbox1: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>Pigsonthewing
Undid revision 1326353202 by Pigsonthewing (talk) per talk
 
imported>Uzume
strict
 
Line 1: Line 1:
-- Version: 2023-07-10
-- Version: 2021-02-06
-- Module to implement use of a blacklist and whitelist for infobox fields
-- Module to implement use of a blacklist and whitelist for infobox fields
-- Can take a named parameter |qid which is the Wikidata ID for the article
-- Can take a named parameter |qid which is the Wikidata ID for the article
Line 586: Line 586:
local postfix = (args.postfix or ""):gsub('"', '')
local postfix = (args.postfix or ""):gsub('"', '')
local dtxt = args.dtxt
local dtxt = args.dtxt
local shortname = args.shortname or args.sn
local shortname = args.shortname
local lang = args.lang or "en" -- fallback to default if missing
local lang = args.lang or "en" -- fallback to default if missing
local uselbl = args.uselabel or args.uselbl
local uselbl = args.uselabel or args.uselbl
Line 1,744: Line 1,744:
local paraset = tonumber(args.ps or args.parameterset or 0)
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
if paraset == 1 then
-- a common setting, not usable in infoboxes because the 2018 RFC requires sources
-- a common setting
args.rank = "best"
args.rank = "best"
args.fetchwikidata = "ALL"
args.fetchwikidata = "ALL"
Line 1,750: Line 1,750:
args.noicon = "true"
args.noicon = "true"
elseif paraset == 2 then
elseif paraset == 2 then
-- equivalent to raw, not usable in infoboxes because the 2018 RFC requires sources
-- equivalent to raw
args.rank = "best"
args.rank = "best"
args.fetchwikidata = "ALL"
args.fetchwikidata = "ALL"
Line 1,758: Line 1,758:
args.pd = "true"
args.pd = "true"
elseif paraset == 3 then
elseif paraset == 3 then
-- parameterset 1, but usable in infoboxes because the 2018 RFC requires sources
-- third set goes here
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "yes"
args.noicon = "true"
end
end