Editing Module:Documentation

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 36: Line 36:
local p = {}
local p = {}
p.i18n = i18n
p.i18n = i18n
-- Capitalizes first letter of strings
-- src: https://stackoverflow.com/questions/2421695/first-character-uppercase-lua
local function firstToUpper(str)
    return (str:gsub("^%l", string.upper))
end


-- --------------------------------------------------------------------------
-- --------------------------------------------------------------------------
Line 142: Line 136:
function p.resolveNamespace(subjectSpace, upperPlural)
function p.resolveNamespace(subjectSpace, upperPlural)
if subjectSpace == 10 then -- Template namespace
if subjectSpace == 10 then -- Template namespace
if upperPlural then return 'Templates'
if upperPlural then return 'templates'
else return 'template' end
else return 'template' end
elseif subjectSpace == 828 then -- Module namespace
elseif subjectSpace == 828 then -- Module namespace
if upperPlural then return 'Modules'
if upperPlural then return 'modules'
else return 'module' end
else return 'module' end
elseif subjectSpace == 6 then -- File namespace
elseif subjectSpace == 6 then -- File namespace
if upperPlural then return 'Files'
if upperPlural then return 'files'
else return 'file' end
else return 'file' end
end
end
Line 814: Line 808:
if checkExists(env.docTitle.prefixedText) then
if checkExists(env.docTitle.prefixedText) then
tags[2] = lnkdta:tag('td')
tags[2] = lnkdta:tag('td')
tags[2]:wikitext('[[' .. env.docTitle.prefixedText .. '|' .. firstToUpper(p.message('doc-link-display')) .. ']]')
tags[2]:wikitext('[[' .. env.docTitle.prefixedText .. '|' .. p.message('doc-link-display') .. ']]')
colspan = colspan + 1
colspan = colspan + 1
end
end
if checkExists(env.sandboxTitle.prefixedText) then
if checkExists(env.sandboxTitle.prefixedText) then
tags[3] = lnkdta:tag('td')
tags[3] = lnkdta:tag('td')
tags[3]:wikitext('[[' .. env.sandboxTitle.prefixedText .. '|' .. firstToUpper(i18n:msg('sandbox-link-display')) .. ']]')
tags[3]:wikitext('[[' .. env.sandboxTitle.prefixedText .. '|' .. i18n:msg('sandbox-link-display') .. ']]')
colspan = colspan + 1
colspan = colspan + 1
end
end
Please note that all contributions to The Petit Planet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see Petit Planet Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template
Below are commonly used wikitext from MediaWiki:Edittools. Click on any to insert them in the edit box.
File Pages==Summary====Licensing=={{Fairuse}}{{File|}}
Dynamic Page List¦²«»²{¦}²«»«/»«!----»
Array in DPL¹^2{}^2^2{¹}^2
Parser Functions{{#if:||}}
{{#ifeq:|||}}
{{#expr:}}
{{#switch:||#default=}}
{{#replace:||}}
{{#titleparts:}}
{{#tag:|}}
Markup{{}}|[][[]][[Category:]]#REDIRECT [[]] [[Category:Redirect Pages]]<code></code><includeonly></includeonly><noinclude></noinclude><nowiki></nowiki><!----><br>§
Notices{{Stub|}}{{Stub Dialogue}}{{Upcoming}}{{Under Construction}}{{Placeholder|}}
Magic Words{{!}}{{formatnum:}}{{lc:}}{{uc:}}{{PAGENAME}}{{FULLPAGENAME}}{{ROOTPAGENAME}}{{BASEPAGENAME}}{{SUBPAGENAME}}{{DISPLAYTITLE:|noreplace}}__TOC____NOTOC____EXPECTUNUSEDCATEGORY____HIDDENCAT__
HTML Entities&mdash;&nbsp;&comma;&shy;

Page included on this page: