13,208
edits
(→Differentiating good and bad code snippets: Examples of bad code can be highlighted using the css attribute style="background: #ffdddd;") |
(→Links: -Interwiki links - Probably a bad practice; +Link templates - Should be encouraged) |
||
Line 372: | Line 372: | ||
|} | |} | ||
=== | === Links to external sites === | ||
'' | ''External links'', links to other web sites, are marked up with single square brackets ('''<nowiki>[ ]</nowiki>''') on each side. | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
! Description | ! Description | ||
Line 379: | Line 379: | ||
! width="30%" | What you get | ! width="30%" | What you get | ||
|- | |- | ||
| | | External link | ||
| | | | ||
<nowiki> | <nowiki>http://www.mediawiki.org/wiki/Help:Links</nowiki> | ||
| | | http://www.mediawiki.org/wiki/Help:Links | ||
|- | |- | ||
| | | External link without label | ||
| | | | ||
<nowiki>[ | <nowiki>[http://www.mediawiki.org/wiki/Help:Links]</nowiki> | ||
| [ | | [http://www.mediawiki.org/wiki/Help:Links] | ||
|- | |- | ||
| | | External link with label. A blank space ( ) separates the URL from the label. | ||
| | | | ||
< | <pre style="white-space: pre-wrap;">[http://www.mediawiki.org/wiki/Help:Links MediaWiki link help]</pre> | ||
| [ | | [http://www.mediawiki.org/wiki/Help:Links MediaWiki link help] | ||
|} | |} | ||
=== | === Link templates === | ||
'' | ''Link templates'' can and should be used when external web sites are often linked to and/or when the URLs are complicated. This could for example be code repositories, the issue tracker etc. Using them will help reducing typing, reducing errors and most of all lessen the amount of maintenance edits needed if for example a repository changes hosting. | ||
The link templates can be found in [[:Category:Link templates]]. Many of them have documentation on the template pages. Here follows some commonly used templates. | |||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
! Description | ! Description | ||
Line 402: | Line 405: | ||
! width="30%" | What you get | ! width="30%" | What you get | ||
|- | |- | ||
| | | Linking to Wikipedia with {{tl|wikipedia}} | ||
| | | | ||
<nowiki> | <nowiki>{{Wikipedia|FlightGear}}</nowiki> | ||
| | | {{Wikipedia|FlightGear}} | ||
|- | |- | ||
| | | Linking to a issue tracker ticket with {{tl|ticket}} | ||
| | | | ||
<nowiki> | <nowiki>{{ticket|202}}</nowiki> | ||
| | | {{ticket|202}} | ||
|- | |- | ||
| | | Linking to a repository with {{tl|repo link}} | ||
| | |||
<nowiki>{{repo link | |||
| site = sf | |||
| rev = 280 | |||
| branch = branches/release-3.4.0 | |||
| text = FG 3.4 add-on aircraft | |||
}}</nowiki> | |||
| | | | ||
{{repo link | |||
| | | site = sf | ||
| rev = 280 | |||
| branch = branches/release-3.4.0 | |||
| text = FG 3.4 add-on aircraft | |||
}} | |||
|} | |} | ||
For more information on templates, see [[Help:Templates]]. | |||
=== Permalinks and links to diffs === | === Permalinks and links to diffs === |