Template:Fd/doc
This is a documentation subpage for Template:Fd. It contains usage information, categories, and other content that is not part of the original template page. |
Format Demo, shows how non-expandable wikitext is rendered.
Usage
edit{{fd|''[[p]]'' '''q''' r |rarr| [[s]]}}
gives:
''[[p]]'' '''q''' r → [[s]]
gives:
p q r →
Codes like "→" 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
editAs 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
edit- 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''
gives:
''p''
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
gives:
a b
If, contrary to the instructions, the code "&" 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 "→" is rendered unchanged:
&arr;
gives:
&arr;
Limitation of wikitexts
edit- For the examples, see also the edit box.
The effect of expansion is not shown, what is shown before "gives" is already expanded:
in
gives:
in
- 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
gives:
ac
Examples from Help:Advanced editing#Organizing your writing — sections, paragraphs, lists and lines
editA single newline has no effect on the layout. But an empty line starts a new paragraph.
gives:
A single newline has no effect on the layout.
But an empty line starts a new paragraph.
You can break lines<br> without starting a new paragraph.
gives:
You can break lines
without starting a new paragraph.
* 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.
gives:
- Unordered Lists are easy to do:
- start every line with a star,
- more stars means deeper levels.
- start every line with a star,
- A newline
- in a list
marks the end of the list.
- Of course,
- you can
- start again.
# 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.
gives:
- 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.
* You can even do mixed lists *# and nest them *#* or break lines<br>in lists
gives:
- You can even do mixed lists
- and nest them
- or break lines
in lists
- or break lines
- and nest them
; word : definition of the word ; longer phrase : phrase defined
gives:
- word
- definition of the word
- longer phrase
- phrase defined
: A colon indents a line or paragraph. A manual newline starts a new paragraph.
gives:
- A colon indents a line or paragraph.
A manual newline starts a new paragraph.
<blockquote> The '''blockquote''' command will indent both margins when needed instead of the left margin only as the colon does. </blockquote>
gives:
The blockquote command will indent both margins when needed instead of the left margin only as the colon does.
<center>Centered text.</center>
gives:
A horizontal dividing line: this is above it... ---- ...and this is below it.
gives:
A horizontal dividing line: this is above it...
...and this is below it.
Examples from Help:Advanced editing#Links, URLs
editSue is reading the [[official position]] (or [[official position]]s).
gives:
Sue is reading the official position (or official positions).
''[[Wikipedia]]''
gives:
* See [[m:Help:Interwiki linking]]. * [[:fr:Wikipédia:Aide]].
gives:
* [[List of cities by country#Morocco]] * [[List of cities by country#Norway]]
gives:
* [[Help:Link|About Links]]
gives:
* Parentheses: [[kingdom (biology)|kingdom]]. * Colon: [[m:Requests for adminship|Requests for adminship]].
gives:
- Parentheses: kingdom.
- Colon: Requests for adminship.
A red link ([[like this one]]) points to a page that doesn't exist yet.
gives:
A red link (like this one) points to a page that doesn't exist yet.
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)
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)
ISBN 0131103628 RFC 123
gives:
[[media:Example.ogg|Sound]]
gives:
[[:Category:English documentation]]
gives:
Category:English documentation
[[July 20]] [[1969]] [[20 July]] [[1969]] and [[1969]]-[[07-20]]
gives:
July 20 1969 20 July 1969 and 1969-07-20
[[Special:Whatlinkshere/Help:Editing]]
gives:
Special:Whatlinkshere/Help:Editing
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
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
[http://www.nupedia.com Nupedia], [http://www.nupedia.com]
gives:
[mailto:email@example.com Email Example], [mailto:email@example.com]
gives:
http://www.nupedia.com
gives:
''Emphasize'', '''strongly''', '''''very strongly'''''. ''[[Wikipedia]]''
gives:
Emphasize, strongly, very strongly.
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>
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
A typewriter font, sometimes used for <kbd>technical terms</kbd> and <code>computer code</code>.
gives:
A typewriter font, sometimes used for
technical terms and computer code
.
You can use <small>small text</small> for captions.
gives:
You can use small text for captions.
You can <s>strike out deleted material</s> 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.
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.
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²]]
gives:
Subscript: x2 Superscript: x2 or x²
ε0 = 8.85 × 10−12 C² / J m.
<kbd>''italics''</kbd> <kbd>[[link]]<br/><br/>New paragraph.</kbd>
gives:
italics
link
New paragraph.
''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
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
<kbd>''italics''</kbd> <kbd>[[link]]<br/><br/>New paragraph.</kbd>
gives:
italics
link
New paragraph.
Extra example:
{{#tag:poem|abc [[abc]] abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc
gives
def def def {{tc}} def def def def def def def def def def def def def def def def def def def def def def
ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi}}
abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc
def def def in def def def def def def def def def def def def def def def def def def def def def def
ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi ghi
Examples from Help:Advanced editing#Special characters
edit∫ ∑ ∏ √ −
gives:
∫ ∑ ∏ √ −
Table example
edit{{fd|{{{!}} {{!}} A {{!}}{{!}} B {{!}}- {{!}} C {{!}}{{!}} D {{!}}} }}
gives:
{| | A || B |- | C || D |}
gives:
A | B |
C | D |
See also
edit