Help:Formatting

From FlightGear wiki
Jump to: navigation, search


This page is about formatting the text on a wiki page. We will go through the general disposition of articles on this wiki, basic wiki formatting or markup, when and how to add links to other wiki pages and articles as well as a few other things. The more advanced formatting are will only be briefly mentioned on this page though.

Typical article disposition

Consider this a recommendation. Though most of the articles follow this convention some don't.

{{Some messagebox}}
{{Some other messagebox}}

{{Some infobox or navbox}}

[[File:Some image.jpg|thumb|Some caption.]]
[[File:Some other image.jpg|thumb|Some other caption]]

A '''generic article disposition''' would look something like this.

== Heading ==
Some text...

=== Subheading ===
Some text...

== Related content ==
* [[Some page]]

== External links ==
* [Some link] Some description

{{Some navbox}}

[[en:Some language link]]

[[Category:Some category]]
Messageboxes
One or more messageboxes could sometimes begin typical article page. The messageboxes would tell a reader or editor something about the article, like for example that it is outdated due to new developments.
Infobox or navbox
Often an infobox or navbox will follow. An infobox will contain more detailed information about a piece of software, an aircraft, an airport etc. that is the topic of the article and a navbox could help the reader find his way around a series of or similar articles.
Images
Many articles would be helped by additional images. While it is often a good idea to have at least one of them on top of the article, as this will help a reader to figure out if he landed on the right article and what it is about. While they can all be in the beginning of the article text, they can just as well be spread out within the article. Most of the time having just thumbnail images will be preferable.
First section
The first section of an article should be a short summary of the article or an ingress. Preferably the page title in bold should be within the first sentence or the first section.
This short summary of the article would help a reader to quickly figure out if he found the page he was looking for, as well as help a him grasp the main concepts of an article a bit faster.
Article text
The article text that follows is preferably broken up in not too long, but not too short sections separated by headings and subheadings. Often it would help the reader if there are images and tables to help understand the article text. Sometimes it is a good thing to mark more some important words differently.
Links to related content
Links to related content, like other articles forum topics etc. can be put in the end, though in general having the internal wikilinks within the article text is preferable.
Links to external resources
Links to external resources should be put at the very end of the article.
Navbox
Many pages end with a navbox with for example other aircraft by the same manufacturer.
Language links and categories
All articles should end with one or more categories. They are preceded by language links, if there is any translations of that page.

Preview and edit summary

Before saving an edit you will have to preview the page or section. There is also a one-line text field labelled Edit summary, in which you could add a short summary of your edit. This summary will be shown in the revision history in the "View history" tab after you have saved your edit.

You are highly encouraged to always add an edit summary as this will help follow the changes done to a page.

You can mark edits as being a minor edit if they are very small, like spelling corrections or changing things not visible in the page, like adding, changing or removing categories or language links.

Basic text formatting

Wiki formatting is a bit different from formatting text in a word processor. You will not see what the text will look like until you click the preview button. In order to have the text human editable it uses a markup language that is considerably simpler than the HTML that is used in the resulting web page. This markup is often called wiki markup or wikitext and is the same one as the one used on Wikipedia which uses the same software, MediaWiki.

Paragraphs

Description What you type What you get
Paragraphs are separated by newlines.
Nunc consequat, mauris et ornare mattis, tellus justo placerat sem, in luctus tellus enim vitae magna. Sed malesuada, tellus id tincidunt convallis, purus massa iaculis nibh, a egestas lorem libero a orci. Nam sit amet blandit turpis. 
Vestibulum tincidunt tincidunt leo eget ullamcorper. Pellentesque tempor erat ac ipsum pharetra mollis. Maecenas massa risus, placerat et mauris in, porttitor aliquam tortor. Aenean ac nisl sit amet turpis porta sagittis vitae ac urna.
Nunc consequat, mauris et ornare mattis, tellus justo placerat sem, in luctus tellus enim vitae magna. Sed malesuada, tellus id tincidunt convallis, purus massa iaculis nibh, a egestas lorem libero a orci. Nam sit amet blandit turpis.

Vestibulum tincidunt tincidunt leo eget ullamcorper. Pellentesque tempor erat ac ipsum pharetra mollis. Maecenas massa risus, placerat et mauris in, porttitor aliquam tortor. Aenean ac nisl sit amet turpis porta sagittis vitae ac urna.

Though empty lines makes the wiki markup easier to read.
Nunc consequat, mauris et ornare mattis, tellus justo placerat sem, in luctus tellus enim vitae magna. Sed malesuada, tellus id tincidunt convallis, purus massa iaculis nibh, a egestas lorem libero a orci. Nam sit amet blandit turpis. 

