317
редагувань
starcitizen>Alistair3149 Немає опису редагування |
м (56 ревізій: Template:Infobox_Species from StarCitizenTools) |
||
| (Не показані 7 проміжних версій 2 користувачів) | |||
| Рядок 105: | Рядок 105: | ||
local function getDynamicRequireList( query ) | local function getDynamicRequireList( query ) | ||
local isDynamic = true; | local isDynamic = true; | ||
if query:find( '%.%.' ) then | if query:find( '%.%.' ) then | ||
query = mw.text.split( query, '..', true ) | query = mw.text.split( query, '..', true ) | ||
| Рядок 112: | Рядок 113: | ||
else | else | ||
local _; _, query = query:match( '(["\'])(.-)%1' ) | local _; _, query = query:match( '(["\'])(.-)%1' ) | ||
if query == nil then | |||
return {}, isDynamic | |||
end | |||
local replacements; | local replacements; | ||
query, replacements = query:gsub( '%%%a', '%%' ) | query, replacements = query:gsub( '%%%a', '%%' ) | ||
| Рядок 318: | Рядок 324: | ||
return invokeList | return invokeList | ||
end | end | ||
| Рядок 357: | Рядок 336: | ||
string.format( 'This module is neither invoked by a template nor required/loaded by another module. If this is in error, make sure to add <code>{{[[Template:Documentation|Documentation]]}}</code>/<code>{{[[Template:No documentation|No documentation]]}}</code> to the calling template\'s or parent\'s module documentation.', | string.format( 'This module is neither invoked by a template nor required/loaded by another module. If this is in error, make sure to add <code>{{[[Template:Documentation|Documentation]]}}</code>/<code>{{[[Template:No documentation|No documentation]]}}</code> to the calling template\'s or parent\'s module documentation.', | ||
pageName | pageName | ||
) | ), | ||
{ icon = 'WikimediaUI-Alert.svg' } | |||
) .. category | ) .. category | ||
end | end | ||
| Рядок 611: | Рядок 591: | ||
) | ) | ||
table.insert( res, mHatnote._hatnote( msg, { icon='WikimediaUI-Code.svg' } ) ) | table.insert( res, mHatnote._hatnote( msg, { icon='WikimediaUI-Code.svg' } ) ) | ||
end | end | ||
| Рядок 670: | Рядок 626: | ||
moduleIsUsed = true -- Don't show sandbox modules as unused | moduleIsUsed = true -- Don't show sandbox modules as unused | ||
end | end | ||
if currentPageName:find( '^Template:' ) then | if currentPageName:find( '^Template:' ) then | ||
local ok, invokeList = pcall( getInvokeCallList, currentPageName ) | local ok, invokeList = pcall( getInvokeCallList, currentPageName ) | ||
if ok then | if ok then | ||
return formatInvokeCallList( currentPageName, addCategories, invokeList | return formatInvokeCallList( currentPageName, addCategories, invokeList ) | ||
else | else | ||
return userError(invokeList) | return userError(invokeList) | ||
| Рядок 741: | Рядок 695: | ||
table.insert( res, formatUsedTemplatesList( currentPageName, addCategories, usedTemplateList ) ) | table.insert( res, formatUsedTemplatesList( currentPageName, addCategories, usedTemplateList ) ) | ||
table.insert( res, formatRequiredByList( currentPageName, addCategories, whatModulesLinkHere ) ) | table.insert( res, formatRequiredByList( currentPageName, addCategories, whatModulesLinkHere ) ) | ||
if addCategories then | if addCategories then | ||