Changes

Jump to navigation Jump to search

Module:Citation

1,094 bytes added, 04:47, 7 September 2012
Added function for Template:note label.
if ( args.noid == nil or args.noid == "" ) then params.id = "ref_" .. P1 .. P3 end
return mw.text.tag({name="sup",contents=contents,params=params})
end
 
-- This is used by template {{note label}}.
function z.notelabel(frame)
local pframe = frame:getParent()
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template
local id = args[1] or ""
local arrow = args[3] or ""
local postscript = args[4] or ""
local contents
if arrow ~= "" then
local sup_arrow = mw.text.tag({name="sup",contents=arrow,params={}})
contents = "[[#ref_" .. id .. arrow .. "|'''" .. sup_arrow .. "''']]" .. postscript
if "none" == arrow then arrow = "^" end -- Change this AFTER using it in the ID parameter and the contents.
else
contents = (args[2] or "") .. postscript
end
local params = { class="citation wikicite" }
if id ~= "" and ( args.noid == nil or args.noid == "" ) then
params.id = mw.url.encodeAnchor("endnote_" .. id .. arrow)
end
return mw.text.tag({name="span",contents=contents,params=params})
end
Anonymous user

Navigation menu