User:Sirryan2002/WikiGuide

From Paradise Station Wiki
< User:Sirryan2002
Revision as of 05:41, 20 January 2021 by Sirryan2002 (talk | contribs) (→‎Variables: added default variables section)
Jump to navigation Jump to search
Sloth construction.png
Sloth construction.png
This article or section is a Work in Progress.
Assigned to:
Sirryan2002
Please discuss changes with assigned users. If no one is assigned, or if the user is inactive, feel free to edit.

Wiki Editing Tutorial

Many people want to edit the Paradise wiki but have absolutely no idea how or where to start learning. This guide serves as the easiest way to pick up on basic-intermediate wiki code and provide a stepping stone for others to improve their wiki knowledge.

If you're a beginner, it is important that you read this wiki top to bottom as the syntax explained builds on what is explained above it. The only way you will get better is by looking at other people's work and playing around on your User page which can be access by clicking on the Username in the top right.

Note:This is not a set of rules for the wiki, for that, you should go Here. Template:TOC

Tags

In order to edit a wiki article you will need to go to the page or a subsection on that page and click the Edit button. If you are logged in you should be able to be edit the code of all but a Few wiki pages.

Writing a wiki page is much like editing a word document or google doc with additional code to format it nicely. You can write a paragraph in plain text and if you wanted to add style to anything you would utilize Tags.

Anything between those tags will receive the attributes given by that tag. For example, if I wanted to bold a certain word in a sentence I would be able to do: Dogs are super <b>cool</b>! This would output as:bDogs are super cool!

Each tag starts with an opening angle bracket '<' and ends with a closing angle bracket '>' and the tag we are using is defined between those. For the bold tag we used earlier b is the name of the tag hence why we used <b>. In order to declare that we are no longer using that tag we will have to use the tag again but with a forward slash '/' in front of it. Like this </b>. As a general rule of thumb, you should always have an opening tag and a closing tag.

Once you're finished editing something, you click save changes and describe a summary(more on this below) and your edit will be saved to the wiki!

Making Edits

Wikis are such a fabulous tool for servers because they can be constantly edited and updated by the playerbase. Whenever you make a change/edit to any page it is documented in the view history tab at the top of the page. In there you can see who made the edit, when they made it, and what they said they edited. In addition, you can compare edits to see the changes between them and undo them.

Whenever you make an edit, you are required to do two things.

  1. Summarize your edit
  2. Declare the type of edit you're making


When summarizing your edit, keep it concise(in 1 sentence) and describe vaguely what you did. For example, if you add a bunch of items to a table, you can just specify "Added additional items to the (insert name here) table."

If your edit is purely to correct a small(within 50 characters) grammatical/phrasing/spelling issue then you should declare your edit as a Minor Edit "grammar fix" or "spellcheck" will suffice as a summary for these types of edits.

Comments

You are able to Comment out text inside the pages wikicode. This is great for letting other editors what to do/not do.

Comments should be used for:

  • Explaining Template Code
  • Warning users not to delete certain code
  • Explaining weird/uncommon syntax
  • Warning users not to add something because previous content of that type has been repeatedly reverted
  • Used to section areas of the code off when it gets messy

Comments should not be used to:

  • Leave funny/friendly messages or jokes
  • Temporarily remove sections to be re-added later (this is what user and draft pages are for)
  • Explain changes made

Text Formatting

Text by itself is extremely boring and often hard to read, so you can use text formatting to make your words really POP!

Format Type Usage Output
Bold Use this to bring attention to important text
<b>This text is bold!</b>
or
'''This text is bold'''
This text is bold!
Underline Use this to underscore important information or warnings
<u>This text is underlined!</u>
This text is underlined!
Italic Use this to enounciate certain words
<i>This text is italicized!</i>
or
''This text is italicized!''
This text is italicized!
Headings Use this to declare a section of your article and organize it
  • Level 1 Headings should not be used because it conflicts with the wiki page's HTML file
  • 4 or more headings causes the page to have a Table of Contents(TOC)
  • Headings must be at the start of a line and not border other text
===Level 3===

