440
edits
(after Module:Details) |
m (7 revisions imported from wikipedia:Module:Broader) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 3:
-- the {{broader}} template.
--]]
local mHatlist = require('Module:Hatnote list')
local mHatnote = require('Module:Hatnote')
local mArguments -- lazily
local mTableTools --lazily initialize
local p = {}
local s = { --localizable strings
}
function p.broader(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local
local args = mTableTools.compressSparseArray(originalArgs)
local topic = args[2]▼
-- re-add non-numeric arguments omitted by compressSparseArray
if not page then▼
for _, name in pairs({'category', 'selfref', 'topic'}) do
args[name] = originalArgs[name]
end▼
end
return mHatnote.makeWikitextError(
'no page name specified',
Line 21 ⟶ 36:
)
end
local
selfref = args.selfref,▼
local text = string.format(s.broaderForm, topic, list)
▲ }
▲ return p._broader(page, topic, options)
▲end
▲function p._broader(page, topic, options)
▲ topic = topic or 'this topic'
▲ local text = string.format('For a broader coverage related to %s, see %s.', topic, page)
return mHatnote._hatnote(text, options)
end
|