Module:Config: Difference between revisions
Created page with "-- <pre> -------------------------------------------------------------------------------- -- Allows wikis to locally override `/config` subpages of modules. -- -- @script config -- @alias p -- @release experimental -- @require Module:No globals -- @require Module:TableTools -- @author User:ExE Boss -- @see Module:I18n - Inspired the way in which the @{Config} class works. -------------------------------------------------------------------------------- lo..." |
update to no longer require Devwiki (from petitplanet wiki, page created by Stevium) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
-- <pre> | -- <pre> | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
-- Source: https://genshin-impact.fandom.com/wiki/Module:Config | |||
-- Allows wikis to locally override `/config` subpages of modules. | -- Allows wikis to locally override `/config` subpages of modules. | ||
-- | -- | ||
| Line 18: | Line 19: | ||
local tableTools = require('Module:TableTools'); | local tableTools = require('Module:TableTools'); | ||
local p = {}; | local p = {}; | ||
| Line 115: | Line 113: | ||
source = string.gsub(source, '^.', mw.ustring.upper); | source = string.gsub(source, '^.', mw.ustring.upper); | ||
local hasNS = mw.ustring.find(source, ':'); | local hasNS = mw.ustring.find(source, ':'); | ||
if (not hasNS) then | |||
source = 'Module:' .. source .. '/config'; | |||
end | |||
cfg._data[#cfg._data + 1] = mw.loadData(source); | cfg._data[#cfg._data + 1] = mw.loadData(source); | ||