Difference between revisions of "Module:Broader"
Jump to navigation
Jump to search
blackwiki>Fgnievinski (after Module:Details) |
blackwiki>DePiep (rm stacking classes, not in regular hatnotes) |
||
| Line 32: | Line 32: | ||
local text = string.format('For a broader coverage related to %s, see %s.', topic, page) | local text = string.format('For a broader coverage related to %s, see %s.', topic, page) | ||
options = options or {} | options = options or {} | ||
| − | + | ||
return mHatnote._hatnote(text, options) | return mHatnote._hatnote(text, options) | ||
end | end | ||
return p | return p | ||
Revision as of 20:41, 9 June 2015
Implements {{broader}}.
--[[
-- This module produces a "For a broader coverage related to this topic" link. It implements
-- the {{broader}} template.
--]]
local mHatnote = require('Module:Hatnote')
local mArguments -- lazily initialise
local p = {}
function p.broader(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly = true})
local page = args[1]
local topic = args[2]
if not page then
return mHatnote.makeWikitextError(
'no page name specified',
'Template:Broader#Errors',
args.category
)
end
local options = {
selfref = args.selfref,
}
return p._broader(page, topic, options)
end
function p._broader(page, topic, options)
page = mHatnote._formatLink(page)
topic = topic or 'this topic'
local text = string.format('For a broader coverage related to %s, see %s.', topic, page)
options = options or {}
return mHatnote._hatnote(text, options)
end
return p