Module:File

local p = {}

function p.content(frame) local text = mw.text.trim(frame.args[1]) local title = mw.title.new(text) local content = title:getContent return content end

function p.information(frame) local text = mw.text.trim(frame.args[1]) local namespace = 'File' local title = mw.title.new(text, namespace) local content = title:getContent if string.find(string.lower(content), '{{information', 1, false) ~= nil then return  .. title.fullText ..  else return nil end end

-- Does not work. Can't read from Special namespace. function p.links(frame) local text = mw.text.trim(frame.args[1]) local result = '' for line in string.gmatch(text, "[^\n]+") do		if string.sub(line, 1, 5) == 'File:' then local title = mw.title.new('BrokenRedirects', 'Special') local content = title:getContent result = result .. line .. ' '       	if content ~= nil then result = result .. content .. ' '       	end result = result .. ' '       end end return result end

function p.test return mw.site.namespaces['User'].id end

return p