Home
Random
Log in
Settings
About the Petit Planet Wiki
Search
Editing
Module
:
Link Label
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
local p = {} local lib = require('Module:Feature') local TERMS = { ' %(Quest%)', ' %(Chapter%)', ' %(Act%)', ' %(Archon Quest%)', ' %(Story Quest%)', ' %(World Quest%)', ' %(Hangout Event%)', ' %(Event Quest%)', ' %(Event Chapter%)', ' %(Event Act%)', ' %(Commission%)', ' %(Soundtrack%)', ' %(Album%)', ' %(Event%)', ' %(NPC%)', ' %(Furnishing%)', ' %(Subarea%)', ' %(Area%)', ' %(Subregion%)', ' %(Domain%)', ' %(Quest Domain%)', ' %(Instance%)', ' %(Footprint%)', ' %(Character Card%)', ' %(Character Card Skill%)', ' %(Event Card%)', ' %(Equipment Card%)', ' %(Material%)', } function p.main(frame) local args = require('Module:Arguments').getArgs(frame, { parentFirst = true, wrapper = { 'Template:Link Label' } }) return p._main(args) end function p.getTerms() local result = mw.html.create() for _, term in ipairs(TERMS) do local replacedTerm, _ = term:gsub('%%', '') result:newline():wikitext('* '):tag('code'):wikitext(replacedTerm):done() end return result end function p._main(args) local link = type(args) == 'table' and args[1] or args local suffix = '' if (link == nil or type(link) == 'table') then return '' end link = tostring(link) if (link:find('%|')) then return link end -- if link contains multiple links local _, count = link:gsub('%[%[', '') if (count > 1) then return link end if (link:find('%[%[') and link:find('%]%]')) then link = link:gsub('%[%[', ''):gsub('%]%]', '') end local label = link for _, term in ipairs(TERMS) do if (link:find(term)) then label = link:gsub(term, '') end end -- Auto American English punctuation positioning as its a pain if args[2] == '.' or lib.isNotEmpty(args['dot']) or lib.isNotEmpty(args['dotspc']) then if label:find('"$') then if not label:find('[%.%?!,]"$') then label = label:gsub('"$', '."') end else suffix = suffix .. '.' end if lib.isNotEmpty(args['dotspc']) then suffix = suffix .. ' ' end elseif args[2] == ',' or lib.isNotEmpty(args['comma']) or lib.isNotEmpty(args['commaspc']) then if label:find('"$') then if not label:find('[%.%?!,]"$') then label = label:gsub('"$', ',"') end else suffix = suffix .. ',' end if lib.isNotEmpty(args['commaspc']) then suffix = suffix .. ' ' end end if args.nolink then return label .. suffix else return '[[' .. link .. '|' .. label .. ']]' .. suffix end end return p
Summary:
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:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html 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
—
,
­
Pages included on this page:
Template:Documentation/Header
(
edit
)
Template:Documentation/styles.css
(
edit
)
Template:T
(
edit
)
Template:TOC Right
(
edit
)
Module:Arguments
(
edit
)
Module:Arguments/i18n
(
edit
)
Module:Common/i18n
(
edit
)
Module:Config
(
edit
)
Module:Documentation
(
edit
)
Module:Documentation/config
(
edit
)
Module:Documentation/i18n
(
edit
)
Module:Entrypoint
(
edit
)
Module:Exists
(
edit
)
Module:Fallbacklist
(
edit
)
Module:Feature
(
edit
)
Module:Formatting
(
edit
)
Module:I18n
(
edit
)
Module:Languages
(
edit
)
Module:Link Label/doc
(
edit
)
Module:TableTools
(
edit
)
Module:Yesno
(
edit
)
This page is a member of 2 hidden categories:
Category:Pages using DynamicPageList4 parser function
Category:Pages using DynamicPageList4