Help:Wikitext

This is an old revision of this page, as edited by K6ka (talk | contribs) at 16:09, 8 May 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
This page is a help page
It is meant to detail processes or procedures of some aspect or aspects of The Sims Wiki's norms and practices. It is not a policy page.
Tip
You can view a simplified version of this page at Help:Cheatsheet that lists the most commonly used wiki formatting codes you need to know.

Page is a WIP

Wikitext, also known as wiki markup, refers to the syntax, keywords, and punctuation marks used by The Sims Wiki to format a page. For example, to make text italicized, you would type ''text to be italicized'' into the page when editing it. You will see wikitext if you click on 'Edit source' to edit a page. If you use the new VisualEditor to edit a page, you will not see wikitext when editing, and will instead edit the page like you would a Word document.

This page is a comprehensive guide to the many different features, syntaxes, and keywords offered by wikitext. For a simplified view containing only the essentials you need to know to start editing, check out the cheatsheet.

Formatting

Description You type You get
Bold, italics, and both
To ''italicize text'', put two consecutive apostrophes on each side of it.

To '''bold text''', use three apostrophes instead of just two.

To '''''bold and italicize text''''', use five apostrophes.

'''Don't forget the other "closing" apostrophes, or else the whole sentence will be bolded!

Bold and italic formatting work correctly only within a single line.
To italicize text, put two consecutive apostrophes on each side of it.

To bold text, use three apostrophes instead of just two.

To bold and italicize text, use five apostrophes.

Don't forget the other "closing" apostrophes, or else the whole sentence will be formatted!

Bold and italic formatting work correctly only within a single line.

Code text
You can display text in a monospace font for source code by surrounding it with <code>code tags</code>.

Computer programmers like to say <code>Hello World!</code> for starters.
You can display text in a monospace font for source code by surrounding it with code tags.

Computer programmers like to say Hello World! for starters.

Syntax highlighting for source code. See here for a list of supported programming languages.
Lua is a popular programming language amongst game developers. Lua code looks something like this:

<syntaxhighlight lang="Lua">
local p = {}

function p.hello()
	return "Hello, world!"
end

return p</syntaxhighlight>
Lua is a popular programming language amongst game developers. Lua code looks something like this:
local p = {}

function p.hello()
	return "Hello, world!"
end

return p
Preformatted text
 If you leave a space between the first letter and the start of the line, text will appear in this preformatted text form.

 Wiki markup, like '''bold''' and ''italics'', will still work in here.
If you leave a space between the first letter and the start of the line, text will appear in this preformatted text form.
Wiki markup, like bold and italics, will still work in here.
Underline and strikethrough
To <u>underline text</u>, add <nowiki><u></nowiki> to the beginning of the text you want to underline, and <nowiki></u></nowiki> where you want it to stop.

Same with <s>strikethrough text</s>.

As with bold and italics, remember the closing tag, <s>or else the software won't know when to stop!

'''We do not typically use <u>underline</u> or <s>strikethrough</s> in articles.''' They are ''<u>usually</u>'' used on discussion pages.

I think you understand what happens when you don't close an HTML tag now.</s>

This is HTML, not wikitext, but since it's so commonly used, we decided to mention it here.
To underline text, add <u> to the beginning of the text you want to underline, and </u> where you want it to stop.

Same with strikethrough text.

As with bold and italics, remember the closing tag, or else the software won't know when to stop!

We do not typically use underline or strikethrough in articles. They are usually used on discussion pages.

I think you understand what happens when you don't close an HTML tag now.

This is HTML, not wikitext, but since it's so commonly used, we decided to mention it here.

Small text
Use <small>small text</small> only when necessary.
Use small text only when necessary.
Big text
Use <big>big text</big> only when necessary.
Use big text only when necessary.
Non-breaking space. Use this to prevent two words from being separated by automatic line wrapping (such as when a sentence reaches the end of the screen).
Mr.&nbsp;Doe drove his car at 400&nbsp;km/h.
Mr. Doe drove his car at 400 km/h.

Layout

Section headings

Section headings are used to divide the page up into different sections. Section headings are created by starting a new line and then surrounding the text you want to use as a heading with equal signs (=). The number of equal signs used indicates the heading level to use. For instance, two equal signs on both sides of the text produces a Level 2 heading, while three equal signs produces a Level 3 heading.

Level 1 headings should not be used in articles, as the Level 1 heading is used in the article title.

You type You get
= Heading 1 =
== Heading 2 ==
=== Heading 3 ===
==== Heading 4 ====
===== Heading 5 =====
====== Heading 6 ======
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6

Horizontal rule

The horizontal rule, also known as a horizontal line, creates a paragraph-level thematic break. This shouldn't be used in article content, as section headings will create these rules automatically.

You type You get
----

Table of contents

When four or more headings are used on a page, a table of contents will automatically appear. You can control the table of contents using magic words placed anywhere on the page.

  • __FORCETOC__ forces the table of contents to always appear, regardless of the number of headings.
  • __TOC__ forces the table of contents to appear where the magic word was placed, rather than at the normal location.
  • __NOTOC__ disables the table of contents, even if the page has more than four headings.

Line breaks

Single line breaks are not shown in the rendered text. As such, to start a new paragraph, you must use two line breaks instead of just one, leaving an empty line between the two paragraphs. A single line break can be used to split up very long sections of content in the wikitext without affecting the rendered output. Keep in mind that single line breaks will still terminate some markup, like bold and italics.

You can use <br /> to create a single line break.

You type You get
A single line break here
has no effect on the layout.

But two line breaks starts a new paragraph.<br />
And a tag makes a single line break.

A single line break here has no effect on the layout.

But two line breaks starts a new paragraph.
And a tag makes a single line break.

Lists

Main article: Help:List

Lists can be used as a way of organizing content. Each entry of the list should be preceded by a * (for bulleted lists) or # (for numbered lists), and each entry should be separated by one line break. A line that doesn't start with a * or # is not considered to be part of the list.

Bulleted lists

Bulleted, or unordered lists, are marked with a standard "bullet" character.

You type You get
* Item1
* Item2
* Item3
* Item4
** Sub-item 4 a)
*** Sub-item 4 a) 1.
**** Sub-item 4 a) 1. i)
**** Sub-item 4 a) 1. ii)
** Sub-item 4 b)
* Item5
  • Item1
  • Item2
  • Item3
  • Item4
    • Sub-item 4 a)
      • Sub-item 4 a) 1.
        • Sub-item 4 a) 1. i)
        • Sub-item 4 a) 1. ii)
    • Sub-item 4 b)
  • Item5

Numbered lists

Numbered, or ordered lists, are numbered on the side. Numberings will continue past sub-items, but a line that doesn't start with a # is not considered part of the list, and the numbering will be reset on the next list.

You type You get
# Item1
# Item2
# Item3
# Item4
## Sub-item 1
### Sub-sub-item
#### Sub-sub-sub-item
## Sub-item 2
# Item5

# Item1 on next list
  1. Item1
  2. Item2
  3. Item3
  4. Item4
    1. Sub-item 1
      1. Sub-sub-item
        1. Sub-sub-sub-item
    2. Sub-item 2
  5. Item5
  1. Item1 on next list

Description lists

Terms and definitions can be easily listed by first starting a line with a semicolon (;), specifying the term, then starting a new line with a colon (:) before specifying the definition(s). This format can be used for other purposes too, such as listing the make and models of vehicles.

Do not use a semicolon to simply bold a line without also specifying a value with a colon. This renders invalid HTML and can cause issues with screen readers. To bold a line, consider using a section heading instead, or bold the text the normal way.

You type You get
;Description
:Term1
:Term2
:Term3
Description
Term1
Term2
Term3

Indent text

Indentation is usually not used in articles, but is commonly used on talk pages to separate other people's comments. Indentation follows similar rules to lists; each line needs to start with a colon, and multiple colons can be used to deepen the indentation level. Each colon indents the line by three character positions.

You type You get
Not indented.
:Indented text.
::Indented some more.
:::Even more.
::::Indentation persists
until a line break is used.
::::But you can pick up where you left off.
:::::And keep going...
::::::...and going...
:::::::...and going...
{{od|:::::::}}On this wiki, you can use the Outdent template to reset indentation.

Not indented.

Indented text.
Indented some more.
Even more.
Indentation persists

until a line break is used.

But you can pick up where you left off.
And keep going...
...and going...
...and going...

────────────────────────────────────────────────────────────────────────────────────────────────────On this wiki, you can use the Outdent template to reset indentation.

Poem

You can use the <poem></poem> tags to preserve both single line breaks and spaces at the beginning of lines. This is good for poems, lyrics, mottoes, oaths, and the like, where one may wish to retain line breaks and spaces.

You type You get
<poem>
But, soft ! what light through yonder window breaks?
   It is the east, and Juliet is the sun!—
Arise, fair sun, and kill the envious moon,
   Who is already sick and pale with grief, 
That thou her maid art far more fair than she:
   Be not her maid, since she is envious;
Her vestal livery is but sick and green,
   And none but fools do wear it; cast it off.—
It is my lady; O, it is my love!

O, that she knew she were!—
   She speaks, yet she says nothing: what of that?
Her eye discourses; I will answer it.
   I am too bold, 'tis not to me she speaks:
Two of the fairest stars in all the heaven,
   Having some business, do entreat her eyes
To twinkle in their spheres till they return.
</poem>

But, soft ! what light through yonder window breaks?
   It is the east, and Juliet is the sun!—
Arise, fair sun, and kill the envious moon,
   Who is already sick and pale with grief,
That thou her maid art far more fair than she:
   Be not her maid, since she is envious;
Her vestal livery is but sick and green,
   And none but fools do wear it; cast it off.—
It is my lady; O, it is my love!

O, that she knew she were!—
   She speaks, yet she says nothing: what of that?
Her eye discourses; I will answer it.
   I am too bold, 'tis not to me she speaks:
Two of the fairest stars in all the heaven,
   Having some business, do entreat her eyes
To twinkle in their spheres till they return.

Poems and their translations can be viewed side by side, and the language can be defined with lang="xx". The poem tag also accepts some CSS styling elements. When you are done, you must use {{Clr|left}} in order to cancel the "float:left;" attribute and re-establish normal text flow.

<poem lang="fr" style="float:left;">Frère Jacques, frère Jacques,
Dormez-vous? Dormez-vous?
Sonnez les matines! Sonnez les matines!
Ding, dang, dong. Ding, dang, dong.</poem>
<poem style="margin-left:2em; float:left;">Are you sleeping? Are you sleeping?
Brother John, Brother John,
Morning bells are ringing! Morning bells are ringing!
Ding, dang, dong. Ding, dang, dong.</poem>{{clr|left}}

Frère Jacques, frère Jacques,
Dormez-vous? Dormez-vous?
Sonnez les matines! Sonnez les matines!
Ding, dang, dong. Ding, dang, dong.

Are you sleeping? Are you sleeping?
Brother John, Brother John,
Morning bells are ringing! Morning bells are ringing!
Ding, dang, dong. Ding, dang, dong.

Links

Main article: Help:Link

Internal links

Internal links link to articles on The Sims Wiki. You can create a link by putting double square brackets around the text you want to link. For example, [[The Sims 2]] would create a link to The Sims 2. You can optionally use a vertical bar (|) in the link to change the displayed text. For example, [[The Sims 2|The second game in the series]] would produce The second game in the series, which links to The Sims 2 but displays the text "The second game in the series".

If you link to a page that doesn't exist yet, it will turn red, like this. If you click on a red link, you'll be taken to a page where you can create that page. If you link to the current page, it will be shown as bold text instead.

You type You get
''[[The Sims 2]]'' was developed by [[Maxis]]. It succeeded the [[The Sims|first game]].

The Sims 2 was developed by Maxis. It succeeded the first game.

Linking to the current page, like [[Help:Wikitext]], will display as '''bold text''' instead.

Linking to the current page, like Help:Wikitext, will display as bold text instead.

Escaping wikitext

Preformatted text block

You type You get
<pre>
Wiki markup, like '''bold''', ''italics'', and [[link]]s are not followed. However, some HTML entities are kept, like &amp;.
</pre>
Wiki markup, like '''bold''', ''italics'', and [[link]]s are not followed. However, some HTML entities are kept, like &.

See also