Basic wiki code

From PortlandWiki
Jump to navigation Jump to search

(Return to the Edit page)


Introduction to Wiki Formatting

Simple editing is one of the major benefits of using a wiki. Users can edit pages without knowing HTML, and still use many formatting features of HTML. Most wikis define a set of formatting rules to convert plain text into HTML. Some wikis (like this one) also allow some HTML "tags", like <b>, <i>, and <pre> within a page. (Some wikis use raw HTML instead of special formatting rules.)

The following text is an overview of the MediaWiki text formatting rules.

Basic Text Formatting

Most text does not require any special changes for wiki form. A few basic rules are:

  • Do not indent paragraphs. (Indenting may cause your text to appear in a monospaced font.)
  • Leave a single blank line between paragraphs.
  • To create a horizontal line, type four dashes (----).

Bold and Italics

To mark text as bold, italic or fixed-width, you can use single quotation-mark formatting (the MediaWiki standard). Examples:

''Two single quotes are italics'',
'''three single quotes are bold''',
'''''five single quotes are bold and italic.'''''

looks like:

Two single quotes are italics, three single quotes are bold, five single quotes are bold and italic.

HTML <b> and <i> tags can also be used. For example:

<b> bold </b>, 
<i> italic </i>,
<b> <i> bold+italic </i> </b>.

Note that MediaWiki (like most Wikis) processes pages line-by-line, so if you want three bold lines of text, you will need to use three separate <b>...</b> tags. Also note that unclosed or unmatched tags are not removed from the page.

Headings

Headings are delimited by 1-6 equal signs (=). They basically correspond to HTML's <h1> through <h6> tags.

= Headline size 1 =
== Headline size 2 ==
=== Headline size 3 ===
==== Headline size 4 ====
===== Headline size 5 =====
====== Headline size 6 ======

Lists

Simple lists:

* Text for a bulleted list item.
** Text for second-level list.
*** Text for third level, etc.

...which looks like:

  • Text for a bulleted list item.
    • Text for second-level list.
      • Text for third level, etc.

Numbered lists:

# Text for a numbered list item.
## Text for second-level list.
### Text for third level, etc.
## Another Text for the second level.

...which looks like:

  1. Text for a numbered list item.
    1. Text for second-level list.
      1. Text for third level, etc.
    2. Another Text for the second level.

Indented Text

Simple indented text:

: Text to be indented (quote-block)
:: Text indented more
::: Text indented to third level

...which looks like:

Text to be indented (quote-block)
Text indented more
Text indented to third level

Reference

Adapted from This Might Be a Wiki