Module:Documentation: Difference between revisions
From WikiOasis Meta
More actions
mediawiki>Uzume cherry pick Module wikitext support from w:en:Module:Documentation |
m 26 revisions imported |
||
| (29 intermediate revisions by 14 users not shown) | |||
| Line 82: | Line 82: | ||
ret[#ret + 1] = select(i, ...) | ret[#ret + 1] = select(i, ...) | ||
end | end | ||
return '<small | return '<small>(' .. table.concat(ret, ' | ') .. ')</small>' | ||
end | end | ||
| Line 331: | Line 331: | ||
function p._getModuleWikitext(args, env) | function p._getModuleWikitext(args, env) | ||
local currentTitle = mw.title.getCurrentTitle() | local currentTitle = mw.title.getCurrentTitle() | ||
if currentTitle.contentModel ~= 'Scribunto' then return end | if currentTitle.contentModel ~= 'Scribunto' then return end | ||
| Line 410: | Line 411: | ||
omargs.text = text | omargs.text = text | ||
omargs.class = message('sandbox-class') | omargs.class = message('sandbox-class') | ||
return messageBox.main('ombox', omargs) | |||
end | end | ||
| Line 538: | Line 537: | ||
local function escapeBrackets(s) | local function escapeBrackets(s) | ||
-- Escapes square brackets with HTML entities. | -- Escapes square brackets with HTML entities. | ||
return s | return s | ||
:gsub('%[', '[') -- Replace square brackets with HTML entities. | |||
:gsub('%]', ']') | |||
end | end | ||
| Line 855: | Line 854: | ||
local mirrorDisplay = message('mirror-link-display') | local mirrorDisplay = message('mirror-link-display') | ||
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay) | local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay) | ||
if subjectSpace == 828 then | |||
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary} | |||
end | |||
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink) | sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink) | ||
end | end | ||