Module:File link: Difference between revisions
Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]])
m (Yamaha5 صفحهٔ module:File link/تمرین را بدون برجایگذاشتن تغییرمسیر به module:File link منتقل کرد) |
(Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]])) |
||
Line 14: | Line 14: | ||
if type(val) ~= 'string' then | if type(val) ~= 'string' then | ||
error(string.format( | error(string.format( | ||
" | "type error in '%s' parameter of '_main' (expected string, got %s)", | ||
key, type(val) | key, type(val) | ||
), level) | ), level) | ||
Line 45: | Line 45: | ||
-- Filename | -- Filename | ||
checkArg('file', args.file, 3) | checkArg('file', args.file, 3) | ||
ret[#ret + 1] = ' | ret[#ret + 1] = 'File:' .. args.file | ||
-- Format | -- Format | ||
Line 82: | Line 82: | ||
function p.main(frame) | function p.main(frame) | ||
local origArgs = require('Module:Arguments').getArgs(frame, { | local origArgs = require('Module:Arguments').getArgs(frame, { | ||
wrappers = ' | wrappers = 'Template:File link' | ||
}) | }) | ||
if not origArgs.file then | if not origArgs.file then | ||
error(" | error("'file' parameter missing from [[Template:File link]]", 0) | ||
end | end | ||