Help:Editing

From Computer Laboratory System Administration
Revision as of 06:40, 15 February 2012 by Default Page (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This "how to" page is a shorter version of the one in the Wikipedia edit help pages (since we use the same software – Mediawiki). There is useful documentation at Mediawiki Help.

How to edit wiki pages

Editing a Wiki page is very easy. Simply click on the edit tab at the top (or the edit link on the right or bottom) of a Wiki page. This will bring you to a page with a text box containing the editable text of that page.

Type away, write a short edit summary on the small field below the edit-box. If you've only changed the formatting or spelling of a page, select This is a minor edit.

When you've finished, press Show preview to see how your changes will look. Then press Save page. Depending on your system, pressing Enter while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the Save button.

The wiki markup

In the left column of the table below, you can see what effects are possible. In the right column, you can see how those effects were achieved. In other words, to make text look like it looks in the left column, type it in the format you see in the right column.

You may want to keep this page open in a separate browser window for reference. If you want to try out things without danger of doing any harm, you can do so in the Sandbox.

Sections, paragraphs, lists and lines

What it looks like What you type

Start your sections as follows:

New section

Subsection

Sub-subsection

Sub-sub-subsection
  • Start with a second-level heading (==); do not use first-level headings (=).
  • Don't use a section heading as an overall title for the page; use the Help:page name instead.
  • Do not skip levels (e.g., second-level followed by fourth-level).
  • A Table of Contents will automatically be added to an article that has four or more sections.
==New section==
===Subsection===
====Sub-subsection====
=====Sub-sub-subsection=====

A single newline generally has no effect on the layout. These can be used to separate sentences within a paragraph. Some editors find that this aids editing and improves the function diff (used internally to compare different versions of a page).

But an empty line starts a new paragraph.

  • When used in a list, a newline does affect the layout (see below).
A single newline
generally has no effect on the layout. 
These can be used to separate
sentences within a paragraph.
Some editors find that this aids editing
and improves the function ''diff'' 
(used internally to compare
different versions of a page).

But an empty line
starts a new paragraph.

You can break lines
without starting a new paragraph.

  • Please use this sparingly.
  • Close markup between lines, don't start a link or italics or bold on one line and close it on the next.
You can break lines<br>
without starting a new paragraph.
  • 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 a list item.

  • An empty line starts a new list.
* 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 a list item.

* An empty line starts a new list.
  1. Numbered lists are also good
    1. very organized
    2. easy to follow
      1. easier still
# Numbered lists are also good
## very organized
## easy to follow
### easier still
  • You can even do mixed lists
    1. and nest them
      • like this
* You can even do mixed lists
*# and nest them
*#* like this
Definition list
list of definitions
item
the item's definition
another item
the other item's definition
  • One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.
; Definition list : list of definitions
; item : the item's definition
; another item
: the other item's definition
A colon indents a line or paragraph.

A manual newline starts a new paragraph.

  • This is primarily for displayed material, but is also used for discussion on Talk pages.
: A colon indents a line or paragraph.
A manual newline starts a new paragraph.
IF a line starts with a space THEN
  it will be formatted exactly
  as typed;
  in a fixed-width font;
  lines won't wrap;
ENDIF
The HTML "pre" element
also works.
  • This is useful for:
    • pasting preformatted text;
    • algorithm descriptions;
    • program source code;
    • ASCII art;
  • WARNING: If you make it wide, you force the whole page to be wide and hence less readable, especially for people who use lower resolutions. Never start ordinary lines with spaces.
<nowiki>
 IF a line starts with a space THEN
   it will be formatted exactly
   as typed;
   in a fixed-width font;
   lines won't wrap;
 ENDIF
<pre>
The HTML "pre" element
also works.
</nowiki>

A horizontal dividing line: this is above it


and this is below it.

  • Mainly useful for separating threads on Talk pages.
A horizontal dividing line:
this is above it
----
and this is below it.

Links and URLs

What it looks like What you type

London has public transport.

  • Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).
  • Thus the link above is to the URL https://wiki.cam.ac.uk/cl-sys-admin/Public_transport, which is the Wikipedia article with the name "Public transport".
London has [[public transport]].

San Francisco also has public transportation.

  • Same target, different name.
  • This is a piped link.
San Francisco also has
[[public transport|public transportation]].

San Francisco also has public transportation.

Examples include buses, taxis and streetcars.

  • Endings are blended into the link.
  • Preferred style is to use this instead of a piped link, if possible.
San Francisco also has
[[public transport]]ation.

Examples include [[bus]]es, [[taxi]]s
and [[streetcar]]s.

Automatically hide stuff in parentheses: kingdom.

Automatically hide namespace: Village Pump.

Or both: Manual of Style

