Difference between revisions of "Module:Extension"

1,780 bytes removed ,  00:54, 1 October 2021
Dropped support for deprecated types since Category:Extensions with deprecated types is empty and has been for a while
>P858snake
m (+CC-BY-SA-2.0-UK)
>Pppery
(Dropped support for deprecated types since Category:Extensions with deprecated types is empty and has been for a while)
Line 95: Line 95:
['user activity']  = { '[[Manual:Security|User activity]]',                      'User activity extensions' },
['user activity']  = { '[[Manual:Security|User activity]]',                      'User activity extensions' },
variable            = { '[[Manual:Variables|Variable]]',                          'Variable extensions' },
variable            = { '[[Manual:Variables|Variable]]',                          'Variable extensions' },
-- DEPRECATED TYPES (as per 2007-09 taxonomy discussion)
category            = { 'Category',                                              'Category extensions',  deprecated = true },
form                = { 'Form',                                                  'Form extensions',      deprecated = true },
list                = { 'List',                                                  'List extensions',      deprecated = true },
namespace          = { '[[Manual:Namespaces|Namespace]]',                        'Namespace extensions', deprecated = true },
['table']          = { 'Table',                                                  'Table extensions',    deprecated = true },
}
}


Line 107: Line 101:
pfunc = 'parser function',
pfunc = 'parser function',
special = 'special page',
special = 'special page',
}
-- DEPRECATED TYPES (multiple types handled via type1,type2,...)
local deprecatedTypes = {
['link, tag, special'] = { 'link', 'tag', 'special page' },
['parser function, special'] = { 'parser function', 'special page' },
['tag, parser function'] = { 'tag', 'parser function' },
['tag, parser function, special'] = { 'tag', 'parser function', 'special page' },
['tag, special'] = { 'tag', 'special page' },
['parser, pfunc'] = { 'parser function' },
['parser, hook, special'] = { 'tag' --[[ sic ]], 'hook', 'special page' },
}
}


Line 145: Line 128:
if cnf then
if cnf then
res = cnf[1] .. '[[Category:' .. cnf[2] .. translation .. ']]'
res = cnf[1] .. '[[Category:' .. cnf[2] .. translation .. ']]'
if cnf.deprecated then
res = res .. '\'\'-deprecated\'\'' ..
tcat( 'Extensions with deprecated types' )
end
else
else
cnf = deprecatedTypes[str]
if str == '_missing_' then
if cnf then
local dtypes = {}
for _, sstr in ipairs( cnf ) do
table.insert( dtypes, getType( sstr ) )
end
res = table.concat( dtypes, ', ' ) ..
'<br />\'\'(deprecated, please use [[Special:MyLanguage/Template:Extension/doc#type|type1,type2'
if #cnf > 2 then
res = res .. ',type3'
end
res = res .. ']] instead)\'\'' .. tcat( 'Extensions with deprecated types' )
elseif str == '_missing_' then
res = tcat( 'Extensions with invalid or missing type' )
res = tcat( 'Extensions with invalid or missing type' )
elseif str == '_demomode_' then
elseif str == '_demomode_' then
Anonymous user