Help:Editing
This page is intended to give you a quick overview of ModEnc's formatting options, so you can create better, prettier, more structurized, styleguide-adhering pages. Where possible, entries are linked to pages of MediaWiki's Editing Guide, where you can find much, much more on wiki code.
You can try out what you learned here in your very own Sandbox, located at User:Your_nick/Sandbox.
Formatting
Line breaks |
The MediaWiki engine sometimes behaves a little weird and ignores single line breaks; if you want to have a single line break, use <br> to force it. |
Italics | Italics are created by enclosing the desired text in two single quotes on each side - ''Test'' creates Test. |
Bold text | Bold text is created by enclosing the desired text in three single quotes on each side - '''Test''' creates Test. |
These two can also be combined. | |
Underlined text | Underlined text should not be used as text markup, as it automatically triggers the user to think it is a link. However, if necessary, it can be created by using Template:U - use {{u|text}} and replace "text" with your text. |
Logical applications for this are rare, since previous statements don't have to be preserved on-page, they are available in the page's history; nevertheless, striked out text can quickly be created by using Template:Strike - use {{strike|text}} and replace "text" with your text. | |
Teletyped text | Teletyped or monospaced text is used to denote .ini content on ModEnc, i.e. mainly flag or section names. It can easily be created using Template:Tt (use {{tt|text}} and replace "text" with your text), but please read the Styleguide's part on monospacing at least once beforehand. |
Text in small caps | Small caps can, just as everything else, easily be created by using Template:Sc - use {{sc|text}} and replace "text" with your text. |
Text, superscripted | Superscripted text can, just as everything else, easily be created by using Template:Sup - use {{sup|text}} and replace "text" with your text. |
Text, subscripted | Subscripted text can, just as everything else, easily be created by using Template:Sub - use {{sub|text}} and replace "text" with your text. |
Colorized Text | Of course you can also add color to your text; our colorisation template is twicefold: By using {{co|text|color}} and replacing "text" with your text and color with a color (name or html code), you create simple colored text. However, you have also the possibility to add a background color by adding a second color element: {{co|text|color|backgroundcolor}}. While colors can clarify certain situations a lot, be careful not to go overboard with them, and make sure they're readable and optically appealing - an entire page of light green text on a dark green background is just as bad as a page with yellow text on a pink background. ;) |
Quoted Text | If you quote text, if it's only a single person's quote, please create it using Template:Quote ({{quote|name|text}}, replace "name" the quoted's name and "text" with the quote), no matter if you like it's design or not (the text to the left is no example). This helps us keep the same markup for all quotes, and enables us to change all quotes' markup in an instant by changing the template. |
Templates use equal signs (=) to set values on parameters. They will fail if your text includes them. Replace all equal signs with = to circumvent this.
Basically, all formatting HTML works, including ps, divs, spans, etc. The templates above do nothing but enclose the data given to them in the defined html tags - e.g. all that {{sup|text}} does is create <sup>text</sup>. As such, if you are HTML savvy, you're not bound to these templates, and can even create new ones.
Organization
Indent
To indent text, begin the line with a colon (:);
:indent
creates
- indent
for example. You can also add multiple colons to indent deeper into the page.
Lists
Lists are created by starting lines with either * or # - * for bulleted, # for numbered lists. Multiple * or #s create another level within the list.
*Item One *Item Two **Item Three **Item Four *Item Five **Item Six ***Item Seven *Item Eight
results in
- Item One
- Item Two
- Item Three
- Item Four
- Item Five
- Item Six
- Item Seven
- Item Six
- Item Eight
for example.
Numbered lists work the same way:
#Item One #Item Two ##Item Three ##Item Four #Item Five ##Item Six ###Item Seven #Item Eight
results in
- Item One
- Item Two
- Item Three
- Item Four
- Item Five
- Item Six
- Item Seven
- Item Six
- Item Eight
for example.
Then there are definition lists, using the format ; Term to define : Term's definition:
; Term One : Defintion one ; Term Two : Defintion two ; Term Three : Defintion three ; Term Four : Defintion four ; Term Five : Defintion five
creates
- Term One
- Defintion one
- Term Two
- Defintion two
- Term Three
- Defintion three
- Term Four
- Defintion four
- Term Five
- Defintion five
for example.
All list types can be mixed. Help:List on the Meta Wiki
Tables
HTML tables work, yes, but there's also a simpler wikicode-way:
- {|
- ...for table start
- |
- ...for cells
- |-
- ...for a new row
- |}
- ...for table end
Example:
{| |cell one |cell two |- |cell three |cell four |}
cell one | cell two |
cell three | cell four |
The table, the rows, the cells and pretty much everything can be modified by HTML and CSS code, but we don't have the time and the room to go into that here. Continue reading at the Meta Wiki if you're interested in it.
If you want to create a table with background colors, borders etc., but aren't much of a coder, have a look at ModEnc:Tables.
Sorting and Collapsing
Any table can be made sortable by simply adding class="sortable"
to it. See Wikipedia for details. To make it collapsible, simple use class="collapsible"
instead. Combining both is possible, too. Tables support several collapsing options, described here.
Horizontal Lines
Simple horizontal lines can be created by adding ---- on its own line at the desired point in the page. The result looks like this:
Be careful with these lines, as they cut the page layout pretty harshly. First and second level section headers are almost always the better choice.
Collapsing DIVs
You will need to create three div
elements:
<div class="NavFrame"> <div class="NavHead">[... This is the title of your collapsible content ...]</div> <div class="NavContent"> [... The content you want to hide goes here ...] </div> </div>
[... The content you want to hide goes here ...]
To initially hide the content do this:
<div class="NavFrame"> <div class="NavHead">[... This is the title of the hidden content ...]</div> <div class="NavContent" style="display:none;"> [... This content is initially hidden ...] </div> </div>
Sections
Headers are there to structure your page, to tell the user what he's reading about, and, last but not least, to make up the TOC. This is also the reason why the examples for this section have been put on Help:Sections, as they would have shown up in, and confused this page's TOC. Section headers are generated by putting equal signs around the desired section name - =Section Name= would create a first level section named "Section Name". A section's level is apparent in its size and style, and in its position in the Table of Contents - the lower the level, the further indented to the right, and the smaller its numbering increase.
A section header is always on the same level as the other sections of its level:
=Section 1= ==Section 2== ===Section 3=== ===Section 4=== ==Section 5== ===Section 6=== =Section 7= ==Section 8==
In this example, Section 5 would be, both in terms of design and in the TOC, on the same level as Section 2 - because they're both second level sections. The TOC would look like this:
- 1. Section 1
- 1.1 Section 2
- 1.1.1 Section 3
- 1.1.2 Section 4
- 1.2 Section 5
- 1.2.1 Section 6
- 1.1 Section 2
- 2. Section 7
- 2.1 Section 8
Also note how the numbering happens in the example - an additional section always increases its level's part of the number, and all subsections belong to the closest higher-level section above them.
TOC
Unless you forcefully activate or deactivate the TOC, it is automatically generated and included when you have three or more sections, and placed above the first one. You can, however, influence its behavior with several "magic words":
__NOTOC__ | Disables the Table of Contents - useful if you do have three or four sections, but the page is still short enough that a TOC isn't necessary. Also useful the other way round, when you have dozens of sections, and the TOC itself is several pages long (happened on RockPatch Docs:Reference) - in such cases, creating a custom TOC using one of the templates might be the wiser option. |
__FORCETOC__ | The opposite to above - forces the TOC no matter how many sections you have. Useful if the page consists only of two sections, but the first one is large enough to push the second one way down. |
__TOC__ | This one is used to position the TOC, whatever created it. Can be used to place the TOC below a lead-in, and even to shift it vertically using tables or other codeblocks. A sidebar TOC, for example, is entirely possible. __TOC__ can be used multiple times, creating a TOC at every occurance in the code. If a TOC wasn't automatically created, __TOC__ creates it itself. |
Links
There are two major kinds of links: Internal links, which point to content on ModEnc and external links, pointing to content anywhere else.
Internal links are created by enclosing a word in brackets, like [[this]]. This will create a link to the ModEnc-page "This". If you want the link to point somewhere else, you have to create a piped link, called so because it employs the | pipe character for its function - basically, what you do is divide the link into two parts, the first one being the address to point at, the second one the text to display; so [[this|that]] would still link to "This", but diplay "that". The second part can include spaces and most other characters, so you can linkify entire sentences.
If you want to link to specific sections, follow the page name with a # hash symbol, and attach the section name to it; replace spaces with underscores and special characters with their code - you can get those from the target page's TOC. So [[Help:Editing#Images_and_other_Files]] would link to the section below. Of course you can, again, turn it into a piped link: [[Help:Editing#Images_and_other_Files|below]] would still link to the section below, but the link would look like this: below.
External links can be created similarly, but only using one pair of brackets - [http://www.modenc.renegadeprojects.com] would be an example. I'm saying "can" because typing out full URLs automatically turns them into links - http://www.modenc.renegadeprojects.com <-- that url has no special markup in the code. The difference is, while no markup simply turns the url into a link, bracketed links turn the url into a numbered link - like this: [1]. The advantage of bracketed links is, that, as with internal links, you can modify what they display. So while [http://www.modenc.renegadeprojects.com] just shows the number above, [http://www.modenc.renegadeprojects.com ModEnc] creates the same link, but called "ModEnc" - ModEnc. Notice how, since URLs don't include spaces, a space seperates the link and the text part, not a pipe. (If the url does include spaces in folder names, replace each space with "%20", like your browser is likely doing it.) Again, you can linkify entire sentences.
Dead links: There's a special feature regarding internal links: Internal links to pages that don't exist work just fine! They are displayed in red, and automatically link to the edit page of the non-existent page, so that a link-follower can immediately create it if it doesn't exist. As such, you are highly encouraged to link important words, no matter if the page exists or not - because that way, not only do people know what's missing and can create it easily, but the links are also already in place for the time when the page does exist. In addition, dead links are counted and create Special:Wantedpages, to show which pages are in high demand, but still missing.
Categories
Categories are a special case of internal links; creating a link to a page prefixed with Category: puts the page into that category, and adds a link to that category to the list at the bottom. So [[Category:This]] would not create a visible link to Category:This, but rather put the page into the Category "This". This even works if the category doesn't exist - the category link would display in red, leading to an edit-page, but pages would nevertheless already be collected in it, no matter if the page has text or not.
To link to a category, prefix the link with a colon : ([[:Category:This]]); to see already existing categories, visit ModEnc:Categories or Special:Categories - the first one is the official list, the second one is automatically created and unordered.
Again, you are highly encouraged to put pages into categories - it's easier to read for everybody if all pages on a topic are in the same category, rather than all just being standalone pages with no connection.
Internal links on the Meta Wiki
External links on the Meta Wiki
Categories on the Meta Wiki
Images and other Files
You can upload files to ModEnc through Special:Upload, a link that also appears in the menu on the left, in the toolbox. Uploaded files can be seen at Special:Imagelist as well as Special:Newimages.
To use them on a page, you have three possibilities:
[[Image:Image.ext]] | includes an image into the page |
[[Media:File.ext]] | links directly to the file on the webspace |
[[:Image:File.ext]] | links to the description page of the file |
Examples, using Warning.png: | |
[[Image:Warning.png]] | |
[[Media:Warning.png]] | Media:Warning.png |
[[:Image:Warning.png]] | Image:Warning.png |
The latter two support piped linkage, like usual internal links. The former does not, because there are special piped codewords that alter the display of the image:
Type | |
thumb | Surrounds the image with a frame and puts it, floating, on the right margin of the page; adds a "resize" link/button below it |
frame | Surrounds the image with a frame and puts it, floating, on the right margin of the page; ignores the "size" attribute |
Location | |
right | The image floats on the right, any text following it in the code to its left |
left | The image floats on the left, any text following it in the code to its right |
center | The image is centered, and any text following after it in the code will start below it |
none | The image floats on the left, and any text following after it in the code will start below it. This is Is useful for de-aligning and de-floating thumb'd and frame'd images, so you can use them in tables, for example |
Size | |
sizepx | You can resize the image by adding a specific width (in pixels) to it |
Caption | |
Text | Any non-keyword text you pipe after the filename will become the image's caption, if it's also framed or thumb'd |
All these attributes can -of course- also be used together.
[[Image:Warning.png|frame|Loooook! A caption!]]
[[Image:Warning.png|thumb|left|70px|I'm shrinking! I'm shrinking!]]
To end floating after an image, put {{clr}} at the position where the floating should end.
Raw code and wikicode
There are times when you don't want wikicode to be parsed or want to post blocks of raw code. In this case, you have the following options:
NoWiki
Wikicode placed between <nowiki> and </nowiki> does not get parsed.
Leading Spaces
If a line begins with a space (or each line in a block), its formatting in the sense of spaces, line breaks and similar is preserved, while wikicode and HTML still get parsed. The block is marked up as a code block. This is useful if you want to post a block of code and want to mark parts of it.
Example:
code dlvp aslso [[Main Page]] dgkgkg flaj ''testtest'' '''boooooold''' more lines <small>text</small> and more
gives:
code dlvp aslso Main Page dgkgkg flaj testtest boooooold more lines text and more
<pre>
<pre> is similar to leading spaces, with the difference being that wikicode or HTML are not parsed. As such, it's the best way to display chunks of wikicode. (It is, for that matter, exactly the method used to create all codeblocks on this page - the only exception being the one leading spaces code block above.)
Example:
<pre> code dlvp aslso [[Main Page]] dgkgkg flaj ''testtest'' '''boooooold''' more lines <small>text</small> and more </pre>
gives:
code dlvp aslso [[Main Page]] dgkgkg flaj ''testtest'' '''boooooold''' more lines <small>text</small> and more
Templates and Includes
Templates are pre-defined pages you can easily include in the normal content pages by surrounding its name (without the Template: prefix) in a two pairs of curly brackets. If a page is called Template:Name, for example, you would include it using {{Name}}.
Simple templates can be used to include standardized messages, messages which automatically categorize pages or content-blocks.
In addition, templates can be fed with parameters, added after pipes. A simple example would be {{Name|Parameter}}. Since the parameters differ from template to template, it's hard to give a general guide, but each template's page includes detailed usage instructions.
To see a list of all templates on ModEnc, visit ModEnc:Templates, to find out more about templates, visit Help:Template on the Meta Wiki.
The same way you include templates, you can include pages of other namespaces...just make sure the namespace is included - {{ModEnc:IRC}} would, for example, includeModEnc:IRC. If you want to include a page from the main namespace, simply prefix the page name with only a colon: {{:LandTargeting}} includes LandTargeting, for example.
There are two additional tags controlling what's getting included and what's not - <includeonly> and <noinclude>. Everything between <includeonly> and </includeonly> appears on the page only when the page gets included. <noinclude> does the opposite, meaning everything between <noinclude> and </noinclude> does not appear when the page is included somewhere. The practical applications of these tags mainly lie in templating, where you would have the main code of the template as usual, a category link in <includeonly> tags (so the tamplate page itself isn't in the category), and the usage instructions in <noinclude> tags (so only the template and the category gets included, not the "how to" part).
Info for advanced users: Using this tags, it is entirely possible to create a page in itself with different content. This was used, for example, on the old RockPatch Docs page - the framework was saved as <noinclude>, while the list of tutorials was saved as <includeonly> - the page then included itself in the list part, and used Template:SideBar with itself as a parameter, to create the sidebar.
Namespaces and Subpages
By the time you reach this point, you should know most namespaces we currently have:
- The unnamed, main namespace, where most content-pages lie
- Building
- A namespace for building-description pages
- Category
- Where the categories are in
- Factions
- For content relating to Factions and its creation
- Help
- The help namespace, where you're in right now
- Image
- Where images and other files' description pages are saved
- ModEnc
- Organizational namespace, where most non-modding pages reside
- RockPatch
- Where content related to pd's RockPatch is saved
- RockPatch Docs
- Where its helpfiles reside
- Special
- Where automatically generated pages, system tools and similar pages lie.
- Template
- Where the templates are saved
- Unit
- A namespace for unit-description pages
- User
- Where registered users' pages can be stored
- Super weapon
- A namespace for super weapon-description pages
- XCC
- Extended Command & Conquer, namespace for Olaf's tools
- OS
- Open Source, namespace for PPM-produced tools
- ETS
- Extended Tiberian Sun Engine, C&CVK's exe-expansion project for Tiberian Sun
Namespaces are a special tool for organizing pages, as they allow users to only search through specific ranges of pages. With the addition of the RockPatch namespace, for example, it is fairly easy to both only display RockPatch pages on All Pages, and to do a text search only through RockPatch pages.
Including a colon in a page name does not automatically create a new namespace. This has to be done manually in the configuration files. However, we will be more than happy to create new namespaces if you have reasonable suggestions for them. For example, we'd be happy to create specific namespaces for pages of other mods or tools, if we can be sure they'll be used widely. An XCC namespace, containing pages like XCC:Mixer or XCC:Mod Creator are absolutely possible, just as a DeeZire namespace would be. There just needs to be somebody maintaining them.
And the best thing is: Old pages get converted automatically. So if you create XCC:Mixer and XCC:Mod Creator today, and next week we create an XCC namespace, your pages are automatically part of it - no further action required.
Subpages
Subpages are like the "little brothers" of namespaces. If you include a slash (/) in a page name, the part after the slash is automatically the name of a subpage of the the page before the slash, and includes a link back to the main page at the top. This technique is most prominently employed on RockPatch's wishlist, where pages 2 and onwards are all subpages of RockPatch:Wishlist. Going from this example, one use is obvious: Divide a long page in several pages. However, it hides another use for normal users: The chance to create a de facto namespace for pages, without needing administrative powers. Many of the RockPatch and RockPatch Docs pages, for example, originally started out as subpages of the pages RockPatch and RockPatch Docs. You could, for example, create a main description page at Your Mod, add Your Mod/Story, Your Mod/Units, Your Mod/Super Weapons, and so on. If the page grows big enough, we'll probably convert it into a namespace. (That is not to say that pages need to exist to create a namespace - it's a question of faith. If the pages are there, we can be sure to have a functional namespace, and will do the conversion with no questions asked. If there are no pages yet, you need to convince us they will come before we add a new namespace.)
Talk Pages
For every namespace, there's an additional talk namespace. To every page, its namesake in its namespace's talk namespace is connected. For example, Main Page is connected to Talk:Main Page, Help:Editing is connected to Help talk:Editing and so on. Talk pages are the place to discuss their respective content pages, be it to discuss or suggest changes, to question available information, or anything else relating to that page. And if the talk pages don't suffice, you can still meet on IRC. ;)
Talk pages do not differ from normal pages in terms of editing. As such, they can also have subpages, which is useful if certain discussions turn heated and gain length - Talk:TibEd/Does this tool suck? would be entirely possible, for example.
You can access a page's talk page by clicking on "discussion" at the top of the page. When adding something to a talk page, it's best to sign your comments. Use three tildes ~~~ to sign with your Nickname, and four tildes ~~~~ to sign with your nickname and date.
User Pages
Your user page is, if you are a registered user, at User:Your_Name. Examples would be User:Renegade or User:DCoder. You are relatively free in what you put on it, as long as you you adhere the usual rules - no illegal stuff, no obscenities, etc. Some of us use it to store a short profile of them, others have their to do list on it - whatever makes you happy. Just don't edit someone else's user page without their consent. (Not that'd have much use...they can just revert the edits if they don't like it.)
User pages can also have subpages, allowing you to create your own little set of distinct pages. Talk pages of user pages are somewhat special, as, if somebody edited your talk page, the message "You have new messages" will be displayed on all pages until you visited your talk page.
See also
- ModEnc:Styleguide - lays down some basic conventions for formatting, spelling etc.
- ModEnc:Templates - list of templates available
- ModEnc:Tables
- MediaWiki Editing Guide - everything you want to know about wiki code