Module:Shortcut: Difference between revisions
add a nocat option to suppress category output
(calculate the number of list items based on a table of list items, rather than doing it ad hoc from the shortcuts plus whatever else we want to add) |
(add a nocat option to suppress category output) |
||
Line 5: | Line 5: | ||
-- Load required modules | -- Load required modules | ||
local yesno = require('Module:Yesno') | |||
local checkType = require('libraryUtil').checkType | local checkType = require('libraryUtil').checkType | ||
Line 85: | Line 86: | ||
-- Error category | -- Error category | ||
if shortcuts[1] then | if shortcuts[1] and not yesno(options.nocat) then | ||
local title = mw.title.new(shortcuts[1]) | local title = mw.title.new(shortcuts[1]) | ||
if not title or not title.exists then | if not title or not title.exists then |