Help:Editing

From Nexus Mods Wiki
Revision as of 00:57, 16 November 2018 by Dubiousintent (talk | contribs) (change category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

Nexus Wiki is based on MediaWiki.org software. MediaWiki supports a combination of standard HTML markup tags and custom operators to simplify the creation of content. It also permits site operators to customize their own processes and operators.

Wherever possible, reference the official sources. The purpose of this page is to facilitate locating the desired help material.

Any material external to this page referenced within the text body should also be listed in the References section, to make it easier to find again later.

MediaWiki Help

The following MediaWiki site "Help:" files should answer your most common editing questions.

Common Issues and HTML Codes

HTML tags consist of pairs of words within brackets (MediaWiki uses '<angle brackets>'), delimiting a block of content to be displayed in a particular way. The opening tag of a tagged block consists of a key word, and the closing tag consists of the same key word prefixed with a slash ('/') character, i.e. 'spoiler' and '/spoiler' (here minus the '<angle brackets>'). Most opening tags must be at the beginning of a line to be recognized, though there can be specific exceptions. The closing tag can be either at the end of the last line of the block or at the beginning of a new line after the block. They are commonly referred to as 'key word' tags. Not all HTML tags are recognized by the Wiki. See the Help:Formatting link.

Note that not all MediaWiki HTML formatting codes appear to be implemented on the Nexus Wiki as described. Experimentation may be required.

  • The use of Headers (see Help:Formatting) will automatically cause the creation of a Table of Contents (ToC) at the top of the page. However this requires the use of at least 4 header and/or sub-header entries, or the ToC is not displayed.
  • Spaces between a tag or HTML keyword and the <angle brackets> make the tag unrecognized. This is an easy way to document HTML tags without having to 'escape' them with < nowiki > tags. However, the use of spaces to explain tags requires explanation to those unfamiliar with markup language requirements.
  • Showing tags in documentation can be simply accomplished with the use of some HTML symbol substitution trickery.
"&lt;" is replaced with the left angle bracket or "left-tag" character ("<") when the page is displayed.
[Use of "& amp ;" (without the spaces) produces "&" without letting the remainder of the symbol be interpreted here for documentation. Ordinarily you would just use the "&" symbol itself.]
This means you can write "<strike>this is struck out text</strike>" and actually see the tag in the text without only seeing it taking effect (i.e. this is struck out text) when the page is displayed. The symbol substitution prevents the tag from being correctly interpreted, but not from displaying properly.
  • Tags:
 <nowiki>: Note the leading space at the beginning of the line for this tag is required.


 < nowiki >, < /nowiki >: Marks a block in which the HTML markup tags are not processed or 
interpreted.

 <<nowiki />pre>: The '<<nowiki />' syntax disables the HTML markup of the <pre> tag of the 
single line it appears on.  Note the number of left and right <angle brackets> must match.
* Typically it's used to show the tag itself in a line entry.  
* Any wiki tag keyword could take the place of 'pre' in this example, i.e. in the HTML code 
of the keyword 'nowiki' in the markup line about the 'leading space requirement' in this 
section.
* Note also that lines in < nowiki > blocks do not wrap.

 < br >: Tag is used to code a 'hard line break' where a blank line is not sufficient.
 
 'Line breaks' within a < pre > block will create separate bordered blocks.
 
 Use a 'space' character instead of creating a 'newline' or 'hard line break' if you want to separate 
 lines without breaking up your < pre > tagged block of text.  

 < code > ... < /code >: These tags cannot be nested inside a 'nowiki' tag.  
This tag appears to be bugged at the moment, in that it does not wrap long lines as described.
It should be similar to the 'nowiki' tag, but dynamically handle word wrapping to screen width.
A method to simulate this functionality is presented later in this article.



Example of 'code' tag bug:

This long sentence is used to demonstrate text wrapping. This additional sentence makes the first line text even longer. These additional lines are not intended to be and should not concatenate with the first line.

Instead, the text is erroneously concatenated and appears outside of the box it is supposed to be displayed within.
The box is not displayed unless there is a leading space beginning each line within the 'code' tags.




The following lines (note the different background color) are all presented within proper 'code' tags:
This shows the proper syntax for implementing 'code' tags so the code appears within a box: by indentation of the content. (There should be no spaces between <angle brackets> and the 'tag' word, or before the tags)

< code > 
  This long sentence is used to demonstrate text wrapping. This additional sentence makes the text even longer, and will NOT wrap at the end of the box.
  This second line should not concatenate with the first line.
  Note that only the text which is indented appears in the box and does NOT concatenate or wrap.
< /code >

Also note that (non-indented) sentences appear outside the code box, even though they are within proper 'code' tags, and they will wrap at the edge of the browser window.

  This can be considered a 'feature'.

New boxes are formed around any cluster of indented lines, all within the same single set of 'code' tags.
The closing 'code' tag appears above this line. 'Code' tags can be concatenated with other lines, or appear on their own lines. Use of 'br' tags may be necessary to prevent unwanted concatenation.

Templates

The term 'template' is used in two ways: 1) in the sense of a "generic model" or "pattern", what some might call "boilerplate"; and 2) as content from one document that is "included" in another document, often called "an include file" in programming circles.

