Module:RecursiveSelectiveList
Documentation for this module may be created at Module:RecursiveSelectiveList/doc
local p = {}
local mw = require('mw')
-- Function to fetch content from a specified page
function p.getPageContent(pageTitle)
-- Check if a page title is provided
if not pageTitle or pageTitle == "" then
return "Error: No page title provided."
end
-- Use the MediaWiki API to fetch the page content
local status, content = pcall(function()
return mw.title.new(pageTitle):getContent()
end)
-- Handle errors or return content
if not status or not content then
return "Error: Unable to fetch content for page '" .. pageTitle .. "'."
end
return content or "Error: Page content is empty."
end
-- Function to be invoked from templa