====Level 4====

=====Level 5=====

======Level 6 ======

Level 3

Level 4

Level 5
Level 6
Paragraphs You can designate sections of text as paragraphs which will for a linebreak before and after that section, you can also apply some more advanced formatting through Styles with it.
<p> This is a paragraph of text! </p>

This is a paragraph of text!

Bullet Lists This is how you create bullet lists
*Item 1
* Item 2
** Item 2.1
** Item 2.2
* Item 3
** Item 3.1
*:- Definition 
  • Item 2
    • Item 2.1
    • Item 2.2
  • Item 3
    • Item 3.1
    - Definition
Numbered Lists This is how you create numbered lists
#Item 1
# Item 2
## Item 2.1
## Item 2.2
# Item 3
## Item 3.1
  1. Item 1
  2. Item 2
    1. Item 2.1
    2. Item 2.2
  3. Item 3
    1. Item 3.1
Preformatted Text Use this to preformat text with a certain, this will alos allow you to write anything within the pre blocks without the wiki recognizing it as text formatting.
<pre>This text is preformatted to be the default font and style, <b>Things aren't bolded</b> or <i>Italicized</i>!!!</pre>
This text is preformatted to be the default font and style, <b>Things aren't bolded</b> or <i>Italicized</i>!!!
Comments Use this to leave important notes/messages to people editing the page. Comments do not show up when you view the wiki page and are only visible in the page editor.
 <!--This is a comment, to whoever is reading this -->
The Fitness Gram Pacer Test is a multi-stage aerobic exercise...

The Fitness Gram Pacer Test is a multi-stage aerobic exercise...

Nowiki The nowiki block makes it so that any formatting within the block is ignore and is instead displayed as regular text.
<nowiki><b>This is bold!<b> this is a burger: [[File:Burger.png]]</nowiki>
<b>This is bold!<b> this is a burger: [[File:Burger.png]]

Images

Images are extremely important for our wiki, without them people wouldn't know what icons/mobs would look like or get a visual representation of what they're supposed to do. Trying to include pictures in your articles can seem daunting at first, but it's super easy once you get a handle on it.

Usage and Formatting

In order to use an image you must utilize the [[File:]] synax.

For example, if you want to use Burger.png: Burger.png then you must specify [[File:Burger.png]]. This will make Burger.png appear wherever you declare this.

However, in order to make images useful to us, we need to format that in a way that is easy to understand and see. We can add parameters to our image by utilizing the '|' character. If you want your image to a certain size and make it link to another page you can specify it as [[File:Burger.png|64px|link=Space Law]]. There's a ton of parameters you can use but the most important ones are listed below.

Format Type Usage Output
Pixel Size You can declare how large you want your image to be in pixels. Generally, you want to stick with either the original size of the file, 64px, or 32px. Or else you may have lossy resizing.
[[File:Burger.png|128px]]
Burger.png
Image Alignment You can align an image like you align text. You have four options: left, right, center, and justified
[[File:Burger.png|right]]
Burger.png
Framing You can put an image in a bordered frame. However, this will not allow you to resize the image.
[[File:Burger.png|frame]]
Burger.png
Thumbnail You can put an object in a thumbnail which allows the image to be clicked and expanded. This allows you to resize an image while still having it be in a frame
[[File:Burger.png|thumb]]
Burger.png
Links You can make an image link to a page when it is clicked. You only need to include the page name/subsection and not the full link.
[[File:Burger.png|link=Space Law]]
Burger.png
Captions You can add a caption to a framed image or have a tooltip appear with that caption with non framed images.
[[File:Burger.png|Hello! this is my caption!]] and also [[File:Burger.png|Hello! this is my second caption!|frame]]
Hello! this is my caption!
Hello! this is my second caption!

Uploading

