Add Wikidata edit links to missing names error

This commit is contained in:
Jonathan Harker 2026-10-16 19:22:55 +13:00
parent 81088918e2
commit d6a31b505e

View file

@ -184,7 +184,7 @@ local function makelink(v, out, link, maxpos, wdl, namestyle)
label = label, label = label,
last = last_name or nil, last = last_name or nil,
first = first_names or nil, first = first_names or nil,
qid = qnumber or nil, qid = qnumber,
} }
else else
out[position] = label out[position] = label
@ -206,7 +206,7 @@ local function makelink(v, out, link, maxpos, wdl, namestyle)
label = label, label = label,
last = last_name or nil, last = last_name or nil,
first = first_names or nil, first = first_names or nil,
qid = qnumber or nil, qid = qnumber,
} }
else else
out[position] = label out[position] = label
@ -859,8 +859,11 @@ local function _cite_q (citeq_args)
local missing_names = {} local missing_names = {}
for i, author in pairs(names.authors or {}) do for i, author in pairs(names.authors or {}) do
if not author.last and i <= (citeq_args['display-authors'] or author_count) then if not author.last and i <= (citeq_args['display-authors'] or author_count) then
if author.qid and author.qid == 'Q4233718' then if author.qid then
-- ignore anonymous -- ignore anonymous
if author.qid ~= 'Q4233718' then
table.insert(missing_names, author.label .. "&nbsp;<span title='edit author in Wikidata'>[[File:Wikidata-logo.svg|16px|alt=|link=[[:d:" .. author.qid .. "]] ]]</span>")
end
else else
table.insert(missing_names, author.label) table.insert(missing_names, author.label)
end end
@ -868,8 +871,11 @@ local function _cite_q (citeq_args)
end end
for i, editor in pairs(names.editors or {}) do for i, editor in pairs(names.editors or {}) do
if not editor.last and i <= (citeq_args['display-editors'] or editor_count) then if not editor.last and i <= (citeq_args['display-editors'] or editor_count) then
if editor.qid and editor.qid == 'Q4233718' then if editor.qid then
-- ignore anonymous -- ignore anonymous
if editor.qid ~= 'Q4233718' then
table.insert(missing_names, editor.label .. "&nbsp;<span title='edit editor in Wikidata'>[[File:Wikidata-logo.svg|16px|alt=|link=[[:d:" .. editor.qid .. "]] ]]</span>")
end
else else
table.insert(missing_names, editor.label) table.insert(missing_names, editor.label)
end end
@ -877,8 +883,11 @@ local function _cite_q (citeq_args)
end end
for i, translator in pairs(names.translators or {}) do for i, translator in pairs(names.translators or {}) do
if not translator.last then if not translator.last then
if translator.qid and translator.qid == 'Q4233718' then if translator.qid then
-- ignore anonymous -- ignore anonymous
if translator.qid ~= 'Q4233718' then
table.insert(missing_names, translator.label .. "&nbsp;<span title='edit translator in Wikidata'>[[File:Wikidata-logo.svg|16px|alt=|link=[[:d:" .. translator.qid .. "]] ]]</span>")
end
else else
table.insert(missing_names, translator.label) table.insert(missing_names, translator.label)
end end