Help:Wikilink

From LabVIEW Wiki
Jump to: navigation, search

A wikilink is an internal link to another page or page-section within the same wiki. MediaWiki automatically checks if the target of a wikilink exists ("existence detection"). If the page doesn't exist, the link leads instead to the editing screen, and it is assigned the class "new". Such wikilinks are nicknamed "red links" because they are colored red in the default stylesheet on a default installation of MediaWiki. "Red links" are useful in determining the current status of the page (created or not created), create links to future pages, and facilitate and encourage creation of new pages.

Syntax

MediaWiki defines a wikilink as a closed set of inward facing square bracket pairs '[[ ]]'. The link target is the sequence of characters immediately following the first bracket pair until pipe '|' or the opposing bracket pair ']]' is encountered (read from left to right). The link target can be another page on the wiki, a section on the same page as the link, or a section on another page on the wiki.

  • Inter-page links: Links of the form [[page_name]] link to the page that exactly matches that "page_name".
  • Intra-page links: Links of the form [[#link_name]] link to the first section on that same page, that has a heading (or anchor -- see below) which exactly matches that "link_name".
  • Inter-page "intra" links: Links of the form [[page_name#link_name]] link to the matching section of the matching page.

The wikilinks syntax also includes various formatting-options to control how a link and its visible text appear.

Basic Wikilink Syntax
Code Result Target Description
 [[a]]   a    a     The simplest wikilink  
 [[a b]]   a b    a b     Multiple words  
 [[a b|c d]]   c d    a b     Link targets 'a b' but displays 'c d' *  
 [[a b]]c   a bc    a b     The link label is the link target, with its last word extended to a longer word  
 <nowiki>[[a]]</nowiki>   [[a]]    Ø     Text is displayed as typed without the properties of a link  
 entered: [[a (b)|]],
 converted to: [[a (b)|a]] 
 a    a (b)     A pipe '|' immediately before the closing bracket pair ']]' creates a piped link which hides the part in parentheses when it is displayed *,***  
 entered: [[a, b|]],
 converted to: [[a, b|a]] 
 a    a, b     A pipe '|' immediately before the closing bracket pair ']]' creates a piped link which hides the comma and what follows when it is displayed *,***  
 entered: [[w:a|]],
 converted to: [[w:a|a]] 
 a    w:a     A pipe '|' immediately before the closing bracket pair ']]' creates a piped link which hides the first prefix of the link when it is displayed *,**,***  
 entered: [[w:a (b)|]],
 converted to: [[w:a (b)|a]] 
 a    w:a (b)     A pipe '|' immediately before the closing bracket pair ']]' creates a piped link which hides the first prefix of the link and the part in parentheses when it is displayed *,***  


Wikilink Tricks & Demos
Code Result Target Description
 [[a|b|c]]   b|c    a     The wiki markup treats the second pipe '|' as regular text *  
 [[a|b]]c   bc    a     'c' is appended to the end of the link text, targets 'a' -- (Good for adding a plural-'s') *  
 a[[b]]   ab    b     'a' immediately precedes the link text but is not included  
 [[a]]<nowiki>b</nowiki>   a   a     'b' immediately follows the link text but is not included  
 [[a]]''b''   ab    a     Using double apostrophes '' around 'b' to make it italicized excludes it from the link text  
 [[a]]'''b'''   ab    a     Using triple apostrophes ''' around 'b' to make it bold excludes it from the link text  
 [[a|b]]c<nowiki>d</nowiki>   bc   a     Translates like [[a|bc]]<nowiki>d</nowiki> *  
 [[a]][[b]]   ab    a , b     Two links next to each other, looks like ab when not hovered over with a cursor  
  • * Links with parameters (the link name) are said to be "piped" because of the pipe symbol used. See help:piped links
  • ** Regardless of whether the prefix is an interwiki link prefix, a namespace prefix, or just some text with a colon.
  • *** Does not work with #-wikilinks (intra-page links): renders any [[#xxxx|]] as pure text.

Note that the image, category, and interlanguage syntax are the same as the wikilink syntax. Attempting to link normally will place the image on the page, add the page to the category and create an interlanguage link at the edge of the page. This can be prevented by prefixing a colon, which escapes the specific syntax. For example, [[:Category:Help]], [[:fr:Help:Link]], and [[:Image:Mediawiki.png]].