Template:Fd/doc

From TrainzOnline
< Template:Fd
Revision as of 02:59, 6 July 2013 by Fabartus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


 
It contains usage information, categories and other informational content that is best arranged so that it is not part of the original template page, such as in many cases, examples of how to use the template in question.
  • Documentation subpages were developed to reduce server demands, or to protect the code version of widely used templates.
     

Format Demo, shows how non-expandable wikitext is rendered.

Contents

Usage

{{fd|''[[p]]''    '''q'''
r |rarr| 

[[s]]}}

gives:


''[[p]]''    '''q'''
r {{#if:rarr|&rarr;}}

[[s]]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

p q r {{#if:rarr|→}}

s{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



Codes like "&rarr;" are represented in the even-positioned parameters 2-10. Each can contain a single code like "rarr" (without the "&" and the ";"). The odd-positioned parameters 1-11 are for the wikitext before, after, and in between.

Limitations and special considerations

As usual, if the parameter contains "=", even in a URL or in the definition of an attribute of an XML-element, put "1=" in front. A "|" in the wikitext is represented by {{!}}.

The template shows before "gives" the rendering of the expanded parameter in <pre> tags, and after "gives" the rendering of the parameter itself, with the following consequences.

Wrong results

For the examples, see also the edit box.

The template does not show <nowiki> tags before "gives", but shows the rendering of the wikitext with them:

''p''{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

''p''{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


The template does not show <pre> tags before "gives", but shows the rendering of the wikitext with them, i.e., it just removes them and shows the wikitext without further change:

a
b
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

a
b
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


If, contrary to the instructions, the code "&amp;" is not represented in the special parameters, the template will display it as "&" both before and after "gives"; if this is followed for example by "arr;" it will wrongly show that the wikitext "&rarr;" is rendered unchanged:

&arr;{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

&arr;{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


Limitation of wikitexts

For the examples, see also the edit box.

The effect of expansion is not shown, what is shown before "gives" is already expanded:

[[:Template:Tc]]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Template:Tc{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


For demonstrating expansion, see Help:Expansion demo templates.

The <pre> tag does not prevent comment tags to be interpreted as such, so the template does not show the tags and the text in between, even before "gives":

ac{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

ac{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


Examples from Help:Advanced editing#Organizing your writing — sections, paragraphs, lists and lines

A single
newline
has no
effect on the
layout.

But an empty line
starts a new paragraph.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

A single newline has no effect on the layout.

But an empty line starts a new paragraph.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



You can break lines<br>
without starting a new paragraph.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

You can break lines
without starting a new paragraph.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



* Unordered Lists are easy to do:
** start every line with a star,
*** more stars means deeper levels.
* A newline
* in a list  
marks the end of the list.
* Of course,
* you can
* start again.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

  • Unordered Lists are easy to do:
    • start every line with a star,
      • more stars means deeper levels.
  • A newline
  • in a list

marks the end of the list.

  • Of course,
  • you can
  • start again.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



# Numbered lists are also good
## very organized
## easy to follow
# A newline
# in a list  
marks the end of the list.
# New numbering starts
# with 1.
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

  1. Numbered lists are also good
    1. very organized
    2. easy to follow
  2. A newline
  3. in a list

marks the end of the list.

  1. New numbering starts
  2. with 1.

{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



* You can even do mixed lists
*# and nest them
*#* or break lines<br>in lists
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

  • You can even do mixed lists
    1. and nest them
      • or break lines
        in lists

{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



; word : definition of the word
; longer phrase 
: phrase defined{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

word 
definition of the word
longer phrase
phrase defined{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



: A colon indents a line or paragraph.
A manual newline starts a new paragraph.
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

A colon indents a line or paragraph.

A manual newline starts a new paragraph. {{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



<blockquote>
The '''blockquote''' command will indent 
both margins when needed instead of the 
left margin only as the colon does.
</blockquote>{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

The blockquote command will indent both margins when needed instead of the left margin only as the colon does.
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



<center>Centered text.</center>
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Centered text.

{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



A horizontal dividing line: 
this is above it...
----
...and this is below it.
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

A horizontal dividing line: this is above it...


...and this is below it. {{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


Examples from Help:Advanced editing#Links, URLs

Sue is reading the 
[[official position]]
(or [[official position]]s).{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Sue is reading the official position (or official positions).{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



''[[Wikipedia]]''{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Wikipedia{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



* See [[m:Help:Interwiki linking]].
* [[:fr:Wikipédia:Aide]].
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



* [[List of cities by country#Morocco]]
* [[List of cities by country#Norway]]
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



* [[Help:Link|About Links]]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

  • About Links{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



* Parentheses: [[kingdom (biology)|kingdom]].
* Colon: [[m:Requests for adminship|Requests for adminship]].{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:



A red link ([[like this one]]) points to a page
that doesn't exist yet.
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

A red link (like this one) points to a page that doesn't exist yet. {{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



Please "sign" comments on talk pages:
: Your user name: [[User:Patrick|Patrick]] ([[User talk:Patrick|talk]])
: Your user name plus timestamp: [[User:Patrick|Patrick]] ([[User talk:Patrick|talk]]) 10:08, 21 June 2010 (UTC)
: Five tildes give a timestamp: 10:08, 21 June 2010 (UTC){{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Please "sign" comments on talk pages:

Your user name: Patrick (talk)
Your user name plus timestamp: Patrick (talk) 10:08, 21 June 2010 (UTC)
Five tildes give a timestamp: 10:08, 21 June 2010 (UTC){{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



ISBN 0131103628
RFC 123{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

ISBN 0131103628 RFC 123{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



[[media:Example.ogg|Sound]]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Sound{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



[[:Category:English documentation]]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Category:English documentation{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



[[July 20]] [[1969]]
[[20 July]] [[1969]]
and [[1969]]-[[07-20]]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

July 20 1969 20 July 1969 and 1969-07-20{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



[[Special:Whatlinkshere/Help:Editing]]
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Special:Whatlinkshere/Help:Editing {{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



http://meta.wikimedia.org/w/index.php?title=Fotonotes&oldid=482030
http://meta.wikimedia.org/w/index.php?title=Fotonotes&diff=493810&oldid=482030
http://meta.wikimedia.org/w/index.php?title=Help:Wikitext_examples&dir=prev&offset=20060813153343&limit=100&action=history{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

http://meta.wikimedia.org/w/index.php?title=Fotonotes&oldid=482030 http://meta.wikimedia.org/w/index.php?title=Fotonotes&diff=493810&oldid=482030 http://meta.wikimedia.org/w/index.php?title=Help:Wikitext_examples&dir=prev&offset=20060813153343&limit=100&action=history{{#if:%7C&;}}{{#if:%7C&;}}{{#if:%7C&;}}{{#if:%7C&;}}{{#if:%7C&;}}



[http://www.nupedia.com Nupedia],
[http://www.nupedia.com]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Nupedia, [1]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



[mailto:email@example.com Email Example],
[mailto:email@example.com]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Email Example, [2]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



http://www.nupedia.com{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

http://www.nupedia.com{{#if:%7C&;}}{{#if:%7C&;}}{{#if:%7C&;}}{{#if:%7C&;}}{{#if:%7C&;}}


Examples from Help:Advanced editing#Text formatting—controlling how it looks

''Emphasize'', '''strongly''',
'''''very strongly'''''.

''[[Wikipedia]]''{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Emphasize, strongly, very strongly.

Wikipedia{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



You can also write <i>italic</i> and <b>bold</b>.
This is useful in mathematical formulas where you 
need specific font styles rather than emphasis.
: <b>F</b> = <i>m</i><b>a</b>{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

You can also write italic and bold. This is useful in mathematical formulas where you need specific font styles rather than emphasis.

F = ma{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



You can also write 
<span style="font-variant:small-caps">
in small caps</span>.
If the wiki has the templates, this can 
[[:Template:Bsm]]be much simpler to write[[:Template:Esm]].{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

You can also write in small caps. If the wiki has the templates, this can Template:Bsmbe much simpler to writeTemplate:Esm.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



A typewriter font, sometimes used for 
<tt>technical terms</tt> and <code>computer code</code>.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

A typewriter font, sometimes used for technical terms and computer code.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



You can use <small>small text</small> 
for captions.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

You can use small text for captions.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



You can <strike>strike out deleted material</strike>
and <u>underline new material</u>.

You can also mark <del>deleted material</del> and
<ins>inserted material</ins> using logical markup
rather than visual markup.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

You can strike out deleted material and underline new material.

You can also mark deleted material and inserted material using logical markup rather than visual markup.{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



Subscript: x<sub>2</sub>
Superscript: x<sup>2</sup> or x²

ε<sub>0</sub> =
8.85 × 10<sup>−12</sup>
C² / J m.

1 [[hectare]] = [[1 E4 m²]]{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

Subscript: x2 Superscript: x2 or x²

ε0 = 8.85 × 10−12 C² / J m.

1 hectare = 1 E4 m²{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


Examples from Help:Advanced editing#Disabling wikitext interpretation and/or reformatting

<tt>''italics''</tt>
<tt>[[link]]

New paragraph.</tt>
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

italics link

New paragraph. {{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



 ''italics''
 [[link]]

 IF a line of plain text starts with a space
  it will be formatted exactly
    as typed
  in a fixed-width font
  in a grey dotted-outline box
  lines won't wrap
 ENDIF
 this is useful for:
  * pasting preformatted text
  * algorithm descriptions
  * program source code
  * ASCII art
  * chemical structures
  * poetry{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

italics
link
IF a line of plain text starts with a space
 it will be formatted exactly
   as typed
 in a fixed-width font
 in a grey dotted-outline box
 lines won't wrap
ENDIF
this is useful for:
 * pasting preformatted text
 * algorithm descriptions
 * program source code
 * ASCII art
 * chemical structures
 * poetry{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



<tt>''italics''</tt>
<tt>[[link]]

New paragraph.</tt>
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

italics link

New paragraph. {{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}


Extra example:

Template:Xpdop4oc5c

Examples from Help:Advanced editing#Special characters

{{#if:int|&int;}} {{#if:sum|&sum;}} {{#if:prod|&prod;}} {{#if:radic|&radic;}} {{#if:minus|&minus;}} 

gives:

{{#if:int|∫}} {{#if:sum|∑}} {{#if:prod|∏}} {{#if:radic|√}} {{#if:minus|−}}


Table example

{{fd|{{{!}} 
{{!}} A {{!}}{{!}} B
{{!}}- 
{{!}} C {{!}}{{!}} D 
{{!}}} }}

gives:


{| 
| A || B
|- 
| C || D 
|} {{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}

gives:

A B
C D
{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}{{#if:|&;}}



See also

This page has it's origination in the Wikimedia Foundation's development website Meta-wiki or has been exported and is now part of the newer Mediawiki software resources website for assisting new wikis with startup organization and has been copied according to the terms of the (CC-BY-SA-3.0), the GFDL standard GNU pulic license or the source file(s) is/are in the public domain.
Personal tools