Changes
Added support for Template:refbegin and Template:refend.
local references = z.wikitext.tag(frame, {name="references",contents=contents,params={group=group}})
return z.wikitext.tag(frame, {name="div",contents=references,params=params})
end
function refbegin0(frame, config, args)
local contents = args.refs or ""
local liststyle = args.liststyle
local indent = args.indent
local indentsize = args.indentsize
local count = args[1]
local width = args.colwidth
local group = args.group or config.default_group
local params = {}
if ( nil == tonumber(count) and nil == width ) then
width = count
count = nil
end
if ( nil == liststyle ) then
if ( "upper-alpha" == group or "lower-alpha" == group or "upper-roman" == group or "lower-roman" == group or "upper-greek" == group or "lower-greek" == group ) then
liststyle = group
else
liststyle = config.default_liststyle
end
end
params.class = "refbegin"
params.style = z.wikitext.liststyle(liststyle)
if ( nil ~= count ) then
params.class = params.class .. " references-column-count references-column-count-" .. count
params.style = params.style .. " " .. z.wikitext.columncountstyle(count)
end
if ( nil ~= width ) then
params.class = params.class .. " references-column-width"
params.style = params.style .. " " .. z.wikitext.columnwidthstyle(width)
end
local dlopen
if ( nil ~= indent ) then
dlopen = z.wikitext.OpenHTMLTag(frame, {name="dl",params={style="text-indent: -" .. (indentsize or "3.2") .. "em;"}})
else
dlopen = ""
end
return z.wikitext.OpenHTMLTag(frame, {name="div",params=params}) .. dlopen
end
function refbegin0(frame, config, args)
local liststyle = args.liststyle
local indent = args.indent
local indentsize = args.indentsize
local count = args[1]
local width = args.colwidth
local group = args.group or config.default_group
if ( nil == tonumber(count) and nil == width ) then
width = count
count = nil
end
if ( nil == liststyle ) then
if ( "upper-alpha" == group or "lower-alpha" == group or "upper-roman" == group or "lower-roman" == group or "upper-greek" == group or "lower-greek" == group ) then
liststyle = group
else
liststyle = config.default_liststyle
end
end
local params = {}
params.class = "refbegin"
params.style = z.wikitext.liststyle(liststyle)
if ( nil ~= count ) then
params.class = params.class .. " references-column-count references-column-count-" .. count
params.style = params.style .. " " .. z.wikitext.columncountstyle(count)
end
if ( nil ~= width ) then
params.class = params.class .. " references-column-width"
params.style = params.style .. " " .. z.wikitext.columnwidthstyle(width)
end
local dlopen
if ( nil ~= indent ) then
dlopen = z.wikitext.OpenHTMLTag(frame, {name="dl",params={style="text-indent: -" .. (indentsize or "3.2") .. "em;"}})
else
dlopen = ""
end
return z.wikitext.OpenHTMLTag(frame, {name="div",params=params}) .. dlopen
end
function refbegin0(frame, config, args)
local liststyle = args.liststyle
local indent = args.indent
local indentsize = args.indentsize
local count = args[1]
local width = args.colwidth
local group = args.group or config.default_group
if ( nil == tonumber(count) and nil == width ) then
width = count
count = nil
end
if ( nil == liststyle ) then
if ( "upper-alpha" == group or "lower-alpha" == group or "upper-roman" == group or "lower-roman" == group or "upper-greek" == group or "lower-greek" == group ) then
liststyle = group
else
liststyle = config.default_liststyle
end
end
local params = {}
params.class = "refbegin"
params.style = z.wikitext.liststyle(liststyle)
if ( nil ~= count ) then
params.class = params.class .. " references-column-count references-column-count-" .. count
params.style = params.style .. " " .. z.wikitext.columncountstyle(count)
end
if ( nil ~= width ) then
params.class = params.class .. " references-column-width"
params.style = params.style .. " " .. z.wikitext.columnwidthstyle(width)
end
local dlopen
if ( nil ~= indent ) then
dlopen = z.wikitext.OpenHTMLTag(frame, {name="dl",params={style="text-indent: -" .. (indentsize or "3.2") .. "em;"}})
else
dlopen = ""
end
return z.wikitext.OpenHTMLTag(frame, {name="div",params=params}) .. dlopen
end
function refend0(frame, config, args)
local indent = args.indent
local dlclose
if ( nil ~= indent ) then
dlclose = "</dl>"
else
dlclose = ""
end
return dlclose .. "</div>"
end
local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template
return reflist0(frame, config, args)
end
-- This is used by template {{refbegin}}.
function z.refbegin(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
return refbegin0(frame, config, args)
end
-- This is used by template {{refend}}.
function z.refend(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
return refend0(frame, config, args)
end