Changes

Jump to navigation Jump to search

Wurmpedia editing handbook

14,724 bytes added, 14:23, 16 September 2020
m
Saving changes
==Guidelines==
The Wurmpedia is a resource used by new and experienced players alike. It is typically the first place a new player will turn when they want to understand something. As such, we want the Wurmpedia to be as organized, accurate, and user-friendly as possible. These are some guidelines in place to help us all keep the Wurmpedia to a high standard.
 
==General Wurmpedia Etiquette==
As the Wurmpedia team works as a team, we want to run any large changes past other editors and WAs before taking any steps. Trying to look at similar pages before you correct any formatting.
 
If you see wrong information, you can correct it yourself, but you may want to bring it up on Discord if it seems like a larger issue. Please don't assume that incorrect wiki information is brought on by malice.
 
Please don’t edit anyone’s personal page, except your own. Exception: you may remove dead (red) links.
 
Let's be respectful of other WAs and editors and all staff. We all contribute!
 
As of right now, the only language we are translating the Wurmpedia into is Russian. If you’d like to work on another language project (or that one!) please message the Manager or the team in general.
==Stylistic Guide==
* Use the [[Special:Categories|categories]] and [[:Category:Template|templates]] when appropriate. Look at a similar page and see what it uses for hints.
* Use <nowiki>[[links]]</nowiki> when referring to other pages (refrain from linking the same page multiple times in the same article.)
* Much of our crafting information has been moved into the Itembox template, including dye information. Please don't add crafting instructions to the main wiki article, unless you check in with other WAs/staff. If you need help with the itembox, ask in Discord.
* Avoid personal bias when editing. When in doubt, take it to the talk page.
* Do not post suggestions. They belong in the forums or on IRC - not here.
The right column includes your edits. Text is highlighted where you have made changes.
===Basic Wiki Markup===
The Wurmpedia uses wiki markup, a type of coding language used to format text and images in a custom way. You can do anything from making text bold and italic, to making text appear only if certain conditions are met (for example, if the item is made of wood, display text indicating the types of wood that item can be made from). For this introductory course, you will be introduced to formatting text in bold and italics, creating headers, and linking to other articles or webpages. These are the most common markup codes you will use in editing.
|Link to the Wurm Online forums that says forums||<nowiki>Link to the [https://forum.wurmonline.com forums]</nowiki>||Link to the [https://forum.wurmonline.com forums]
|}
===Previewing Your Changes===
[[File:Handbook8.png|border|]]
Showing the preview before saving a page is a great habit to get into.
===Using Images===
To include a file in a page, use a link in one of the following forms:
<nowiki>[[File:File.jpg]]</nowiki> to use the full version of the file
Click the red link to be taken to the not yet created article, where you can begin editing.
===Article Content===
When creating a page, it can be helpful to find a similar page to kind of copy from. You don't always, and will rarely, need to create an article totally from scratch. In our Purple unicorn example, we may find useful information on the Unicorn page. If most information is the same, you could find it easier to go into the Unicorn article's Edit page, copy everything, paste it into your new article, then modify it to match the info you have about the Purple unicorn. (Note: I regret to tell you, but I don't think purple unicorns are in the works for Wurm Online at this time. I'm sorry!!!)
If you do choose to do this when making an article, make sure that every reference to the current page (aside from <nowiki>{{PAGENAME}}</nowiki>, which will give the name of whichever page it is currently on) is changed to that of your current article. Also be sure to check the categories, as some may be in categories that are not relevant to the new article.
===Headers===
One useful thing that you'll find on most Wurmpedia articles is a header of links which shows what categories the item is a part of.
<nowiki>[[CDB|Main]] / [[:Category:Bestiary|Bestiary]] / '''{{PAGENAME}}'''</nowiki>
===Linking Articles to Categories===
[[File:Handbook16.png|border|]]
'''Fun Fact''': You can create a clickable link to get to that category page by adding a colon to the beginning. To link to the Blacksmithing items category, you would add <nowiki>[[:Category:Blacksmithing items]]</nowiki>.
====Babel categories====
[[File:Handbook21.png|border|]]
===Creating a Template===
'''====Step 1: Choose a name for your template and go to create the page.'''====
[[File:Handbook12.png|border|]]
'''====Step 2: Content'''====
We want the template to tell pages "This is a <colour> unicorn". For the basic text, you can just add it within the tags.
[[File:Handbook22.png|border|]]
'''====Step 3: Include and noinclude'''====
Any content written directly into the template will show on both the template’s page as well as any pages using the template.
[[File:Handbook24.png|border|]]
===“If” Statements===
====What is an if statement ?!====
For those who are not familiar with coding, an if statement is something that is used to do a certain thing if the statement is true, and something else if it is false. For example:
If this was your code, it would result in Say yes.
====How do I make an if statement?====
In templates, we sometimes want to add an if statement so that we can make the template work in many different articles. For example, in the Fence template, here is a sample of an if statement:
<pre>{{#if:{{{gate|}}}|[[Iron fence gate]]|[[Iron fence]]}}</pre>
'''Tip:''' You can place if statements within if statements for more complex scenarios. For example, maybe you want an if statement that does something like this:
[picture of if tree I guess]
But let's not get ahead of ourselves. Getting started with if statements is enough on your plate!
====If a variable = something specific:====
The next if statement we should talk about is the '''#ifeq''' statement. This is used when you want to ask if something matches something else. In our case, we will just about always use it to ask if an inputted variable is something specific. For example, you may have "material" as a variable in your template, where a user would put what material it is made of. Let's say you want the page to display that a pottery bowl is used in cooking if the material given is "clay", and otherwise display "Cannot be used in cooking."
===Table Construction Markup===
Let's start with the markup. The following table is taken from mediawiki.org.<pre> {| table start, required
<nowiki>{| table start, required|+ table caption, optional; only between table start and table row |- table row, optional on first row—wiki engine assumes the first row ! table header cell, optional. Consecutive table header cells may be added on same line separated by double marks (!!) or start on new lines, each with its own single mark (!). | table data cell, optional. Consecutive table data cells may be added on same line separated by double marks (||) or start on new lines, each with its own single mark (|). |} table end, required</nowikipre>
Unfortunately, each of these codes do have to go on a new line, which can make your article look really complicated, especially if you create bigger tables. Using these codes get gets you the layout of a table without any borders, backgrounds, or anything - just text.
[[File:Handbook26.png|border|]][[File:Handbook27.png|border|]]
This *could* be useful in some cases, but generally when making a table, you'll probably want it to look like a table and not just a bunch of floating words. For example, on the Animals article, there is a giant table that looks like this:
[[File:Handbook28.png|border|]]
To make your table look like a table, you need to tell it that you'd like there to be a border, for example. We'll take a look at some different formatting options available for tables now.
To align the table to the right, you'll add
<pre>style="margin-left:auto;"</pre>
to your table start line, which is
<pre> {|</pre>
[[File{|style="border-style:Handbook29.png]]solid; margin-left:auto;" border="1" !Column 1 !Column 2 !Column 3 |- |Row 1||Row 1||Row 1 |- |Row 2||Row 2||Row 2 |}
Below is the code to create this table:
To align the table to the center, you'll add
<pre>style="margin:auto;" </pre>
to your table start line.
[[File{|style="border-style:Handbook30.png]]solid; margin:auto;" border="1" !Column 1 !Column 2 !Column 3 |- |Row 1||Row 1||Row 1 |- |Row 2||Row 2||Row 2 |}
Finally, you can float the table alongside the article text by adding the following to your table start line:
</pre>
[[File:Handbook31.png|border|]]
==Text Alignment==
Text alignment in cells can be left, right, or center-aligned, as well as vertically aligned to the top, middle, or bottom.
===Horizontal Alignment===
To align to the left, right or center, use
 
<pre>
style="text-align:center;"
This code can be used in the table start, row start, or cell start levels.
<hr>
If placed at the table start level, it will align all text within the table the way specified.
[[File:Handbook32.png|border|]]
<pre>{|style="text-align:center;"</pre>
If placed at the row start level, it will only align the text within that row's cells the way specified.
[[File:Handbook33.png|border|]]
<pre>|-style="text-align:center;"</pre>
If placed at the cell level, it will only align that individual cell the way specified.
[[File:Handbook34.png|border|]]
<pre>|-style="text-align:center;"</pre>
style="vertical-align:bottom;"
</pre>
 
{| class="wikitable"
|- style="vertical-align:top;"
| style="height:100px; width:100px; text-align:left;" | A
| style="height:100px; width:100px; text-align:center;" | B
| style="height:100px; width:100px; text-align:right;" | C
|- style="vertical-align:middle;"
| style="height:100px; width:100px; text-align:left;" | D
| style="height:100px; width:100px; text-align:center;" | E
| style="height:100px; width:100px; text-align:right;" | F
|- style="vertical-align:bottom;"
| style="height:100px; width:100px; text-align:left;" | G
| style="height:100px; width:100px; text-align:center;" | H
| style="height:100px; width:100px; text-align:right;" | I
|}
The first row is vertically aligned to the top, the second to the middle, and the third to the bottom. In this example, the code is applied to the whole row.
<pre>
{| class="wikitable"
|- style="vertical-align:top;"
| style="height:100px; width:100px; text-align:right;" | I
|}
</pre>
You can use the code at the cell level as well, which will modify the individual cell.
{| border="1" style="width:300px; height:200px;"
|-
|style="vertical-align:top;"|Row 1||style="vertical-align:bottom;"|Row 1||style="vertical-align:top;"|Row 1
|-
|Row 2||Row 2||Row 2
|}
<pre>
{| border="1" style="width:300px; height:200px;"
|-
|Row 2||Row 2||Row 2
|}
</pre>
Note: When adding styling code such as this to the cell level, you need to add a vertical bar after your code, dividing it from the text your cell contains.
 
<pre>
style="vertical-align:top;"|Row||
</pre>
 
==Cell, Row, and Table Sizing==
 
You can set the size of the table, rows, and cells to a width and height in pixels or percentages of the screen. Percentages are recommended as they will ensure a similar view for any screen size.
 
To set the width or height, these are the codes you will use - they are used at the table start or individual cell levels:
<pre>
style="width:50%;"
style="height:50px;"
</pre>
 
'''Width:''' Used on the table start level, this will adjust the total size the table will take up, in height or as a percentage of the screen/browser window. Used on the individual cell level, it will adjust the amount of space it takes within the table.
 
'''Height:''' Used with a percentage will indicate what percentage of the table it will take up. On the table start level, a percentage cannot be used with the height - use 'px' for pixels instead.
 
'''Example 1: Defining a table's width and height'''
 
{| border="1" style="width:75%; height:300px;"
|-
|Row 1||Row 1||Row 1
|-
|Row 2||Row 2||Row 2
|}
 
<pre>
{| border="1" style="width:75%; height:300px;"
|-
|Row 1||Row 1||Row 1
|-
|Row 2||Row 2||Row 2
|}
</pre>
 
'''Example 2: Defining a row's height'''
 
 
{| border="1" style="width:75%; height:300px;"
|-style="height:75%;"
|Row 1||Row 1||Row 1
|-
|Row 2||Row 2||Row 2
|}
 
<pre>
{| border="1" style="width:75%; height:300px;"
|-style="height:75%;"
|Row 1||Row 1||Row 1
|-
|Row 2||Row 2||Row 2
|}
</pre>
 
===Row and Column Spans===
 
You can span cells across multiple rows or columns, which is the same as merging cells together in word processing programs.
To span a cell across multiple columns:
 
<pre>
colspan="2"
</pre>
To span a cell across multiple rows:
<pre>
rowspan="2"
</pre>
Each of these is used at the individual cell level. Note that your table will have as many columns as the largest row; this means that if your table has 3 columns per row, and you use a column span on one of your cells, your table will be 4 columns wide.
 
{| border="1"
|-
|colspan="2"|Row 1||Row 1||Row 1
|-
|Row 2||Row 2||Row 2
|}
 
<pre>
{| border="1"
|-
|colspan="2"|Row 1||Row 1||Row 1
|-
|Row 2||Row 2||Row 2
|}
</pre>
 
{| border="1"
|-
|rowspan="2"|Row 1||Row 1||Row 1||Row 1
|-
|Row 2||colspan="2" |Row 2
|-
|}
<pre>
{| border="1"
|-
|rowspan="2"|Row 1||Row 1||Row 1||Row 1
|-
|Row 2||colspan="2" |Row 2
|-
|}
</pre>
 
===Colouring - Tables, Cells, and Text===
 
Sometimes it may be nice to add some colour to the table, at least to make it stand out on the article a bit more.
Since we're in the table business, let's look at the colour codes in a table! Note that colours can be written or specified with the hex value.
 
{| class="wikitable"
|-
| Colour text || style="color:white;"
style="color:#009999;"
|-
| Colour entire table or cells ||style="background-color:white;"
style="background-color:#009999;"
|}
 
{|style="color:white; background-color: #009999; width: 50%;"
|style="background-color: black;"|Column! || Another column || Another one
|- style="background-color:white; color:black;"
|A new row ||this row is coloured differently! || final cell
|}
 
<pre>
{|style="color:white; background-color: #009999; width: 50%;"
|style="background-color: black;"|Column! || Another column || Another one
|- style="background-color:white; color:black;"
|A new row ||this row is coloured differently! || final cell
|}
</pre>
 
Colour codes can be placed at different levels depending on what you are trying to achieve. In the table I have created above, the whole table is coloured a teal colour, while some other cells are coloured differently. This gives the illusion of a coloured border when a border size is not specified.
Table Borders and Spacing
By default, tables are made with no borders, as you saw in Tables: Basic Construction.
 
This doesn't make it look much like a table now, does it?
 
Table Borders
To add a simple border, you can add the following code at the table start level:
border="1"
 
 
You can change the border width on each side of the table by using the following at the table start level:
style="border-width:10px 40px 80px 0px;"
These define top, right, bottom, and left borders respectively.
 
 
If you wish to have the top and bottom have the same border width, as well as the left and right sides to have the same, it is defined by top/bottom and left/right respectively.
style="border-width:10px 40px;"
 
 
Table Spacing
You can add some space in your cells by adding cell padding. To do so, add the following code to the table start level:
cellpadding="10"
This will create a 10-pixel margin of space in every direction in your cell.
 
Table Classes (Styles)
There are some table classes that provide some table formatting for you. They are most commonly used, as it makes it easier to understand and set up.
To add a class to your table, simply add:
class="<classname>"
To the table start level. For example:
{|class="wikitable"
 
Wikitable
The wikitable class gives a light grey background to cells, and simple table borders.
 
{|class="wikitable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Wikitable Sortable
The wikitable sortable class gives the same things as the wikitable class does, but also makes your columns sortable (alphabetically).
 
{|class="wikitable sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Sortable
The sortable class adds the ability to sort columns alphabetically.
 
{|class="sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Colour codes can be placed at different levels depending on what you are trying to achieve. In the table I have created above, the whole table is coloured a teal colour, while some other cells are coloured differently. This gives the illusion of a coloured border when a border size is not specified.
Table Borders and Spacing
By default, tables are made with no borders, as you saw in Tables: Basic Construction.
 
This doesn't make it look much like a table now, does it?
 
Table Borders
To add a simple border, you can add the following code at the table start level:
border="1"
 
 
You can change the border width on each side of the table by using the following at the table start level:
style="border-width:10px 40px 80px 0px;"
These define top, right, bottom, and left borders respectively.
 
 
If you wish to have the top and bottom have the same border width, as well as the left and right sides to have the same, it is defined by top/bottom and left/right respectively.
style="border-width:10px 40px;"
 
 
Table Spacing
You can add some space in your cells by adding cell padding. To do so, add the following code to the table start level:
cellpadding="10"
This will create a 10-pixel margin of space in every direction in your cell.
 
Table Classes (Styles)
There are some table classes that provide some table formatting for you. They are most commonly used, as it makes it easier to understand and set up.
To add a class to your table, simply add:
class="<classname>"
To the table start level. For example:
{|class="wikitable"
 
Wikitable
The wikitable class gives a light grey background to cells, and simple table borders.
 
{|class="wikitable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Wikitable Sortable
The wikitable sortable class gives the same things as the wikitable class does, but also makes your columns sortable (alphabetically).
 
{|class="wikitable sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Sortable
The sortable class adds the ability to sort columns alphabetically.
 
{|class="sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Colour codes can be placed at different levels depending on what you are trying to achieve. In the table I have created above, the whole table is coloured a teal colour, while some other cells are coloured differently. This gives the illusion of a coloured border when a border size is not specified.
Table Borders and Spacing
By default, tables are made with no borders, as you saw in Tables: Basic Construction.
 
This doesn't make it look much like a table now, does it?
 
Table Borders
To add a simple border, you can add the following code at the table start level:
border="1"
 
 
You can change the border width on each side of the table by using the following at the table start level:
style="border-width:10px 40px 80px 0px;"
These define top, right, bottom, and left borders respectively.
 
 
If you wish to have the top and bottom have the same border width, as well as the left and right sides to have the same, it is defined by top/bottom and left/right respectively.
style="border-width:10px 40px;"
 
 
Table Spacing
You can add some space in your cells by adding cell padding. To do so, add the following code to the table start level:
cellpadding="10"
This will create a 10-pixel margin of space in every direction in your cell.
 
Table Classes (Styles)
There are some table classes that provide some table formatting for you. They are most commonly used, as it makes it easier to understand and set up.
To add a class to your table, simply add:
class="<classname>"
To the table start level. For example:
{|class="wikitable"
 
Wikitable
The wikitable class gives a light grey background to cells, and simple table borders.
 
{|class="wikitable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Wikitable Sortable
The wikitable sortable class gives the same things as the wikitable class does, but also makes your columns sortable (alphabetically).
 
{|class="wikitable sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Sortable
The sortable class adds the ability to sort columns alphabetically.
 
{|class="sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Colour codes can be placed at different levels depending on what you are trying to achieve. In the table I have created above, the whole table is coloured a teal colour, while some other cells are coloured differently. This gives the illusion of a coloured border when a border size is not specified.
 
===Table Borders and Spacing===
 
By default, tables are made with no borders, as you saw in Tables: Basic Construction.
 
[[File:Handbook35.png]]
 
This doesn't make it look much like a table now, does it?
 
==== Table Borders ====
To add a simple border, you can add the following code at the table start level:
<pre>
border="1"
</pre>
 
[[File:Handbook36.png]]
 
You can change the border width on each side of the table by using the following at the table start level:
<pre>
style="border-width:10px 40px 80px 0px;"
</pre>
 
These define top, right, bottom, and left borders respectively.
 
[[File:Handbook37.png]]
 
If you wish to have the top and bottom have the same border width, as well as the left and right sides to have the same, it is defined by top/bottom and left/right respectively.
<pre>
style="border-width:10px 40px;"
</pre>
 
[[File:Handbook38.png]]
 
====Table Spacing====
You can add some space in your cells by adding cell padding. To do so, add the following code to the table start level:
<pre>
cellpadding="10"
</pre>
This will create a 10-pixel margin of space in every direction in your cell.
 
{|class="wikitable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
Table Classes (Styles)
There are some table classes that provide some table formatting for you. They are most commonly used, as it makes it easier to understand and set up.
To add a class to your table, simply add:
class="<classname>"
To the table start level. For example:
{|class="wikitable"
 
Wikitable
The wikitable class gives a light grey background to cells, and simple table borders.
 
{|class="wikitable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Wikitable Sortable
The wikitable sortable class gives the same things as the wikitable class does, but also makes your columns sortable (alphabetically).
 
{|class="wikitable sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
 
Sortable
The sortable class adds the ability to sort columns alphabetically.
 
{|class="sortable"
!Column 1
!Column 2
!Column 3
|-
|Row 1||Row||Row
|-
|Row 2||Row||Row
|}
editor
7,290

edits

Navigation menu