Wikipedia:Canonicalization

From Wikipedia, the free encyclopedia

Note: Canonicalization is not the same as Canonization.

Wiki canonicalization is the algorithm by which the text of links (in a pair of [single] or [[double]] square brackets) is converted to a URI.

Contents

  • A single pair of square brackets is for an in-line link to another site or external URL on any website. For example, [http://www.wiktionary.org/] produces this: [1], while [http://www.wiktionary.org/ Wiktionary] produces this: Wiktionary.
  • A double pair of square brackets creates an intra-wiki link (Internal link, see also Category:Internal link templates), which is usually a link to a Wikipedia article, but may link to another internal name space.

    The special syntax [[wiktionary:verb]] allows you to link 'Interwiki' to an article on another Wiki (in this case, Wiktionary's entry for verb); see InterWiki.

[edit] Portable convenience templates

A family of templates has been developed that "hide" unpleasant interwiki links; for example, using an interwiki link in code like [[Wikt:noun]], (contrast with {{WD|noun}}), displays "Wikt:noun, (contrast with noun)" by utilizing an automatically pipetricked version "{{WD}}" or "{{Wd}}", which displays as "noun". The template family is available to reach all ten sister projects using the same syntax on and from all ten sister projects, and does not stumble when on a project server that does not allow its own prefix (which is the rule, and not the exception — some such projects sites now are: [[Wikimedia Commons|The Commons== 'W2c'}}, Wikibooks== 'Wb'/'WB', Wiktionary== 'Wd'/'WD' (Contrast with 'Wikt:'), etcetera, for indeed all but the Wikipedia== W2 or w2 (contrast with W: or w: displays)'s and Meta== Mw, or Wm (contrast with M:, m: displays)). The pipe trick can also be used with ordinary interwiki links, as an example [[wikt:verb|]] is transformed to [[wikt:verb|verb]] which is rendered as verb.

[edit] International Interwikis

Another type of Interwiki connection (indeed, the one most often termed an Interwiki in daily usage), is the interlanguage link. These are used to create the links at the top and bottom of articles that link to the same article in another language, and generally can be found in a group on the bottom of Wikipedia articles, templates or categories, where category tagging also occurs. (This interwiki linkage is usually formalized and better presented in one of various templates; see Category:Interwiki link templates.)

General link building 
Regardless of whether templatized, or using bracket sets singly or in pairs:
    1. Spaces are converted to underscores (for example, the page "Star Trek" is actually located at "Star_Trek"). Multiple consecutive underscores and spaces are contracted to just one underscore.
    2. Leading or trailing spaces and underscores are removed.
    3. Character references are replaced with their raw character (for example if you write "département" it will link to département).
    4. For Interwiki or Interlanguage Links, processing stops there. For other links:
      1. The first character is capitalised. (Exception: Wiktionary uses lowercase first letter names.)
      2. If there is a namespace prefix (Talk:, Wikipedia:, User:, etc.), the first character of the article name (which comes after the colon) is also capitalised.

[edit] Examples

  • [[_death _in_ Vegas_]] creates a link to the page Death_in_Vegas, and appears as "_death _in_ Vegas_".
  • [[wikipedia: quick guide]] creates a link to the page Wikipedia:Quick_guide, and appears as "wikipedia: quick guide".

[edit] See also


These are the English language sister projects:

Wikipedia is hosted by the Wikimedia Foundation, a non-profit organization that also hosts a range of other projects:

Commons
Free media repository
Wikinews
Free-content news
Wiktionary
Dictionary and thesaurus
Wikiquote
Collection of quotations
Wikibooks
Free textbooks and manuals
Wikisource
Free-content library
Wikispecies
Directory of species
Wikiversity
Free learning materials and activities
Meta-Wiki
Wikimedia project coordination

Languages