Help:Basic MediaWiki Syntax: Difference between revisions

From Computer History Wiki
Jump to navigationJump to search
→Text: commenting text out
→Images: Add links to more comprehensive image use info
Line 187: Line 187:
==Images==
==Images==


<nowiki>[[Image:Pdp1115.jpg|thumb|150px|left|Caption text]]</nowiki>
Including the special form:
 
<nowiki>[[File:Pdp1115.jpg|thumb|150px|left|Caption text]]</nowiki>


produces:
produces:


[[Image:Pdp1115.jpg|thumb|150px|left|Caption text]]
[[File:Pdp1115.jpg|thumb|150px|left|Caption text]]


Leaving out the '150px' inserts the image full-size. The optional keywords 'left' and 'right' can be added to control the horizontal placement.
(The legacy keyword 'Image' may be used in place of "File".) Leaving out the "150px" inserts the image full-size. The optional keywords 'left' and 'right' can be added to control the horizontal placement.


(Notice that this text fills up around the image. Add a <nowiki><br clear=all></nowiki> to force the text to re-start below the image.)
(Notice that this text fills up around the image. Add a <nowiki><br clear=all></nowiki> after the image line to force the text to re-start below the image.)


New images can be uploaded via the 'Upload file' page (link on the left-hand side of all pages).
New images can be uploaded via the 'Upload file' page (link on the left-hand side of all pages).
A lengthy tutorial on images is [https://en.wikipedia.org/wiki/Help:Pictures here]; complete specifications for the use of the 'File' special form are available [https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax here] and [https://www.mediawiki.org/wiki/Help:Images here].


[[Category: Help]]
[[Category: Help]]

Revision as of 09:38, 21 March 2023

This is a brief introduction to MediaWiki source syntax. For a more comprehensive guide, see here.

Text

Description You type You get
Applies anywhere
Italicise text

''italic''

italic

Bold text

'''bold'''

bold

Bold and italic

'''''bold & italic'''''

bold & italic

Internal link

(within the Computer History wiki)
The last two here can be combined.

[[name of page]]
[[name of page|display text]]
[[name of page#heading]]

name of page
display text
name of page#heading

External link

(to other websites)

[http://www.example.org]
[http://www.example.org display text]
http://www.example.org

[1]
display text
http://www.example.org

Text can be commented out

matching <!-- and --> around text to be ignored

Sign your posts
on talk pages

~~~~

Your username 10:00,
8 October 2026 (UTC)

Items below only apply at the beginning of a line
Headings

A Table of Contents will automatically be generated when four headings are added to an article.

== Level 1 ==
=== Level 2 ===
==== Level 3 ====
===== Level 4 =====
====== Level 5 ======

Level 1

Level 2

Level 3

Level 4
Level 5
Indented items

(used mostly on Talk: pages)

: foo
:: bar

foo
bar
Bullet list

* one
* two
** two point one
* three

  • one
  • two
    • two point one
  • three
Numbered list

# one
# two
## two point one
# three

  1. one
  2. two
    1. two point one
  3. three

Pre-formatted text

There are a number of ways to include pre-formatted text (e.g. source code fragments); all of these techniques also use a fixed-width font for the text:

  • Start each line with a space character; normal markups can be used; e.g.:

" This is '''pre-formatted''' text"

produces:

This is pre-formatted text
  • Use the HTML <nowiki> tag, with a space character before the <nowiki>. (Remember to add a matching closing tag after the pre-formatted text block).
  • Use the HTML <pre> tag (again, remember the closing tag).

Note that the HTML <blockquote> tag only indents the block; text within it will still be justified.

Tables

{| class="wikitable"
! Table !! Prototype
|-
| colspan="2" style="text-align:center;" | Headers
|-
| aa || rowspan="2" | yy
|-
| bb
|-
| cc || zz
|}

produces:

Table Prototype
Headers
aa yy
bb
cc zz

Images

Including the special form:

[[File:Pdp1115.jpg|thumb|150px|left|Caption text]]

produces:

Caption text

(The legacy keyword 'Image' may be used in place of "File".) Leaving out the "150px" inserts the image full-size. The optional keywords 'left' and 'right' can be added to control the horizontal placement.

(Notice that this text fills up around the image. Add a <br clear=all> after the image line to force the text to re-start below the image.)

New images can be uploaded via the 'Upload file' page (link on the left-hand side of all pages).

A lengthy tutorial on images is here; complete specifications for the use of the 'File' special form are available here and here.