Content deleted Content added
No edit summary |
Add in1-4; |
||
Line 1:
f = {
args_default = {
err_msg = '',
-- contribution = '',
-- separator = '.';
Line 38 ⟶ 39:
local contributors; -- chapter or contribution authors
local source = ''; -- editor/author date list that forms a CITEREF link to a full citation; mimics harvnb output except year in parentheses
local result; -- the assemby of the above output
Line 58 ⟶ 59:
contributors = args.last1 .. args.first;
else
args.err_msg =
end
Line 71 ⟶ 72:
source = args.in1;
else
err_msg = '<span style="font-size:100%" class="error">author missing from source list</span>'▼
end
source = source .. ' (' .. args.year .. ')'; else
end
source = "[[#CITEREF" .. mw.uri.anchorEncode(table.concat ({args.in1, args.in2, args.in3, args.in4, args.year})) .. "|" .. source .. "]]";
Line 87 ⟶ 91:
contributors = contributors .. args.separator; -- add separator if not same as last character in name list (|first=John S. or et al.)
end
--wrap error messages in span
▲
-- and put it all together
result = span_open_tag .. contributors .. ' ' .. args.contribution .. args.separator .. ' In ' .. source .. args.postscript .. '</span>' .. args.err_msg;
-- if '' == args.year then
Line 97 ⟶ 104:
-- end
▲-- args.year = '<span style="font-size:100%" class="error">missing year</span>'; -- error message if year not provided
return result;
Line 124 ⟶ 128:
args.in4 = pframe.args.in4 or '';
args.last1 = pframe.args.last or pframe.args.last1 or ''; -- contribution author(s)
args.last2 = pframe.args.last2 or '';
Line 140 ⟶ 141:
args.postscript = '.'; -- use default postscript
end
args.
args.url = pframe.args.url or ''; -- url for chapter or contribution
args.year = pframe.args.year or '';
if '' == args.contribution then
args.
-- args.url=''; -- if no contribution set url to empty string so we don't link the error message
end
|