Jump to content

Module:Title: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Created page with 'local p local currentTitle = mw.title.getCurrentTitle() for k,_ in pairs(currentTitle) do p[k] = function(frame) local args = require("Module:Arguments").getArgs(frame) local title = args.title and mw.title.new(args.title) or currentTitle return currentTitle[k] end end return p'
 
No edit summary
Line 1: Line 1:
local p
local p = {}
local currentTitle = mw.title.getCurrentTitle()
local currentTitle = mw.title.getCurrentTitle()



Revision as of 19:42, 22 August 2024

local p = {}
local currentTitle = mw.title.getCurrentTitle()

for k,_ in pairs(currentTitle) do
	p[k] = function(frame)
		local args = require("Module:Arguments").getArgs(frame)
		local title = args.title and mw.title.new(args.title) or currentTitle
		return currentTitle[k]
	end
end

return p