Help:Wiki markup: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
238 bytes added ,  18 April 2010
→‎The "pipe trick": collapsing previous long-winded explanation into a simple table
(spinning magic words out into its own page)
(→‎The "pipe trick": collapsing previous long-winded explanation into a simple table)
Line 119: Line 119:
===The "pipe trick"===
===The "pipe trick"===
One of the most helpful shortcuts one can learn in linking to articles is the so-called "pipe trick".  By placing a pipe (|) after certain strings of text, one can eliminate the need to type huge amounts of replacement text.  For example, if the name of an episode of ''[[Doctor Who]]'' is shared with a person, place or thing in the [[Doctor Who universe|DWU]], then it will be "disambiguated" with the parenthetical "(TV story)".  [[Castrovalva]] refers to the city, whereas [[Castrovalva (TV story)]] links to the page about the episode.  Generally, when writing a sentence about the TV story, one doesn't want "(TV story)" to appear in the body of text.  To get rid of it, one must enter some replacement text separated by the full article name by a pipe (|}.  The long way of doing that is:
One of the most helpful shortcuts one can learn in linking to articles is the so-called "pipe trick".  By placing a pipe (|) after certain strings of text, one can eliminate the need to type huge amounts of replacement text.  For example, if the name of an episode of ''[[Doctor Who]]'' is shared with a person, place or thing in the [[Doctor Who universe|DWU]], then it will be "disambiguated" with the parenthetical "(TV story)".  [[Castrovalva]] refers to the city, whereas [[Castrovalva (TV story)]] links to the page about the episode.  Generally, when writing a sentence about the TV story, one doesn't want "(TV story)" to appear in the body of text.  To get rid of it, one must enter some replacement text separated by the full article name by a pipe (|}.  The long way of doing that is:
<pre>
{| class="grey" style="margin: auto;"
[[Castrovalva (TV story)|Castrovalva]]
|-align="center"
</pre>
! width="33%"|Code
This is cumbersome, however, and there's a fair chance one might make a typing error somewhere along the way.  Thus the easier way to proceed is:
! width="33%"|Notes
<pre>
! width="33%"|Effect
[[Castrovalva (TV story)|]]
|-align="center"
</pre>
| <nowiki>[[Castrovalva (TV story)|Castrovalva]]</nowiki>|| Gets rid of '''(TV story)''' the long way||[[Castrovalva (TV story)|Castrovalva]]
The pipe trick can also be used to get rid of namespace that precedes an article name.  If you're on a talk page and you wish to refer to another user's name, you might type:
|-align="center" style="background:#f0f0f0;"
<pre>
| <nowiki>[[Castrovalva (TV story)|]]</nowiki>||The short-cut for the above||[[Castrovalva (TV story)|Castrovalva]]
[[User:ILoveDaleksWhenTheyCry|ILoveDaleksWhenTheyCry]]
|-align="center"
</pre>
| <nowiki>[[User:Tangerineduel|Tangerineduel]]</nowiki>||The long way to get rid of '''User:'''|| [[User:Tangerineduel|Tangerineduel]]
but that's a lot of work. Instead, just type:
|-align="center" style="background:#f0f0f0;"
<pre>
| <nowiki>[[User:Tangerineduel|]]</nowiki>||The short-cut for the above|| [[User:Tangerineduel|Tangerineduel]]
[[User:ILoveDaleksWhenTheyCry|]]
|-align="center"
</pre>
| <nowiki>''[[wikipedia:Life on Mars (TV story)|Life on Mars]]''</nowiki>||The long way to link to a Wikipedia article|| ''[[wikipedia:Life on Mars (TV series)|Life on Mars]]''
|-align="center" style="background:#f0f0f0;"
| <nowiki>''[[wikipedia:Life on Mars (TV series)''|]]</nowiki>||Pipe trick simultaneously truncates the back and front of the string||''[[wikipedia:Life on Mars (TV series)|Life on Mars]]''
|-align="center"
| <nowiki>[[w:c:bionic:Jaime Sommers (2007)|Jaime Sommers]]</nowiki> || Links to an article on another wiki (see Interwiki section)|| [[w:c:bionic:Jaime Sommers (2007)|Jaime Sommers]]
|-align="center" style="background:#f0f0f0;"
| <nowiki>[[w:c:bionic:Jaime Sommers (2007)|]]</nowiki>|| Pipe trick fails|| [[w:c:bionic:Jaime Sommers (2007)|c:bionic:Jaime Sommers]]
|-
|}


Similarly, you might want to refer to an article outside mainspace.  For instance, maybe you're arguing a stylistic point on a talk page, and you want to refer to [[Tardis:Manual of style]].  By typing:
<pre>
[[Tardis:Manual of style|]]
</pre>
you end up with just [[Tardis:Manual of style|Manual of style]].
And then there are cases when you have a link that has both a namespace and a disambiguating parenthetical.  The pipe trick can take care of this, too.  This frequently happens when linking to a wikipedia article.  You could type:
<pre>
[[wikipedia:Life on Mars (TV series)|Life on Mars]]
</pre>
but why do that when
<pre>
[[wikipedia:Life on Mars (TV series)|]]
</pre>
also gives you [[wikipedia:Life on Mars (TV series)|Life on Mars]]. 
===The "slash trick"===
===The "slash trick"===
There are some pages here which have a number of subpages.  A subpage is a page that branches off of the page one is currently viewing.  If this page had a subpage about slash tricks, it would be in the format of [[Help:Wiki markup/Slash trick]].  This syntax, however, is how one would link to the subpage from any other page on the wiki.  '''On this page only''' the same link could be generated by typing  
There are some pages here which have a number of subpages.  A subpage is a page that branches off of the page one is currently viewing.  If this page had a subpage about slash tricks, it would be in the format of [[Help:Wiki markup/Slash trick]].  This syntax, however, is how one would link to the subpage from any other page on the wiki.  '''On this page only''' the same link could be generated by typing  
85,404

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.