Documentation for this module may be created at Module:Worldbuilders/doc
local p = {}
-- Function to fetch and return the Worldbuilder section
local function getWorldbuilderSection()
local pageTitle = mw.title.getCurrentTitle().text
local talkPageTitle = 'Talk:' .. pageTitle
local talkPage = mw.title.new(talkPageTitle)
local talkContent = talkPage:getContent()
if not talkContent then
return ''
end
local sectionPattern = '==%s*Worldbuilder%s*==(.*)'
local worldbuilderSection = talkContent:match(sectionPattern)
if not worldbuilderSection then
return ''
end
return worldbuilderSection
end
-- Automatically execute the function when the module is invoked
p = getWorldbuilderSection()
return p
