মডিউল:Test
এই মডিউলের জন্য মডিউল:Test/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে
local p = {}
function p.getPagesInNamespace(frame)
local ns = mw.text.trim(frame.args[1] or '') -- Get the namespace from the first argument
if ns == '' then
ns = 'ছন্দ' -- Default to ছন্দ namespace if no namespace is provided
end
local nsNumber = mw.site.namespaces[ns].id -- Get the namespace ID
if not nsNumber then
return "Error: Invalid namespace"
end
local pages = {}
local allPagesInNamespace = mw.site.namespaces[nsNumber].pages -- Get all pages in the namespace
for title, _ in pairs(allPagesInNamespace) do
table.insert(pages, title)
end
-- Sort the pages alphabetically
table.sort(pages)
-- Create a bulleted list of the pages
local list = mw.html.create('ul')
for _, title in ipairs(pages) do
list:tag('li'):wikitext('[[' .. title .. ']]')
end
return tostring(list)
end
return p