Jump to content

User:HTGS/helpful stuff

From Wikipedia, the free encyclopedia
  • <code>...</code> does not replace <nowiki>...</nowiki>. You need to use both, with <nowiki> inside.
  • Talk page quotes use {{tq}} and examples use {{xtn}} (neutral), {{!xt}} (bad), {{xtd}} (deprecated) and {{xtg}} (grey).
  • Wikipedia:Reliable sources/Perennial sources
  • [1]
  • {{ucfirst:{{subst:gender|Example|their}}}} per {{gender}} etc.

To create people subcat:

[[{{subst:#invoke:String|replace|source= {{subst:FULLPAGENAME}} |pattern= people}}|people]]

[[Category:New Zealand Māori people by waka, iwi, hapū or whānau]]

Auto archiving[edit]

For slow pages:

{{User:MiszaBot/config
| algo                = old(1400d)
| archive             = {{SUBST:#titleparts:{{SUBST:FULLPAGENAME}}}}/Archive %(counter)d
| counter             = 1
| maxarchivesize      = 150K
| archiveheader       = {{Automatic archive navigator}}
| minthreadstoarchive = 2
| minthreadsleft      = 5
}}
{{Archives}}

Reference guides[edit]

For orders of merit, I usually reference User:Necrothesp/Notability criteria for recipients of honours

Searches[edit]

https://en.wikipedia.org/w/index.php?title=Special:Search&limit=500&offset=0&ns0=1&search=hastemplate%3A%22Infobox+language%22+insource%3A%2F%5C%7C+%2Aethnicity+%2A%3D+%2F&sortby=incoming_links_desc

[2] hastemplate:"Short description" insource:/\{\{[Ss]hort description\| *[^ \}]{5}\}\}/</code>



Regex[edit]

  • To find any simple template (does not address sub-templates). Eg, short description: {{[Ss]hort description[|][^}]*}}
  • To convert a bulleted list of names to sortname templates for a sortable table (per List of New Zealand artists):
    • Find: \* *\[\[([a-z- ]+) ([a-z'-]+)\]\]
    • Replace: {{sortname|$1|$2}}
  • Born but no death
    • Find: \* *\[\[([a-z- ]+) ([a-z'-]+)\]\] \(born ([0-9]+)\)[\s-–]*([a-z ,/]+)
    • Replace: |- {{subst:User:HTGS/newline}}|{{sortname|$1|$2}}||$3|| ||$4||
    • Replace: |- {{subst:User:HTGS/newline}}|{{sortname|$1|$2}}{{subst:User:HTGS/newline}}| $3{{subst:User:HTGS/newline}}| {{subst:User:HTGS/newline}}| $4{{subst:User:HTGS/newline}}|
  • Born + died
    • Find: \* *\[\[([a-z- ]+) ([a-z'-]+)\]\] \(([0-9]+)[\s-–]+([0-9]+)\)[\s-–]*([a-z ,/]+)
    • Replace: |- {{subst:User:HTGS/newline}}|{{sortname|$1|$2}}{{subst:User:HTGS/newline}}| $3{{subst:User:HTGS/newline}}| $4{{subst:User:HTGS/newline}}| $5{{subst:User:HTGS/newline}}|
  • Born w DAB:
    • Find: \* *\[\[([a-z- ]+) ([a-z'-]+) \(([a-z]+)\)\|[ a-z]+\]\] \(born ([0-9]+)\)[\s-–]*([a-z ,/]+)
    • Replace: |- {{subst:User:HTGS/newline}}|{{sortname|$1|$2|dab=$3}}{{subst:User:HTGS/newline}}| $4{{subst:User:HTGS/newline}}| {{subst:User:HTGS/newline}}| $5{{subst:User:HTGS/newline}}|
  • Born+died w DAB
    • Find: \* *\[\[([a-z- ]+) ([a-z'-]+) \(([a-z]+)\)\|[ a-z]+\]\] \(([0-9]+)[\s-–]+([0-9]+)\)[\s-–]*([a-z ,/]+)
    • Replace: |- {{subst:User:HTGS/newline}}|{{sortname|$1|$2|dab=$3}}{{subst:User:HTGS/newline}}| $4{{subst:User:HTGS/newline}}| $5{{subst:User:HTGS/newline}}| $6{{subst:User:HTGS/newline}}|