But not: [[Wikipedia:Manual of Style#Links|]]

  • The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When previewing your edits, you will not see the expanded form until you press Save and Edit again. The same applies to links to sections within the same page (see previous entry).
Automatically hide stuff in parentheses:
[[kingdom (biology)|]].

Automatically hide namespace: 
[[Wikipedia:Village Pump|]].

Or both:
[[Wikipedia:Manual of Style (headings)|]]

But not:
[[Wikipedia:Manual of Style#Links|]]

The weather in London is a page that doesn't exist yet.

  • You can create it by clicking on the link (but please don't do so with this particular link).
  • To create a new page:
    1. Create a link to it on some other (related) page.
    2. Save that page.
    3. Click on the link you just made. The new page will open for editing.
  • For more information, see http://www.mediawiki.org/wiki/Help:Starting_a_new_page.
  • Please do not create a new article without linking to it from at least one other article.
[[The weather in London]] is a page 
that doesn't exist yet.

When adding a comment to a Talk page, you should sign it by adding three tildes to add your user name:

spqr

or four to add user name plus date/time:

spqr 12:48, 26 Nov 2010 (GMT)

Five tildes gives the date/time alone:

12:48, 26 Nov 2010 (GMT)
  • The first two both provide a link to your user page.
When adding a comment to a Talk page,
you should sign it by adding
three tildes to add your user name:
: ~~~
or four for user name plus date/time:
: ~~~~
Five tildes gives the date/time alone:
: ~~~~~
  • Redirect one article title to another by placing a directive like the one shown to the right on the first line of the article (such as at a page titled "USA").
  • Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "#REDIRECT [[United States#History]]" will redirect to the United States page, but not to any particular section on it. This feature will not be implemented in the future, so such redirects should not be used.
#REDIRECT [[United States]]
  • To put an article in a category, place a link like the one to the right anywhere in the article. It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.
[[Category:Character sets]]
  • To link to a category page without putting the article into the category, use an initial colon (:) in the link.
[[:Category:Character sets]]

Linking to other wikis:

  1. Interwiki link: Wiktionary:Hello
  2. Named interwiki link: Hello
  3. Interwiki link without prefix: Hello
[[metawikipedia:Help:Interwiki linking|
Linking to other wikis]]:
# Interwiki link: [[Wiktionary:Hello]]
# Named interwiki link: [[Wiktionary:Hello|Hello]]
# Interwiki link without prefix: [[Wiktionary:Hello|]]

ISBN 012345678X

ISBN 0-123-45678-X

  • Link to books using their ISBNs. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.
  • ISBN links do not need any extra markup, provided you use one of the indicated formats.
ISBN 012345678X

ISBN 0-123-45678-X

Sound

  • To include links to non-image uploads such as sounds, use a "media" link. For images, see next section.
[[media:Sg_mrob.ogg|Sound]]

Images

What it looks like What you type
A picture: Wikipedia - The Free Encyclopedia
  • For many projects, only images that have been uploaded to the same project or the Commons can be used. To upload images, use the upload page. You can find the uploaded image on the image list
A picture: [[Image:Wiki.png]]

or, with alternate text (strongly encouraged)

[[Image:Wiki.png|Wikipedia 
- The Free Encyclopedia]] 

Web browsers render alternate text when not displaying an image -- for example, when the image isn't loaded, or in a text-only browser, or when spoken aloud.

For the full image syntax, see Wikipedia:Wikipedia:Extended image syntax

Clicking on an uploaded image displays a description page, which you can also link directly to: Image:Wiki.png

[[:Image:Wiki.png]]

To include links to images shown as links instead of drawn on the page, use a "media" link.
Wikipedia logo

[[media:Wiki.png|Wikipedia logo]]

Character formatting

What it looks like What you type

Emphasize, strongly, very strongly.

  • These are double and triple apostrophes (single-quote marks), not double-quote marks.
''Emphasize'', '''strongly''', '''''very strongly'''''.

A typewriter font for monospace text or for computer code: int main()

A typewriter font for <tt>monospace text</tt>
or for computer code: <code>int main()</code>

You can use small text for captions.

You can use <small>small text</small> for captions.

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.

  • When editing regular Wiki pages, just make your changes and don't mark them up in any special way.
  • When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.
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.

Subscripts:
x1 x2 x3

Superscripts:
x1 x2 x3 or x¹ x² x³

  • The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.

ε0 = 8.85 × 10−12 C² / J m.

1 hectare = 1 E4 m²


x<sub>1</sub> x<sub>2</sub> x<sub>3</sub>
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup>
or x&sup1; x&sup2; x&sup3;

&epsilon;<sub>0</sub> =
8.85 &times; 10<sup>&minus;12</sup>
C&sup2; / J m.

1 [[hectare]] = [[1 E4 m&sup2;]]

Suppressing interpretation of markup:
Link → (''to'') the [[Wikipedia FAQ]]

  • Used to show literal data that would otherwise have special meaning.
  • Escape all wiki markup, including that which looks like HTML tags.
  • Does not escape HTML character references.
  • To escape HTML character references such as &rarr; use &amp;rarr;


<nowiki>Link &rarr; (''to'') 
the [[Wikipedia FAQ]]</nowiki>

Commenting page source:
not shown when viewing page

  • Used to leave comments in a page for future editors.
  • Note that most comments should go on the appropriate Talk page.


<!-- comment here -->

Special characters

Characters outside US-ASCII can be written either as HTML entities or by just typing them into the edit box if your Web browser can handle that. See also metawikipedia:Help:Special characters.

Tables

There are two ways to build tables:

Variables

(See metawikipedia:Help:Variable)

Templates

Some part of a page may correspond in the edit box to just a reference to another page, in the form {{name}}, referring to the page "Template:name" (or if the name starts with a namespace prefix, it refers to the page with that name; if it starts with a colon it refers to the page in the main namespace with that name without the colon). This is called a template. For changing that part of the page, edit that other page. Sometimes a separate edit link is provided for this purpose. A convenient way to put such a link in a template is with a template like m:Template:ed. Note that the change also affects other pages which use the same template.

The most useful templates in Computer Laboratory System Administration are listed in Computer Laboratory System Administration:Template messages.