386
edits
(make this a lot simpler - the original module was overkill for what it was trying to do) |
m (24 revisions imported from wikipedia:Module:File_link: see Topic:Vtixlm0q28eo6jtf) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
-- This module provides a library for formatting file wikilinks. | -- This module provides a library for formatting file wikilinks. | ||
local yesno = require('Module:Yesno') | |||
local checkType = require('libraryUtil').checkType | local checkType = require('libraryUtil').checkType | ||
Line 57: | Line 58: | ||
end | end | ||
-- Border | |||
if yesno(args.border) then | |||
ret[#ret + 1] = 'border' | |||
end | |||
addPositional('location') | addPositional('location') | ||
addPositional('alignment') | addPositional('alignment') | ||
Line 79: | Line 84: | ||
wrappers = 'Template:File link' | wrappers = 'Template:File link' | ||
}) | }) | ||
if not origArgs.file then | |||
error("'file' parameter missing from [[Template:File link]]", 0) | |||
end | |||
-- Copy the arguments that were passed to a new table to avoid looking up | -- Copy the arguments that were passed to a new table to avoid looking up | ||
-- every possible parameter in the frame object. | -- every possible parameter in the frame object. |