Module:ISBN

require('strict')

local p = {}

local getArgs = require('Module:Arguments').getArgs

local function check_isbn(args) return require('Module:Check isxn').check_isbn({args = args}) end

local function error_message(message) return require('Module:Error')['error']({message}) end

function p._ISBN(args) if not args[1] then return error_message('Missing ISBN') end local source =  .. (args[2] or 'ISBN') .. ' ' .. args[1] ..  local check = check_isbn({[1] = args[1], ['error'] = ' Invalid ISBN '}) local cat = '' if mw.title.getCurrentTitle:inNamespaces(0) then cat = '' end return source .. check .. cat end

function p.ISBN(frame) return p._ISBN(getArgs(frame)) end

return p