切换搜索
搜索
切换菜单
notifications
切换个人菜单
查看“模块:NavplateList”的源代码
来自决策链云智库
更多操作
←
模块:NavplateList
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} local dpl = require('Module:DPLlua').ask -- 假设Module:DPLlua是您提供的Lua脚本 function p.navplate(frame) local category = frame.args.category or '' local extraParam1 = frame.args.extraParam1 or '' local extraParam2 = frame.args.extraParam2 or '' local namespace = frame.args.namespace or '' -- 构建DPL查询 local query = { titlematch = category, -- 添加其它查询参数 -- ... format = 'json', -- 返回JSON格式以便处理 allowcachedresults = true -- 允许缓存结果 } if extraParam1 ~= '' then query.titlematch = extraParam1 end if extraParam2 ~= '' then query.titlematch = extraParam2 end if namespace ~= '' then query.namespace = namespace end -- 执行DPL查询 local result = dpl.ask(query) -- 格式化输出 local output = '' for _, page in ipairs(result) do output = output .. '* [[' .. page.title .. ']]\n' end return output end return p
本页使用的模板:
模块:NavplateList/doc
(
查看源代码
)
返回
模块:NavplateList
。