'Include Templates' are useful when you want the exact same thing to appear on multiple article pages. They are created like any other article, but with the name prefixed with 'Template:', as in 'Template:Legal Disclaimer'. The entire 'include template article' (or only that portion within 'includeonly' tags) will be automatically included in your article page where you place the template name (without the prefix 'Template:') within double {curly braces}; as in just below the 'Legal Notice' header in this example:

==Legal Notice==
{{Legal Disclaimer}}

See the Help:Templates article in 'MediaWiki Help' section, above.



Mini Style Templates

The disadvantage of templates is that they require more advanced coding skills to customize them to display different information for individual pages. Recall that the exact same template will appear on each page including it. Sometimes it is easier to simply 'copy-and-paste' the necessary common HTML code and customize that. Here we call such code snippets 'mini style templates'.

The following are copied from the the 'Oblivion Mod Wiki Tutorials' page and adapted. They are used to place message notices that stand out from the regular text on Wiki pages. The message content should be re-worded as needed.

Simply copy the HTML code from the upper box as displayed on this page (no need to edit it here) to your page, and edit there as required. It will display as shown by the 'produces:' box below.



Template Notice

Should only appear on "templates", to warn against unintentionally modifying them. Once the template is copied to a new page, this notice should be replaced with something like the "WIP" or "Development" notice.

The message can be anything of a cautionary nature. Refer to it as an example for other Warning Notices.

Note that a "Category:Templates" page will automatically list all articles that include templates among it's list of articles, even though those articles do not explicitly have that category entry.

See also the 'Sub-Category Notice'.

<div name="Template Notice" class="boilerplate metadata" id="Warning Notice" 
style="margin:0px 10px 10px 10px;border:1px solid #cc3333;color: red;
background-color:#fff5f5;padding:3px; 
/* Remove the next four 'white-space' lines to restore default white-space processing. */
white-space: pre-wrap;       /* css-3 */
white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
white-space: -pre-wrap;      /* Opera 4-6 */
white-space: -o-pre-wrap;    /* Opera 7+ */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''This is a template. Do not make any changes to this page.'''

Instead, copy the contents below to a new page, and replace anything within 
{curly braces} with your own appropriate material.

Remove this message from your new page copy only.
</div>

produces:



Sub-Category Page Notice

A generic notice placed on Category pages.

Note that a "Category:Templates" page will automatically list all articles that include templates among it's list of articles, even though those articles do not explicitly have that category entry.

<div name="Category Page Notice" class="boilerplate metadata" id="Notice Box" 
style="margin:0px 10px 10px 10px;border:1px solid #00C600;color: green;
background-color:#fff5f5;padding:3px;
/* Remove the next four 'white-space' lines to restore default white-space processing. */
white-space: pre-wrap;       /* css-3 */
white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
white-space: -pre-wrap;      /* Opera 4-6 */
white-space: -o-pre-wrap;    /* Opera 7+ */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
:: '''This is a Sub-Category Page.'''
: Articles and files related to the title subject appear here by placing this category name (''the title of the page, i.e.'' '''Category:< sub-category name >''') at the bottom of their Wiki pages.  All < Game > wiki pages should always include '''Category:< Game >''' as the parent umbrella for everything related to the game.

: Do not attempt to add anything directly to this page.
</div>

produces:



Work In Progress Mod Notice

Typically this message box replaces the Template Warning box on a new placeholder that does not immediately have it's subject material. The message can be anything of a cautionary nature about a WIP Mod or Topic in an incomplete state. Generally this will be replaced by a "Development Notice" when the current page is complete to current knowledge, but it is known that more material needs to be 'developed'.

<div name="WIP Notice" class="boilerplate metadata" id="Missing Links" 
style="color: red;background-color: #fdd; margin: 0 1em; padding: 0 10px; 
border: 1px solid #aaa;
/* Remove the next four 'white-space' lines to restore default white-space processing. */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''This is a Work In Progress (WIP), and not yet complete.'''

Not all elements of the content have been posted as yet.  While the available elements should be functional, other elements are needed to achieve the end-result as described.

