کاربر ناشناس
Remove any Template: namespace designation from the demo arg
جز (۱ نسخه واردشده) |
(Remove any Template: namespace designation from the demo arg) |
||
خط ۸: | خط ۸: | ||
local namespace = mw.title.getCurrentTitle().namespace | local namespace = mw.title.getCurrentTitle().namespace | ||
if frame.args["demo"] and frame.args["demo"] ~= "" then | if frame.args["demo"] and frame.args["demo"] ~= "" then | ||
template = frame.args["demo"] | template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","") | ||
elseif namespace == 10 then -- Template namespace | elseif namespace == 10 then -- Template namespace | ||
template = mw.title.getCurrentTitle().text | template = mw.title.getCurrentTitle().text | ||
خط ۲۰: | خط ۲۰: | ||
if namespace == 10 or namespace == 828 then | if namespace == 10 or namespace == 828 then | ||
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end | template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end | ||
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end | |||
local index = mw.ustring.sub(mw.title.new(template).text,1,1) | local index = mw.ustring.sub(mw.title.new(template).text,1,1) | ||
local status, data = pcall(function () | local status, data = pcall(function () | ||
خط ۴۱: | خط ۴۲: | ||
end | end | ||
-- Tabulate this data for [[ | -- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]] | ||
function p.tabulate(frame) | function p.tabulate(frame) | ||
local list = {} | local list = {} |