(Created page with "local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) local imageTitle = mw.title.new(args[1], "File") local description = imageTitle:getContent() if description then return description else return nil end end return p") |
No edit summary |
||
Line 5: | Line 5: | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
if args[1] == nil then return nil end | |||
local imageTitle = mw.title.new(args[1], "File") | local imageTitle = mw.title.new(args[1], "File") | ||
local description = imageTitle:getContent() | local description = imageTitle:getContent() |
Latest revision as of 22:39, 8 May 2023
Documentation for this module may be created at Module:FileDescription/doc
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
if args[1] == nil then return nil end
local imageTitle = mw.title.new(args[1], "File")
local description = imageTitle:getContent()
if description then
return description
else
return nil
end
end
return p