This message will be removed when the content is complete.
</div>

produces:



Development Notice

This "Under Development" notice is used when the page is "complete" as to current knowledge, but it is known there is more required. Generally replaces the "WIP" notice.

<div name="Development Box" class="boilerplate metadata" id="Development Box" 
style="margin:0px 10px 10px 10px;border:1px solid #00C600;color: green;
background-color:#fff5f5;padding:3px;white-space: pre-wrap; 
white-space: -moz-pre-wrap; 
white-space: -pre-wrap; 
white-space: -o-pre-wrap; 
word-wrap: break-word;">
'''This article is under development.'''

Contributors may want to consider writing their material in '''OpenOffice''' with the ''Sun Wiki Publisher'' extension, which enables you to create Wiki articles on '''MediaWiki''' servers without having to know the syntax of the '''MediaWiki''' markup language. All important text attributes such as headings, hyperlinks, lists and simple tables are supported. Even images are supported as long as they have already been uploaded to the wiki site. An automatic upload of images is currently not supported. It is the perfect extension for all users who want to make existing documentations and specifications available on '''MediaWiki''' servers. Just load the document and call the Extension with 'Send – MediaWiki Server'. A dialog will guide you to publish your document.

Remove this message when the article is complete.
</div>


produces:



Missing Links Notice

Missing or Dead links are know to exist.

<div name="Missing Links Notice" class="boilerplate metadata" id="Missing Links" 
style="color: red;background-color: #fdd; margin: 0 1em; padding: 0 10px; 
border: 1px solid #aaa;
/* Remove the next four 'white-space' lines to restore default white-space processing. */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''This page has a dead or missing link.'''

This page has at least one dead or missing link that needs replacing.  If you have 
access to a working link, it would be highly appreciated if you could replace the 
dead link above with the working one that you've got.
</div>

produces:



Rewrite Notice

Notifies that the page needs rewriting to standards or because it is unorganized, outdated, incorrect, verbose, etc.

<div name="Rewrite Notice" class="boilerplate metadata" id="Rewrite Notice" 
style="margin:0px 10px 10px 10px;border:1px solid #cc3333;color: red;
background-color:#fff5f5;padding:3px;
/* Remove the next four 'white-space' lines to restore default white-space processing. */
white-space: pre-wrap;       /* css-3 */
white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
white-space: -pre-wrap;      /* Opera 4-6 */
white-space: -o-pre-wrap;    /* Opera 7+ */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''This page is in need of a rewrite.'''  

{ Please replace this statement (the one in curly braces) with statements in 
what way this needs improvement. }
</div>

produces:



Discontinued Notice

The page or category is discontinued and will eventually be deleted or recycled.

<div name="Discontinued Notice" class="boilerplate metadata" id="Discontinued Notice" 
style="margin:0px 10px 10px 10px;border:1px solid #cc3333;
background-color:light red;padding:3px;
/* Remove the next four 'white-space' lines to restore default white-space processing. */
white-space: pre-wrap;       /* css-3 */
white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
white-space: -pre-wrap;      /* Opera 4-6 */
white-space: -o-pre-wrap;    /* Opera 7+ */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''This category page is discontinued.'''  

Please use '''''Category:<some name, i.e. Tutorials - XCOM:EU 2012>''''' instead.
</div>

produces:



Note Box

The message can be anything of an informative nature, such as to set something off from the rest of the material.

<div name="Note Box" class="boilerplate metadata" id="Notice Box" 
style="margin:0px 10px 10px 10px;border:1px solid #00C600;color: green;
background-color:#fff5f5;padding:3px;
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''This is a note conveying important information.'''
Replace with your own appropriate material.

The following line is optional, illustrating an 'in-line style change'. For example: It's useful when <strike>striking out</strike> other content in the same note box:<br>
<p style="text-align: center; color: red; background-color:#fff5f5;">
MAINTAINERS: This information is still accurate, and should be retained for reference.</p>
</div>

produces:


For a box limited to the text length within the tags, use '< span >' instead of '< div >': Only this text is boxed.
You can increase the 3rd "margin: #px" parameter to indent. For example: "margin: 0px 10px 100px" is equivalent to using "::::" for indenting. Every ":" is roughly 25px.

The above box on the end of the sentence uses syntax similar to the following, but with typical "margin: 0px 10px 10px" parameters so it merely appends to the line.

The following illustrates a '< span >' box with indentation:

