Module:Sort title/doc

MyWikiBiz, Author Your Legacy — Friday November 15, 2024
< Module:Sort title
Revision as of 06:05, 16 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This is the documentation page for Module:Sort title

Template:High-use Template:Lua

Module:Sort title is used to create sortkeys for pages.

What it does

The module preforms the following checks:

  • If the first word of the title is an article, it moves it to the end of the title. For example: The Avengers will have a sortkey of Avengers, The.
  • If the title is disambiguated and the first word of the disambiguation is an article, it moves it to the end of the disambiguation. For example: Pilot (The Flash) will have a sortkey of Pilot (Flash, The).
  • If the title is disambiguated and the first word of the title and the disambiguation is an article, both of the above changes will occur. For example: The End (A Series of Unfortunate Events) will have a sortkey of End, The (Series of Unfortunate Events, A).
  • If the title is a number which is separated by a commas, it removes the commas. For example: 4,722 Hours will have a sortkey of 4722 Hours.

Usage

From template:

From module: <syntaxhighlight lang="lua">local sortkeyModule = require('Module:Sort title') local sortkey = sortkeyModule._getSortKey() </source >

Function list

Function Explanation
getSortKey Returns a sortkey
getDefaultSort Returns a DEFAULTSORT string