Module:LuaTemplateBlueprint: Difference between revisions
// via Wikitext Extension for VSCode Tag: Manual revert |
// via Wikitext Extension for VSCode |
||
| (8 intermediate revisions by the same user not shown) | |||
| Line 65: | Line 65: | ||
-- Wiki link pattern for regex matching | -- Wiki link pattern for regex matching | ||
local WIKI_LINK_PATTERN = '%[%[.-%]%]' | local WIKI_LINK_PATTERN = '%[%[.-%]%]' | ||
-- Empty table for returning when needed | -- Empty table for returning when needed | ||
local EMPTY_OBJECT = {} | local EMPTY_OBJECT = {} | ||
| Line 75: | Line 72: | ||
local ErrorHandling = require('Module:ErrorHandling') | local ErrorHandling = require('Module:ErrorHandling') | ||
local ConfigRepository = require('Module:ConfigRepository') | local ConfigRepository = require('Module:ConfigRepository') | ||
local ConfigHelpers = require('Module:ConfigHelpers') | |||
local TemplateHelpers = require('Module:TemplateHelpers') | local TemplateHelpers = require('Module:TemplateHelpers') | ||
local TemplateStructure = require('Module:TemplateStructure') | local TemplateStructure = require('Module:TemplateStructure') | ||
| Line 343: | Line 341: | ||
-- ========== Configuration Integration ========== | -- ========== Configuration Integration ========== | ||
-- Initialize the standard configuration for a template | -- Initialize the standard configuration for a template | ||
-- Combines base config from ConfigRepository with template overrides | -- Combines base config from ConfigRepository with template overrides | ||
| Line 361: | Line 348: | ||
local templateType = template.type | local templateType = template.type | ||
local configOverrides = template.config or {} | local configOverrides = template.config or {} | ||
-- Get base configuration from repository | -- Get base configuration from repository | ||
local baseConfig = ConfigRepository.getStandardConfig(templateType) | local baseConfig = ConfigRepository.getStandardConfig(templateType) | ||
-- | -- Use ConfigHelpers to deep merge configurations | ||
local config = | local config = ConfigHelpers.deepMerge(baseConfig, configOverrides) | ||
-- Store complete config in template | -- Store complete config in template | ||
template.config = config | template.config = config | ||
| Line 398: | Line 368: | ||
end) | end) | ||
end | end | ||
return config | return config | ||
end | end | ||
| Line 704: | Line 674: | ||
template._processors = TemplateFieldProcessor.initializeProcessors(template) | template._processors = TemplateFieldProcessor.initializeProcessors(template) | ||
return template._processors | return template._processors | ||
end | end | ||
| Line 1,228: | Line 1,189: | ||
end | end | ||
ErrorHandling.addStatus(template._errorContext, "LuaTemplateBlueprint", " | ErrorHandling.addStatus(template._errorContext, "LuaTemplateBlueprint", "Now rendering " .. template.type) | ||
if not template.config.meta then | if not template.config.meta then | ||