Module:Cite Q/sandbox: Difference between revisions

Content deleted Content added
local getValue
tidy
Line 164:
 
function citeq.cite_q (frame)
local citeq_args = {};
local qid;
local wdl;
 
local pframepargs = frame:getParent().args -- first get parent frame arguments - these from the template call
local args = pframeframe.args; -- firstnow get parent frame arguments - these (from the template callwikisource)
 
args.publisher = getValue( {'P123', ps = 1, qid = args.qid, args.publisher } )
for k, v in pairs (args) do -- copy named parameters and their values into citeq_args
if type( k ) == 'string' then -- numbered parameters ignored
if 'unset' == v then
citeq_args[k] = ''; -- set the parameter to empty string; this may be used later to unset authors and editors
else
citeq_args[k] = v;
end
end
end
args = frame.args; -- now get frame arguments (from the template wikisource)
 
args.publisher = getValue( {'P123', ps = 1, qid = args.qid } )
 
for k, v in pairs (args) do -- copy args into citeq_args
if 'qid'k == k'qid' then -- don't copy qid
qid = v; -- save its value
elseif 'wdlinks'k == k'wdlinks' then -- don't copy wdlinks
wdl = v; -- save its value
else
Line 194 ⟶ 182:
end
end
 
for k, v in pairs (argspargs) do -- copy named parameters and their values into citeq_args
if type( k ) == 'string' then -- numbered parameters ignored
if 'unset'v == v'unset' then
citeq_args[k] = ''; -- set the parameter to empty string; this may be used later to unset authors and editors
else
citeq_args[k] = v;
end
end
end
 
if is_set (qid) then