Beginner's guide to syntax

From Gamepedia Help Wiki
Jump to: navigation, search

Think of syntax as the backbone to your wiki pages. While the bulk of what you'll likely be doing is simply inputting text, without knowing proper syntax, your pages will be just that - text. Knowing wiki syntax will allow you to do basic things, such as add images, embed videos, link within the wiki and off the wiki, and so much more. Wiki syntax is a hybrid, so there are times when you'll be using HTML or CSS, and then there are times when you'll be using straight wiki markups. Knowing what to use when will save you a lot of editing and previewing time! Here is a list of basic markups that you'll encounter as a wiki editor.

Links[edit | edit source]

Linking externally: [https://gamepedia.com Gamepedia] will display as Gamepedia on your wiki. Use this any time you are linking to anything besides different pages within one wiki, including when linking to a page on a different wiki.

Linking internally: [[PageName]] or [[PageName|term displayed]] -- both serve the same purpose, but you may want to rename your link. For example, using the Help Wiki's Links page, we could say "check out the [[Links]] page" or "the Help Wiki has so many great resources to be aware of, should you need help [[Links|linking]] on your favorite wiki." Another way of internal linking is called a blended link. This is where you link to the page and, without spaces, add on to the word to extend it. If the Help Wiki's page was called "link" we would blend it by typing [[link]]ing to rename the link to linking. Remember, this only works when linking to pages within the same wiki.

Have you run into a red link on your favorite wiki? This doesn't mean that the wiki manager specifically changed the link color to red. You'll notice that if you mouse over the link, it will say the page title, followed by "page does not exist". If you click on the link, you'll be redirected to a blank editing page. See red links as an opportunity to contribute to your favorite wiki!

Formatting[edit | edit source]

Lists: To create a bulleted list, begin each line of your list with an asterisk (*) followed by a space before the item in your list you want. For a secondary bullet item in your list, add two asterisks (**) and so on. To create a numbered or ordered list, replace asterisks with the pound sign (#). That's hashtag for you TweetHeads out there. There is no limit to how many asterisks or pound signs you can add in for sublists, but keep in mind that going too crazy will create an issue with page structure.

Indentations: Indentations are similar to lists. They utilize the colon (:) and you can stack colons (::, :::, :::: and so on) to add in extra indentations or to create nested indentations. A line break (hitting the return key) will break your indentation. You'll need to manually enter in a colon if you want an intended line break that is also indented.

Headings: Headings are created by wrapping equals signs (=) around your title. Four or more headings will automatically create a table of contents at the top of your page. The page's title is already at the first header set, so you should only use 2 (==) through 6 (======). These coincide with their HTML counterparts, <h1> through <h6>. To make your page title <h2>, use == Page Title == as the correct syntax. You can create a nested table of contents, such as the one on the Help Wiki Images page, by having lesser headings under greater headings. For this page, h2s (==) have h3s (===) for subsections within the individual sections.

Formatted text: Formatting text includes many different things, but the most common ones you'll encounter will be bold, italics, quotes, code and no wiki markups. To italicize, use two apostrophes on either side of what you're italicizing (''example text''). To bold, use three apostrophes on either side ('''example text''). You can also bold and italicize something by using five apostrophes ('''''example text''''').

There will be times where you'll want to show the wiki markup, instead of what it does. This is called escaping. When this article is transfered over to the Help Wiki Highlights page, it will be necessary to escape the examples here so they are seen by anyone browsing this article. For short, highlighted portions, use the code tags (<code> and </code>), which will be displayed in the monospace font. If you prefer not to have your examples highlighted with the font changed, use <nowiki> and </nowiki> to escape the wiki formatting.

Lastly, quoting is also a commonly used form of formatted text. While you can change margins, the <blockquote> tags will give both left and right side indentation, which is ideal for using a larger piece of text as a pull out quote.

Images[edit | edit source]

Adding images: Adding images is a great way to expand a point or to beautify a wiki page. Learning how to be successful at adding images will make you an outstanding contributor. First, you need to upload your image to the wiki you're working on. There are two ways of doing this. You can use the "Upload file" link in the sidebar, as described on the Managing Files page, or you can upload directly from the page you are working on. We went into this in detail in the Adding Pages Highlights article. Long story short, you'll want to use the upsweeping green arrow icon, which will bring up the add files window to browse and select the file you want. After that, click on upload file. You can automatically insert the file after it's been uploaded, if that's you're preference.

Let's keep using Adding Pages as an example. The first image on the page has the following syntax: [[File:addpage1.png|center|600px]]. Since it is a link within the wiki, it is placed within a set of double brackets ([[). First, you'll need "File" exactly as is, followed by a colon. This is to let the wiki know that you want to call up a file. After the colon, you'll need your file name, which is addpage1.png for this example. The word "center" between the two pipes centers the image. Here, you can add other modifier options as well, separated by pipes. The other modifier shown here is the size, 600px. Another handy modifier is "thumbnail". Lastly, if you choose to add in a caption, that would go after the final pipe, before the closing set of double brackets. Keep in mind that when adding images, they scale down, but not up, there is an 8mb file size limit and the limiting image size is 5000 by 5000px.

Videos[edit | edit source]

Embedding videos: Embedding videos on Gamepedia wikis is possible because of the MediaWiki default extension, EmbedVideo. For this example, we'll be using the front page of the Help Wiki and the video in the "How To Video" block. If you look at the edit page, you'll notice that the syntax looks like this: {{#ev:youtube|EHYBCzXclFE}} -- to break this down, first, you call the parser function with #ev (which easily stands for embed video) and then a colon to introduce the service where the video is coming from. This example is from YouTube. Other popular video services are also available for embedding. For a full list, see the extension page from MediaWiki's site. The service name is followed by a pipe (|) and then the video's unique identifier. If you're not sure how to find the identifier, here is how. Go to the video's page (https://www.youtube.com/watch?v=EHYBCzXclFE in our example) and look at the url in the address bar. Everything after the equals sign (=) is the identifier for this video. Add this after the pipe. Everything goes in between two sets of curly brackets ({{).