Module:Script doc auto and Module:Script doc auto/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
cleanup code |
Restore |
||
Line 12: | Line 12: | ||
p.core = function(page) |
p.core = function(page) |
||
local |
local mfd = '' |
||
local content = mw.title.new(page).content |
local content = mw.title.new(page).content |
||
local result = content:match("/%* ({{mfd.-}})") |
local result = content:match("/%* ({{mfd.-}})") |
||
if result then |
if result then |
||
mfd = mw.getCurrentFrame():preprocess(result) |
|||
end |
end |
||
local len = page:len() |
local len = page:len() |
||
if len < 4 then |
if len < 4 then |
||
-- Too short page name, do nothing |
-- Too short page name, do nothing |
||
return |
return mfd |
||
end |
end |
||
Line 29: | Line 27: | ||
local basepage = page:sub(0, -5) |
local basepage = page:sub(0, -5) |
||
local sisterpage = basepage..'.js' |
local sisterpage = basepage..'.js' |
||
return mfd .. p.makeMessage('css', mw.title.new(basepage), mw.title.new(sisterpage), 'js') |
|||
end |
|||
if page:sub(-3, -1) == '.js' then |
|||
local basepage = page:sub(0, -4) |
local basepage = page:sub(0, -4) |
||
local sisterpage = basepage..'.css' |
local sisterpage = basepage..'.css' |
||
return mfd .. p.makeMessage('js', mw.title.new(basepage), mw.title.new(sisterpage), 'css') |
|||
end |
end |
||
return text |
|||
end |
end |
||
local skins = |
local skins = { |
||
['common'] = true, |
|||
'common', 'vector-2022', 'vector', 'timeless', 'minerva', 'monobook', 'modern', 'cologneblue' |
|||
['vector-2022'] = true, |
|||
⚫ | |||
['vector'] = true, |
|||
['timeless'] = true, |
|||
['minerva'] = true, |
|||
['monobook'] = true, |
|||
['modern'] = true, |
|||
['cologneblue'] = true |
|||
⚫ | |||
p.gadget_text = function(name, repo) |
p.gadget_text = function(name, repo) |