Vestibulum tincidunt tincidunt leo eget ullamcorper. Pellentesque tempor erat ac ipsum pharetra mollis. Maecenas massa risus, placerat et mauris in, porttitor aliquam tortor. Aenean ac nisl sit amet turpis porta sagittis vitae ac urna.
Nunc consequat, mauris et ornare mattis, tellus justo placerat sem, in luctus tellus enim vitae magna. Sed malesuada, tellus id tincidunt convallis, purus massa iaculis nibh, a egestas lorem libero a orci. Nam sit amet blandit turpis.

Vestibulum tincidunt tincidunt leo eget ullamcorper. Pellentesque tempor erat ac ipsum pharetra mollis. Maecenas massa risus, placerat et mauris in, porttitor aliquam tortor. Aenean ac nisl sit amet turpis porta sagittis vitae ac urna.

Two empty lines will add more space, though this is used sparsely.
Nunc consequat, mauris et ornare mattis, tellus justo placerat sem, in luctus tellus enim vitae magna. Sed malesuada, tellus id tincidunt convallis, purus massa iaculis nibh, a egestas lorem libero a orci. Nam sit amet blandit turpis. 


Vestibulum tincidunt tincidunt leo eget ullamcorper. Pellentesque tempor erat ac ipsum pharetra mollis. Maecenas massa risus, placerat et mauris in, porttitor aliquam tortor. Aenean ac nisl sit amet turpis porta sagittis vitae ac urna.
Nunc consequat, mauris et ornare mattis, tellus justo placerat sem, in luctus tellus enim vitae magna. Sed malesuada, tellus id tincidunt convallis, purus massa iaculis nibh, a egestas lorem libero a orci. Nam sit amet blandit turpis.


Vestibulum tincidunt tincidunt leo eget ullamcorper. Pellentesque tempor erat ac ipsum pharetra mollis. Maecenas massa risus, placerat et mauris in, porttitor aliquam tortor. Aenean ac nisl sit amet turpis porta sagittis vitae ac urna.

Bold and italics