<span style="margin:0px 10px 10px 100px;border:1px solid #00C600;color: green;
background-color:#fff5f5;padding:3px;
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''This is a similar note conveying important information.'''  Replace with your own appropriate material of whatever length desired.  This line is deliberately made wordy and long to illustrate the result.  This repeated sentence is deliberately made wordy and long to illustrate the word-wrapping.<br>
As can be seen, multiple lines can be forced with '< br >' tags without problem.
</span>

which produces:

This is a similar note conveying important information. Replace with your own appropriate material of whatever length desired. This line is deliberately made wordy and long to illustrate the result. This repeated sentence is deliberately made wordy and long to illustrate the word-wrapping.
As can be seen, multiple lines can be forced with '< br >' tags without problem.


Word Wrap Box

A simple box that will preserve white-space and wrap text lines at the border. It may be useful for grouping specific related content like descriptions of tools or mod files. Anything indented will appear within a sub-box that does NOT wrap at the display box border.

<div name="Simulated code box" class="boilerplate metadata" id="Warning Notice" 
style="margin:0px 10px 10px 10px; border:1px solid #cc3333; color: green;
background-color:#fff5f5;padding:3px; 
/* Remove the next four 'white-space' lines to restore default white-space processing. */
white-space: pre-wrap;       /* css-3 */
white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
white-space: -pre-wrap;      /* Opera 4-6 */
white-space: -o-pre-wrap;    /* Opera 7+ */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
">
'''Place long line content here.'''  

Anything indented will appear within a sub-box that does NOT wrap at the display box border.
</div>

produces something like the following example (different content):

Substitute the following for the "style=" elements in the above "div" tag if you want the 'word-wrap box' to duplicate the border and colors of a 'code box', like so:

style="margin:0px 10px 10px 10px; border:1px dashed #DAA520; color: lightgray; background-color:#424242; padding:3px;"



Embedding Code within Numbered Lists

Often you want to put some code in the middle of a numbered list. Normally this will cause the list numbering to be reset to "1" on the next line, which is not desired. For example:

# List item 1.
# List item 2, followed by:
<code>
  some code line 1
  some code line 2
</code>
# List item 3.

gets displayed as:

  1. List item 1.
  2. List item 2, followed by:

some code line 1
some code line 2

  1. List item 3.

Note the third list item has been reset to list number "1" instead of the desired "3".

A "workaround" to this problem is the use the "pre" tags instead of "code" tags. Example:

  1. List item 1.
  2. List item 2, followed:
    <pre>
    #::some code line 1
    #::some more stuff</pre>
  3. List item 3.

(where "#::" is an indented continuation of the line numbering)

which gets displayed as:

  1. List item 1.
  2. List item 2, followed:
    some code line 1
    some more stuff
  3. List item 3.

The disadvantage to this technique of "pre" tags is that the code gets indented more than with the use of the "code" box tag.

'Line breaks' within a < pre > block can create separate bordered blocks. Use a 'space' character (represented by HTML symbol tag "&nbsp") instead of creating a 'newline' or 'hard line break' if you want to separate lines without breaking up your < pre > tagged block of text. However, these will terminate your list numbering, unless they are part of the list continuation code, such as:

  1. List item 1.
  2. List item 2, followed:
    <pre>
    #::some code line 1
    #::<&nbsp>
    #::some more code stuff</pre>
  3. List item 3.

which gets displayed as:

  1. List item 1.
  2. List item 2, followed:
    some code line 1
    some more stuff
  3. List item 3.


The other proper way would be to use pure HTML "list" mark up. Example:

<ol>
<li>one</li>
<li>two</li>
<pre>some stuff
some more stuff</pre>
<li>three</li>
</ol>

gets displayed as:

  1. one
  2. two
  3. some stuff
    some more stuff
  4. three

The advantage of using HTML mark up is the "code" indentation is lined up with the list numbering.

Table

A Wiki Table can have a number of embellishments. See the Help:Tables for assistance. The basics only are provided here.

{| class="wikitable" style="text-align: left; color: green; background-color:#ffffcc;" cellpadding="10"
|+ '''Sample 2x4 Table'''
! HEADER Column 1 !! Column 2 HEADER
|-
| '''HEADER''' Column 1 as Data || Column 2 '''HEADER''' as Data
|-
| R1C1 Item || R1C2 Item
|- align="center"
| R2C1 Item || R2C2 Item
|- align="right"
| R3C1 Item || R3C2 Item
|-
| R4C1 Item || R4C2 Item
|}

produces:

Sample 2x4 Table
HEADER Column 1 Column 2 HEADER
HEADER Column 1 as Data Column 2 HEADER as Data
R1C1 Item R1C2 Item
R2C1 Item R2C2 Item
R3C1 Item R3C2 Item
R4C1 Item R4C2 Item




References

Referred to by this article:


That refer to this article:

  • Editing help link on the wiki 'edit' page.