Help:Formatting

From wiki.thepatternofeverything.org
Jump to: navigation, search

The Markup Language

The MediaWiki markup language (commonly referred to within the MediaWiki community as wikitext, though this usage is ambiguous within the larger wiki community) uses sometimes paired non-textual ASCII characters to indicate to the parser how the editor wishes an item or section of text to be displayed. The parser translates these tokens into (X)HTML as closely as semantically possible.

Formatting your Article

You may find a simple cheat sheet for beginners from the Wikipedia website: http://upload.wikimedia.org/wikipedia/commons/0/05/Cheatsheet-en.pdf

Also, if you know how to create a page in HTML, you can also copy and paste your HTML code instead.

Additional Formatting Help Pages

Current (v1.6) Markup tokens

The markup tokens fall into two broad categories: unary tokens (like : or * used at the beginning of a line), which stand alone, and binary tokens (like those for italic or boldface) which must be used in matched pairs.

Unary

Start of line only

  • Horizontal line: ---- (4 or more hyphens)
  • Pre-formatted text: (space)
  • Lists
    • Bulleted: *
    • Numbered: #
    • Indent with no marking: :
    • Definition list: ;
    Notes:
    • These may be combined at the start of the line to create nested lists, e.g. *** to give a bulleted list three levels deep, or **# to have a numbered list within two-levels of bulleted list nesting.
  • Redirects: #redirect or #REDIRECT (followed by wikilink)

Can be used anywhere

  • "Magic words", e.g. __FORCETOC__, __NOEDITSECTION__
  • Signatures:
    • ~~~ Replaced with your username
    • ~~~~ Replaced with your username and the date
    • ~~~~~ Replaced with the date.
    Notes:
    • These tags are replaced at the point the edit is saved.
  • Magic links: ISBN ..., RFC ..., PMID ...
  • SGML entities: &...;

Binary

The ellipses (...) are used to indicate where the content goes and are not part of the markup.

  • Square brackets are used for links:
    • Internal/interwiki link + language links + category links + images: [[ ... ]] (see also Namespaces below)
      vertical bars separate optional parameters, which are:
      • link: first parameter: display text (also defaulted using "pipe trick") (also trailing concatenated text included in display, e.g. s for plural)
      • image: many parameters;
      • category: first parameter: sort order in category list
    • External link: [ ... ]
      space separates optional first parameter, which is display text
    • undecorated URLs are also recognized and hotlinked
  • Apostrophes are used for formatting:
    • Italic: '' ... ''
    • Bold: ''' ... '''
    • Bold + Italic: ''''' ... '''''
  • Curly braces are used for transclusion:
    • Include template: {{ ... }} (see also Namespaces below)
    • Include template parameter: {{{ ... }}}
    • Interpolate built-in variable: {{PAGENAME}}
  • Equals signs are used for headings (must be at start of line)
    • 1st level heading: = ... =
    • 2nd level heading: == ... ==
    • 3rd level heading: === ... ===
    • 4th level heading: ==== ... ====
    • 5th level heading: ===== ... =====
    • 6th level heading: ====== ... ======
  • The whole quagmire that is table formatting: {| ... |} with in between |- |+ || | !! ! .
  • Various HTML style tags:
    • <nowiki> do not interpret wiki markup, do allow newline in list and indent elements (but still flow text, still allow SGML entities)
    • <pre> do not interpret wiki markup, do not flow text (but still allow SGML entities)
    • <math> if $wgUseTeX is set
    • <html> if $wgRawHtml is set
    • <gallery>
    • <onlyinclude> <noinclude> <includeonly>
    • Parser extension tags, like <ref> (using Cite.php)
    • Plus most 'non-dangerous' HTML tags: 'b', 'del', 'i', 'ins', 'u', 'font', 'big', 'small', 'sub', 'sup', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'cite', 'code', 'em', 's', 'strike', 'strong', 'tt', 'var', 'div', 'center', 'blockquote', 'ol', 'ul', 'dl', 'table', 'caption', 'pre', 'ruby', 'rt' , 'rb' , 'rp', 'p', 'span', 'u', 'br', 'hr', 'li', 'dt', 'dd', 'td', 'th', 'tr'
  • <!-- ... --><tt> HTML-style comments

Namespaces

In wikilinks and template inclusions, colons set off namespaces and other modifiers:

  • proper namespaces: <TT>Talk:, User:, project, etc.
  • "special" namespaces: Image:, Category:, Template:
  • pseudo-namespaces: Special:, Media:
  • lone/leading :
    • lone : forces main namespace
    • leading : allows link to image page rather than inline image, or similarly to category or template page
  • interwiki links:
    • same project, different language: two-letter code
    • different project, same language: w: for Wikipedia, wt: for Wiktionary, m: for Meta, etc.
  • subst: force one-time template substitution upon edit, rather than dynamic expansion on each view
  • int:, msg:, msgnw:, raw:
  • MediaWiki: magically access mediawiki formatting and boilerplate text
  • Colon functions: UC:, LC:, etc.
  • Parser functions: #expr:, #if:, #switch:, etc.
  • other extensions?

Several combinations of the above are possible.