模块:首页:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
| 第33行: | 第33行: | ||
first = false | first = false | ||
else | else | ||
ul:wikitext(",") | ul:wikitext(", ") | ||
end | end | ||
ul:tag("span"):wikitext("[[" .. t .. "]]") | ul:tag("span"):wikitext("[[" .. t .. "]]") | ||
2021年4月2日 (五) 13:51的最新版本
此模块的文档可以在模块:首页/doc创建
local smw = require("Module:SMWUtils")
local p = {}
function p.latest_list(frame)
local user_query = frame.args.query
local query = user_query .. [[
|limit=20
|offset=0
|sort=Modification date
|order=desc
]]
local pages = smw.query_pages(query)
local ul = mw.html.create("ul")
for i, t in ipairs(pages) do
ul:tag("li"):wikitext("[[" .. t .. "]]")
end
return ul:done()
end
function p.latest_flat_list(frame)
local user_query = frame.args.query
local query = user_query .. [[
|limit=20
|offset=0
|sort=Modification date
|order=desc
]]
local pages = smw.query_pages(query)
local ul = mw.html.create()
local first = true
for i, t in ipairs(pages) do
if first then
first = false
else
ul:wikitext(", ")
end
ul:tag("span"):wikitext("[[" .. t .. "]]")
end
return ul:done()
end
return p