Module:Pages
模块文档[创建]
您可能需要本Scribunto模块的文档创建。 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。 本模块的子页面。 |
local p = {};
local function get_page(title)
local frame = mw.getCurrentFrame()
local protect=string.gsub(frame:expandTemplate{ title = title }, "\n\n+", "double_breaks")
local remove=string.gsub(protect, "\n", "")
local restore=string.gsub(remove, "double_breaks", "\n\n")
return restore
end
out=""
function p.pages(code)
local index=code.args[1]
local from=tonumber(code.args[2])
local to=tonumber(code.args[3])
local page=from
while ( page<=to ) do
out=out..get_page(":page:"..index.."/"..page)
page=page+1
end
return out
end
return p;