In order to upload an image, you must click on upload file in the left taskbar. Here you can upload lots of files(if they're supported) to the wiki.

General Rules about uploading:

  • Check to make sure your image doesn't already exist on the wiki
  • If your image already exists but you want a better resolution, upload a new version to that file
  • Try and upload sprites with the size 32px or 64px
  • Once you upload an image, it cannot be removed except by an admin
  • Give your images proper names
  • Make your images have a transparent background if applicable
  • Try to only use these formats: .png and .gif
  • Larger images such as File:General Destruction.png don't have to follow sizing guidelines because they're supposed to be large and high resolution

References

It is very important the articles link to each other so we have a web of information. In order to do this, we can reference articles and link keywords to those articles.

The most obvious way to do this is by typing [[Article Name]]

For example, you could link to Space Law by typing

[[Space Law]]

You can also link the article and change the link text. If you wanted to still link to space law but instead have the link be Legal Suggestions then you would have to use the syntax below. The two parameters for images is the Page Name and the Link Text --> [[Page Name|Link Text]]

[[Space Law|Legal Suggestions]]

Referencing Nuances

As a general note, you should always add spaces after references as it will include any characters that are next to it. So if you write [[Space Law]]textextext It will output as Space Lawtextextext.

If you wanted to do something like SMES's where you have characters directly next to the link then you would have to add the <nowiki /> tag to it --> [[SMES]]<nowiki />'s

If you want to link to an image rather than embedding it you will need to add a ':' colon before the name. For example, I can reference File:Burger.png without the image embedding itself by doing:

[[:File:Burger.png]]

If you want to link to something outside of the Main: Namespace (if you're not sure what a namespace is, go here, but for now all you need to know is that all general users will be reading are in the Main Namespace) you will have to specify which namespace the article is in before you link it.

For example if I wanted to link to my user page:User:Sirryan2002 I cannot just use [[Sirryan2002]] because it will automatically default to the main namespace -> [[Main:Sirryan2002]] which does not exist. I will have to instead specify which name space I'm searching in. For the user's name space I will specify User

[[User:Sirryan2002]]

Referencing Subsections

Sometimes you don't want to just link to an article, you want to link to a specific point in that article.

By adding a hashtag '#' to the end of a page name in your link you can specify where you want to go in that article. You can do this for any subsection in an article.

If I wanted to link this to Crime Codes References on the Space Law page. All I would have to do is specify it like so:

 [[Space Law#Crime Codes Quick Reference]]

If the area you're referencing is in the article where the link is you can shorten the syntax. For example if I was on the Space Law page and I wanted to link a certain word to a subsection/anchor all I would have to do is use a '#' and write the subsection name:

[[#Crime Codes Quick Reference]]

Anchors

An Anchor is a defined place within in a page that you can link people to. They work much like headings where you can link people to them:

[[Page Name#Anchor Name]].

Infact, all headings have anchors attached to them! On our wiki we have Template:Anchor which allows us to create anchors extremely easily. What you will need to do is find the area you want someone to be taken to and place the anchor directly next to it via

{{Anchor|Anchor_Name}}

If I wanted to create an anchor right -> here <- all I would have to do is this:

If I wanted to create an anchor right -> here{{Anchor|AnchorExampleSpot}} <-

now if you click on #AnchorExampleSpot it should take you directly to the anchor.

Tables

This is where wikicode starts getting a little more difficult and confusing.

A wikitable always has to be wrapped by curly brackets

{|
All the content goes here
|}

Below from left to right is Table Syntax, an example table in final form, and example code for a table.

Syntax What it does
{| Start a table - required
|} End a table - required
|+ Add a definition/title to the table
|- Starts a new row
! Creates a Header Cell
| creates a new cell
Header Cell Header Cell Header Cell
Header Cell Cell Cell
Header Cell Cell Cell
Header Cell Cell Cell
Header Cell Cell Cell
Header Cell Cell Cell
Header Cell Cell Cell
{|class="wikitable"
|- 
! Header Cell
! Header Cell
! Header Cell
|-
! Header Cell
| Cell
| Cell
|}

Table Classes

You should never go with the default table setup because it has no border or lines to break up cells. In order to give our tables fancy UI we have to declare what class it is.

We always do this at the beginning directly after the table start syntax The wikitable class gives our tables borders/outlines with grey backgrounds for header cells

Header Cell Header Cell Header Cell
Header Cell Cell Cell
{|class="wikitable"
|-
! Header Cell
! Header Cell
! Header Cell
|-
! Header Cell
| Cell
| Cell
|}


The mw-collapsible class makes it so you can collapse the table(have to include wikitable class)

Header Cell Header Cell Header Cell
Header Cell Cell Cell
{|class="wikitable mw-collapsible"
|-
! Header Cell
! Header Cell
! Header Cell
|-
! Header Cell
| Cell
| Cell
|}

The mw-collapsed starts a table with a mw-collapsible class in the collapsed state.

Header Cell Header Cell Header Cell
Header Cell Cell Cell
{|class="wikitable mw-collapsible mw-collapsed"
|-
! Header Cell
! Header Cell
! Header Cell
|-
! Header Cell
| Cell
| Cell
|}

The Sortable class allows you to make your columns sortable alphabetically, numerically, or by date. Additionally, by defining a row with class="unsortable" you can make it so that row isn't sortable.

Alphabetic Numeric Date Unsortable
d 20 2008-11-24 This
b 8 2004-03-01 column
a 6 1979-07-23 cannot
c 4.2 1492-12-08 be
e 0 1601-08-13 sorted.
{| class="wikitable sortable"
|-
! Alphabetic
! Numeric
! Date
! class="unsortable" | Unsortable
|-
| d || 20 || 2008-11-24 || This
|-
| b || 8 || 2004-03-01 || column
|-
| a || 6 || 1979-07-23 || cannot
|-
| c || 4.2 || 1492-12-08 || be
|-
| e || 0 || 1601-08-13 || sorted.
|}

Cell Size Formatting

You can define the size of a cell by using colspan and rowspan.

col1 col2 col3 col4
row1 A C
row2 AA BB CC
row3 AAA BBB CCC
row4 AAAA CCCC
{| class="wikitable" style="text-align: center;"
!col1
!col2
!col3
!col4
|-
!row1
| colspan="2" | A
|C
|-
!row2
|AA
|BB
|CC
|-
!row3
|AAA
| rowspan="2" | BBB
|CCC
|-
!row4
|AAAA
|CCCC
|}

Table Style

Without defining the style of your table, it will look rather barebones. Most pages on this wiki have a color theme to them so it's important to know how to do this.

Whenever you're defining the style (aka how it looks) of a table you will need to declare it using the style="" syntax.

However, what do you put inbetween those quotations marks? Well the answer isn't the same for all the style options you have with HTML. For example, if you want to make background color of the table CadetBlue you would have to do this:

{|class="wikitable" style="background-color:CadetBlue;" 
|- 
| Cell
| Cell
| Cell
|-
! Header Cell
| Cell
| Cell
|}

Notice how the there is a semi-colon ';' after it. You must use semicolons to separate each attribute you use and to end the string.

For more information on what attributes there are for styling go Here.

Depending on what you're trying to do, you can style different parts of a table. To style the entire table, your style will have to go directly after where you define the class of the table:

{|class="wikitable" style="text-align:justify;"
|-
| Cell
| Cell
| Cell
|-
! Header Cell
| Cell
| Cell
|}

To Style Individual Cells you will need to define the style of the cell and then use the '|' character after which you can then write the content that would go into the cell. Additionally, you can do this to header cells "!" in the sameway.

{|class="wikitable"
|-
! style="color:blue; text-weight:bold;" | This Header Cell is Styled!
| Cell
| Cell
|-
! Header Cell
| Cell
| style="text-align:left" | This Cell is also Styled!
|}

To Style Rows you will need to define the style after you declare the row with 'the |-' character

{|class="wikitable"
|-
| Cell
| Cell
| Cell
|- style="text-weight:bold;"
! Bold Header Cell
| Bold Cell
| bold Cell
|}

Span

Common Style Attributes

Color means any HTML Color name or hex value in this format -> #FFFFFF

Style can actually be applied to any tags (even <b>, <pre>, and <p>) however some attributes may not apply to that token. Any combination of these tags can be used to create the exact look you want so don't be afraid to mix and match.

Format Type Usage/Parameters Output
background-color:Color; Use this to set the background color
<div style="background-color:#CCFFCC;">Example Text 1 <br> Example Text 2</div>
Example Text 1
Example Text 2
color:Color; Use this to set text color
<div style="color:darkred;">Example Text 1 <br> Example Text 2 </div>
Example Text 1
Example Text 2
border: #px linetype Color; Use this to set the style of borders
<div style="border: 1px solid blue;">Example Text 1 <br> Example Text 2</div>
Example Text 1
Example Text 2
margin-{side}: #px;
or
margin: #px #px #px #px
Use this to set the margins for all four sides. It can be top, bottom, right, or left (in that order)
<div style="background-color:grey;margin-top:64px>Example Text 1 <br> Example Text 2</div>
or
<div style="background-color:grey;margin:12px 12px 15px 15px>Example Text 1 <br> Example Text 2</div>
Example Text 1
Example Text 2

or

Example Text 1
Example Text 2
padding-{side}: #px;
or
padding: #px #px #px #px
Use this to set the spacing between the border and its contents. It can be top, bottom, right, or left (in that order)
<div style="background-color:grey;padding-top:64px>Example Text 1 <br> Example Text 2</div>
or
<div style="background-color:grey;padding:12px 12px 15px 15px>Example Text 1 <br> Example Text 2</div>
Example Text 1
Example Text 2

or

Example Text 1
Example Text 2
font-size:#%; This sets the font size by percentage
<div style="font-size:%200;">Example Text 1 <br> Example Text 2</div>
Example Text 1
Example Text 2
text-align:{direction}; This aligns the text to a certain direction. The options are left, right, center, and justified.
<div style="text-align:right;">Example Text 1 <br> Example Text 2</div>
Example Text 1
Example Text 2
font-family:font This sets the font family, although you REALLY shouldn't use this on our wiki
<div style="font-family:impact;">Example Text 1 <br> Example Text 2</div>
Example Text 1
Example Text 2

Templates

There are many recursive UI elements we use in our wiki. For example, Template:Wip and Template:JobLaw are UI elements we use on multiple wiki pages. As a result of this we have to create something called a Template. It is premade code that you can enter parameters into to populate any element you want into an article simply by calling it. If you're familiar with coding, it's just like making a function with parameters and calling it when you need it.

Calling Templates

Disclaimer: It is important that you read the Template Documentation so you know what parameters it takes!

In order to call a template you must utilize double curly brackets: {{ and }} Inbetween those brackets you will need to put the name of the template.

For example, if I wanted to place a Work in Progress Template(see Template:Wip) over an article I'm working on I would call the template by its name in curly brackets. Additionally I've checked and seen that it takes one variable called assign. What I will need to now do is not only call the template but also give it parameter values. By using the '|'character to seperate the template name and parameters you can assign values to those variables.

{{Wip|assign=Sirryan2002}}
Sloth construction.png
Sloth construction.png
This article or section is a Work in Progress.
Assigned to:
Sirryan2002
Please discuss changes with assigned users. If no one is assigned, or if the user is inactive, feel free to edit.

While it would be easy to copy over the code from Template:Wip, this is a much faster, easier, and shorter method of doing that.

When you use the curly brackets it automatically defaults to the Template Namespace. You can actually use anything as a template, even other wiki pages. All you have to do is specify which Namespace and article name. As an example, I've copied over my user talk page User talk:Sirryan2002 into this collapsible block below only by using {{User talk:Sirryan2002}}

Example Article
Sirryan's Sick User Discussion Page

Every day we stray further from God

Who I am

User Id:Sirryan2002
I am an admin
IGN: Edgar Cook

Ia consultant.png

  • Internal Affairs Extrodinaire
  • The Wiki Caretaker
  • I Like Pizza and Hot Wings
To-Do
  • Add support for HotCat
  • Obtain the wiki admin privilege
  • Write a dark mode theme/skin for the wiki
  • Finish adding all Delta Location images
  • Add Meta Location Images
  • Add variable locations templates for Meta/Delta
  • Make the locations templates better
  • Make all template themes better
  • develop an extension for advanced location image interactions
  • Beret navy.png
  • Beret black.png
  • Beret red.png
  • MMI empty.png
  • Poison.png
  feel free to say anything you want  under here, I like when people leave me fun stuff to read


Like one sentence? - Cergosum 2021
Can I steal your template? Its very nice. - The Yeetster
Yes go ahead :) --Sirryan2002 (talk) 11:09, 12 April 2021 (EDT)








Major Crimes

All of these crimes are punishable by a sentence of 10 to 15 minutes at the discretion of Security.

Making Templates

Making a template is extremely easy and the difficulty only scales up with how fancy you want your template to be code-wise. All you need to do is create a page under the template namespace by typing in Template:INSERT NAME HERE into the search bar and clicking create page. After that, you can just write the code for it and call it later.

For example, if there was a large update to the codebase I may want to have a disclaimer over wiki pages that had just become outdated from such updates. I would first type Template:CodeDisclaimer into the search bar and create the page. I would put in my code:

 <div style="background-color:lightblue;text-weight:bold;width=500px;text-align:center;font-size:200%;border:4px solid black;"> Warning this article is out of date due to code updates!</div>

And then I could call it by using the syntax: {{CodeDisclaimer}} in another article

Warning this article is out of date due to code updates!

Variables

Variables are an integral part of customizable templates. If you do not know what a variable is, google it. In a bite-sized definition, it is a thing that you can store values in and recall later.

 For example
I could say that X = 10
X is a variable with a stored value of 10

On the wiki, we can define variables by using 3 curly brackets: {{{VARIABLE}}} Look at this example Template:MyDog to better understand how to use this

My {{{DogColor}}} dog is cute and fluffy!

In this template we've defined a variable DogColor and we can now call this template and give that variable a value to work with and see what happens.

{{MyDog|DogColor=Yellow}}

My Yellow dog is cute and fluffy!


If we go back to the practice template we just looked at we can use a variable to make it more customizable. I want my Template:CodeDisclaimer to have a date attached to it telling users when the code was updated. However, not all the wiki pages had code updated on the same day so I can't just write the date into the template. I can instead specify a variable that can be entered for that date like so:

 <div style="background-color:lightblue;text-weight:bold;width=500px;text-align:center;font-size:200%;border:4px solid black;"> Warning this article is out of date due to code updates as of {{{UpdateDate}}}!</div>

I can once again call this template and specify the date now {{CodeDisclaimer|UpdateDate=5/25/2020}}

Warning this article is out of date due to code updates as of 5/25/2020!




One other nifty thing we can do is add default values for our variables. Say someone used our CodeDisclaimer Template but didn't give it any variables, it would look something like this

Warning this article is out of date due to code updates as of {{{UpdateDate}}}

We don't want that, so we can utilize the '|' character again to add a default value to our variable like so:

 <div style="background-color:lightblue;text-weight:bold;width=500px;text-align:center;font-size:200%;border:4px solid black;"> Warning this article is out of date due to code updates as of {{{UpdateDate|(No Date Available)}}}!</div>

Now if someone called {{CodeDisclaimer}} it would default to this.

Warning this article is out of date due to code updates as of (No Date Available)!

Exclusion Tags and Documentation

Categories

In order to assign a wikipage to a category, all you need to do is add this to the bottom of the page:

 [[Category:Category name]] 

For example, I've assigned this article to Category:Guides by adding this to my page code:

[[Category:Guides]]

You can create a category by typing this into the search bar and creating "create page" which should be highlighted in red

 [[Category:Insert name here]]

Protected Pages

Some pages like Paradise's Main Page are what we call a Protected Page.

This means that only users with a certain level of user rights can edit that page. This is usually reserved for Game Admin, Headmins, maintainers etc.

The kind of pages that are protected tend to be SOP pages like Command SOP, Space Law, and templates that are used on protected pages like Template:LawModifiers.

Special Pages

Advanced Topics

Name Spaces

Magic Words

Parser Functions

Definitions