Bold and italics are marked using two, three or five apostrophes (') on each side of the text section to be emphasized.

Description What you type What you get
Italic text is marked with two apostrophes on each side.
''Italics''
Italics
Bold text is marked with three apostrophes on each side.
'''Bold'''
Bold
Bold and italic text is marked by five apostrophes on each side.
'''''Bold italics'''''
Bold italics
Bold and bold italics can be combined.
'''Bold ''italics'''''
Bold italics

A few useful HTML tags

Yes you can use HTML tags in a wiki page. Usually it is not needed though, as you in the most cases are better helped by wiki markup, but in a few cases they can be very helpful.

One of the properties of the HTML tags is that you can use HTML attributes and with them the style attribute which gives access to the whole cascading style sheet toolbox.

Description What you type What you get
To get subscript text use the <sub> tag.
V<sub>NE</sub>
VNE
To get superscript text use the <sup> tag.
ft<sup>2</sup>
ft2
Stroke through text.
<s>Some text</s>
Some text
Using HTML attributes.
<big style="color: red;">'''Error !!!'''</big>
Error !!!
Comments can be added using HTML comment tags on each side.
<!-- Commented text -->

Apart from the HTML tags there is also some wiki tags, a few of them more useful than the others. These tags can not use the HTML attributes.

Description What you type What you get
A quick way to not wiki format a section of text one can use the <nowiki> tag.
<nowiki>M<sub>NE</sub></nowiki>
M<sub>NE</sub>

Lists and indentation

Unordered or bullet lists and ordered or numbered lists can be done in wiki markup. They can also be mixed when needed. Unfortunately numbered lists can not be started from an arbitrary number. Do note that both list and indentation markup must start right at the left margin.

Description What you type What you get
Unordered lists are done by starting the line with a asterisk (*). The next level starts with two asterisks etc.
* Item
** Item
*** Item
  • Item
    • Item
      • Item
Ordered lists are done by starting the line with a hash (#). The next level starts with two hashes etc.
# Item
# Item
## Item
## Item
### Item
# Item
  1. Item
  2. Item
    1. Item
    2. Item
      1. Item
  3. Item
An empty line will break the numbering.
# Item
# Item

# Item
# Item

  1. Item
  2. Item
  1. Item
  2. Item
When needed ordered and unordered lists can be combined.
# Item
#* Item
#* Item
# Item
#* Item
  1. Item
    • Item
    • Item
  2. Item
    • Item
Sometimes you would want to use definition lists. Terms begin with a semicolon (;) and definitions with a colon (:).
;Term
:Definition

;Term:  Definition
Term
Definition
Term
Definition
Indentation can be added by using one or more colons (:).

Indentation is usually the way comments from different users are separated on discussion pages.

No indentation
:Indentation
::Indentation

No indentation

Indentation
Indentation

Headings and subheadings

Headings and subheadings are an easy way to improve the organization of an article. If you can see two or more distinct subtopics being discussed, you can break up the article in sections by inserting headings.

Headings are added on a new line with two or more equal signs (=) on each side of the heading title. Note that heading markup must start directly at the left margin. If at all possible, please avoid using links in headings. There are several heading levels, of which level one is reserved for the page title.

Having the page broken up in sections will make it easier for the reader to find his way around the page, as well as help him understand the context of the page and how the pieces fits together.

A table of contents will be generated automatically if a page has more than four headings . In some cases you might want one even before that. That can be done by adding the magic word __TOC__. In some rare cases you would want to suppress the table of contents generation. That can be done with another magic word, __NOTOC__, though this is most often undesirable.

Description What you type What you get
Level 2 headings.
== Level 2 ==

Level 2

Level 3 headings.
=== Level 3 ===

Level 3

Level 4 headings.
==== Level 4 ====

Level 4

Links

Links linking together related content on the wiki is very important, even more so than categories. Links can help a reader find more detailed information about a topic as well as help the reader understand a wider context than the topic of the article. Links can also be passageways to areas that the reader has not previously been aware of, but will find interesting and encouraging.

Please check your links when previewing before saving, even more so if you have added external links.

When not to link

Let's start here, since this is the easiest.

  • Links to commercial and unrelated web sites, in essence spam, are frowned upon. Few readers are here looking for cheaper sports shoes...
  • Links in headings should be avoided if at all possible.
  • Links should preferably be avoided in the first section, though sometimes they are needed right there.

When to link

Apart from the obvious places for links, the two sections "Related content" and "External links", links should preferably be used within a text only the first time their topic is mentioned or when a concept is introduced.

However, in longer articles it can be advantageous to have the links occur again further down, even more so if a long portion of the article was about another subtopic or if you can assume that a reader would only look into a longer section of the article.

Links to other wiki pages

Wikilinks or internal links, links to other wiki pages, are marked up with two square brackets ([[ ]]) on each side.

Description What you type What you get
Links to other wiki page, wikilink
[[Help:Tables]] is a good start.
Help:Tables is a good start.
The first character of the link is case insensitive.
Here is a [[list of abbreviations]].
Here is a list of abbreviations.
Pipe links are wiki links with a vertical stroke or pipe (|) separating the page to be linked to from an alternative link text
A [[Help:Templates|template]] can be very practical.
A template can be very practical.
You can link to a section of an article by adding a hash (#) and the section heading after the name or the article.
Tables can be [[Help:Tables#Sortable tables|sortable]].
Tables can be sortable.

Links to categories, files and other language versions

A preceding colon (:) must be used if you want to add links to categories, files or articles in another language. Otherwise you would add the category, image or language link to a page. These links can be piped links just as normal links by adding a vertical stroke or pipe (|).

Description What you type What you get
Linking to a category.
See [[:Category:Help]]
See Category:Help
Links to a file description page.
A filing cabinet can be found [[:File:Replacement filing cabinet.png|here]].
A filing cabinet can be found here.
Another language version can also be linked to preceding colon (:).
See also the [[:de:Help:Übersetzen|German page]].
See also the German page.

Links to external sites

External links, links to other web sites, are marked up with single square brackets ([ ]) on each side.

Description What you type What you get
External link
http://www.mediawiki.org/wiki/Help:Links
http://www.mediawiki.org/wiki/Help:Links
External link without label
[http://www.mediawiki.org/wiki/Help:Links]
[1]
External link with label. A blank space ( ) separates the URL from the label.
[http://www.mediawiki.org/wiki/Help:Links MediaWiki link help]
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.

Description What you type What you get
Linking to Wikipedia with {{wikipedia}}
{{Wikipedia|FlightGear}}
FlightGear This is a link to a Wikipedia article
Linking to a issue tracker ticket with {{ticket}}
{{ticket|202}}
ticket 202
Linking to a repository with {{fgdata file}}
{{fgdata file|Nasal/globals.nas|t=globals.nas}}
globals.nas


For more information on templates, see Help:Templates.

Permalinks and links to diffs

Permalinks or permanent links are links to a revision of a page, in essence to a page as it was at a certain point in time. Diffs are comparisons between two revisions of a page. While they in a sense are internal to the wiki they have to be linked to as if the where external.

In comments on discussion pages, the use of permalinks instead of usual links is highly encouraged, since the content may have changed a lot before the next reader reads the comment. Sometimes it is also useful to link to a diff.

Permalinks can be found either under the "Toolbox" drop-down list on the left menu or in the revision history in the "View history" tab. To get the link to a diff you will have to show the diff and copy the URL in your browsers address field.

Templates

1rightarrow.png See Help:Templates for the main article about this subject.

Templates is a very handy feature of the MediaWiki wiki markup. Using templates you can easily add complex things like the messageboxes, infoboxes and navboxes, but also a lot, lot more. A few useful templates are shown below:

Description What you type What you get
{{dead link}} is used when marking dead links.
{{dead link|{{CURRENTYEAR}}-{{CURRENTMONTH}}}}
[dead link]
{{clarify}} can be used to mark ambiguities and diffuse statements.
{{clarify|What's a magneto test|{{CURRENTMONTHABBREV}} {{CURRENTYEAR}}}}
[clarify]
{{tl}} can be used to make nice looking links to templates
{{tl|informative template}}
{{informative template}}

Tables

1rightarrow.png See Help:Tables for the main article about this subject.

Tables are very useful for, well, tabulating data, but also for layout purposes.

Description What you type What you get
A small and simple table sample.
{| class="wikitable"
! Cell one !! Cell two
|-
| Cell three || Cell four
|}
Cell one Cell two
Cell three Cell four

Preformatted text

1rightarrow.png See Help:Preformatted text for the main article about this subject.

There is many different ways to do monospaced pre-formatted text.

Pre-formatted running text

Description What you type What you get
Using <code> HTML tags.
Here is a <code>'''Class()'''</code>.
Here is a Class().
Using <tt> HTML tags.
Here is a <tt>''variable''</tt>.
Here is a variable.

Pre-formatted blocks

Apart from using <tt> and <code> on entire blocks of text one one can use the below methods.

Description What you type What you get
The simplest way is with a leading blank space on each line.
 You '''''can''''' use '''wiki markup'''
 using this method.
You can use wiki markup
using this method.
Using <nowiki> tags with a leading blank space.
 <nowiki>Here is some text.
And some more.</nowiki>
Here is some text.
And some more.

Syntax highlighting

<syntaxhighlight lang="" line start="" highlight="" inline></syntaxhighlight>

All attributes but lang are optional. start have to be used together with line. Values must be put inside quotation marks (").

lang
The language to be highlighted, for example bash, cpp or xml.
line
Use line numbering.
start
Used together with line if you want the line numbering to start somewhere else than one. For example will 42 start the line numbering from 42 instead of 1.
highlight
Used for highlighting a line. Do note that lines are counted from the first line in a snippet disregarding start. For example will 3,5-7 highlight line 3 and 5-7 in a snippet.
inline
Used when syntax highlighting is needed in running text.
Description What you type What you get
XML highlighting, arbitrarily starting from line 46, and highlighting the 1st, 3rd and 4th line in the snippet.
<syntaxhighlight lang="xml" line start="46" highlight="1,3-4">
 <animation>
  <object-name>Object</object-name>
  <enable-hot type="bool">false</enable-hot>
 </animation>
</syntaxhighlight>

46  <animation>
47   <object-name>Object</object-name>
48   <enable-hot type="bool">false</enable-hot>
49  </animation>
Syntax highlighting in running text
A typical C++ comment <syntaxhighlight lang="cpp" inline>// looks like this</syntaxhighlight>.
A typical C++ comment // looks like this.

Language links

1rightarrow.png See Help:Translate for the main article about this subject.

Language links is links to translations of a page. Those links will appear in a drop-down list with translations of a page. Pages in other languages can also be linked to for use in an article text.

Description What you type What you get
Adding a language link to a page.
[[de:Help:Übersetzen]]
Another language version can also be linked to preceding colon (:).
See also the [[:de:Help:Übersetzen|German page]].
See also the German page.

Categories

1rightarrow.png See Help:Categories for the main article about this subject.

Categories is almost as important as internal links in helping to put the topic of the article in a broader context. Categories can both be added to a page and be linked to nearly like usual wikilinks.

Before adding categories to a page it is always a good idea to browse the category tree to try to find as narrow categories as possible.

Description What you type What you get
Adding a category to a page.
[[Category:Help]]
Adding a category to a page, but sorted under "707-320" on the category page.
[[Category:Boeing|707-320]]
Linking to a category must be done with a preceding colon (:).
[[:Category:Help]]
Category:Help
Links to categories can use a pipe (|) as well.
See the [[:Category:Help|help]] category.
See the help category.

Redirects

Pages need redirects if:

  • they have abbreviations (eg. HUD redirect to Head-up display).
  • they have symonyms (eg. FlightGear Wizard redirect to FlightGear Launch Control).
  • there are various spellings or common mis-spellings (eg. Flight Gear redirect to FlightGear).

With redirects we can decrease the time people will need to find the article they were looking for. Most people get discouraged if they have to search to a long list of possible results.

To make a redirect, add the following code to an empty page:

#REDIRECT[[Page name]]

External links

MediaWiki wiki help pages

Wikimedia Meta-Wiki help pages