Module:Pagination
Appearance
Implements {{Pagination}}
local p = {}
local function makeWikitextError(msg)
return error(string.format('PaginationScriptError: "%s" ([[template:Pagination#Errors|help]])', msg), 2)
end
function p.pagination(frame)
args = frame.args
prevlink = args[1] or args.prevlink
nextlink = args[2] or args.nextlink
prevstyle = args.prevstyle or ''
nextstyle = args.nextstyle or ''
p = '<span class="prev-btn" style="' .. prevstyle .. '";>[[' .. prevlink .. '|Previous]]</span>'
n = '<span class="next-btn" style="' .. nextstyle .. '";>[[' .. nextlink .. '|Next]]</span>'
pntm = '' .. p .. ' ' .. n .. ''
if prevlink and nextlink == '' then
return makeWikitextError('no link provided for the previous and next buttons') else return pntm
end
if prevlink == '' or prevlink == nil then
return makeWikitextError('no link provided for the previous button') else return pntm
end
end
return p