Changes
Jump to navigation
Jump to search
local title = mw.title.getCurrentTitle()
local namespace = title.namespace
local title = mw.title.getCurrentTitle()
local namespace = title.namespace
local talkspace = (mw.site.talkNamespaces[namespace] ~= nil)
local testcases = (string.sub(title.subpageText,1,9) == 'testcases')
Update IAAF regex and formatter URL per d:Property:P1146, per talk; consolidate duplicate title calls & derivatives, expand use; from sandbox
local p = {}
local title = mw.title.getCurrentTitle()
local namespace = title.namespace
local talkspace = (mw.site.talkNamespaces[namespace] ~= nil)
local testcases = (string.sub(title.subpageText,1,9) == 'testcases')
--[[==========================================================================]]
function p.getCatForId( id )
local catName = ''
if namespace == 0 then
function p.redCatLink( catName ) --catName == 'Blah', not 'Category:Blah', not '[[Category:Blah]]'
if catName and catName ~= '' and testcases == false and mw.title.new(catName, 14).exists == false then
return '[[Category:Pages with red-linked authority control categories]]'
end
function p.iaafLink( id )
--P1146's format regex: [10-9][0-9]* (e.g. 123012) if not string.match( id, '^[1-9]%d*+$' ) then
return false
end
return '[https://www.iaaf.org/athletes/biographies_/athcode='..id..' '..id..']'..p.getCatForId( 'IAAF' )
end
function p.authorityControl( frame )
local resolveEntity = require( "Module:ResolveEntityId" )
local parentArgs = frame:getParent().args
local elements = {} --create/insert rows later