Help:Editing: Difference between revisions
mNo edit summary |
mNo edit summary |
||
(19 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOEDITSECTION__ | |||
[[Category: Pyrkilo help]] | |||
'''Guide to editing in MediaWiki. Recently asked questions | |||
; How do I link to pages in other wikis?: You can use shorcuts instead of full URLs. The following shortcuts are in operation: <nowiki>[[:en:To English Wikipedia|]] (goes to a page named "To English Wikipedia" in English Wikipedia) [[:fi:To Finnish Wikipedia|]] [[:op_en:To English Opasnet|]] [[:op_fi:To Finnish Opasnet|]] [[:heande:To protected Heande wiki|]]</nowiki>. Also other shortcut links work to project wikis of Intarese, Beneris etc., but those wikis are being merged with Heande soon, so the usage of these shortcut links is not recommended although they should work even after the merge. The bar (|) at the end of the link hides the first part of the link (e.g. :op_en:), showing only the page name. | |||
<nowiki> | |||
| | |||
; How to make nice-looking tables?: The easiest way is to use <nowiki>{{prettytable}}</nowiki> template in the first row of table definition. | |||
; Should Rich editor be used?: Rich editor makes many features look more user-friendly during editin. However, it has two major drawbacks, and therefore we discourage its use: | |||
:* Many buttons designed for Opasnet (e.g. about discussions) don't show up. | |||
:* Rich editor adds some code into the text although the user does not want it, e.g. <nowiki><br></nowiki> tags. | |||
: | |||
: | |||
: | |||
== Introduction == | == Introduction == | ||
Line 145: | Line 40: | ||
=== Starting a new page === | === Starting a new page === | ||
There are | There are several alternative ways to create new articles (wikipages) in MediaWiki. (The result will be the same regardless of the method.) | ||
==== Creating a new article using the sidebar tool ==== | |||
The recommended way to create a new page is to use the [[Create article|Create articles]] tool on the left sidebar. It will lead you to a page where you can select a page type. Write the name of your page in the appropriate box and click "Create variable" (or whatever page type you are creating). | |||
In this way, you will get a pre-filled page with the default subheadings, instructions, and other useful stuff. | |||
==== Creating a new article through the search-box method ==== | ==== Creating a new article through the search-box method ==== | ||
Line 161: | Line 57: | ||
For more information on linking, see the "linking" section below. | For more information on linking, see the "linking" section below. | ||
==== Creating a new article through the address-bar method ==== | |||
Type the name of the article to the browser's address bar after '''index.php?title=''' <BR> | |||
For example, index.php?title='''Name of your new article''' | |||
However, this way is NOT recommended because typically the web browser uses a simplified version of the address which does not show "index.php" at all. | |||
For further information about starting a new page, please see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page]. | For further information about starting a new page, please see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page]. | ||
=== Naming a new article - basic guidelines === | === Naming a new article - basic guidelines === | ||
Line 178: | Line 79: | ||
For more information about naming, please see [http://meta.wikimedia.org/wiki/Help:Page_name]. | For more information about naming, please see [http://meta.wikimedia.org/wiki/Help:Page_name]. | ||
=== Editing basics === | === Editing basics === | ||
To start editing, simply click the '''edit''' link at the top of the page. This opens the '''edit''' page, which looks like this: | |||
To start editing, simply click the '''edit''' link at the top of the page. This opens the '''edit''' page | |||
[[File:Help_editing_view.png|800px]] | |||
In the "edit" page, simply type in your text. Alternatively, copy and paste text from another source (for example Word). | In the "edit" page, simply type in your text. Alternatively, copy and paste text from another source (for example Word). | ||
There are also multiple different ways to format the text you have. The buttons shown in the image with numbers next to them help with that. | |||
# Bold. See more [[Help:Editing#Bold text|below]]. | |||
# Italic. See more [[Help:Editing#Italic text|below]]. | |||
# Signature. This brings <nowiki>--~~~~</nowiki> to the page. When saving the page, this is replaced by your user name and the time of the same. It can be used when leaving comments or in a [[Discussion|discussion]] | |||
# Creates a link. See more [[Help:Editing#Linking|below]]. | |||
# Creates a link to an already uploaded file. See more about files [[Help:Editing#Using images and files|below]]. | |||
# Helps you create a reference. See more [[Help:Editing#Reference lists|below]]. | |||
# Creates a direct link to a file instead of to the file page. See more about files [[Help:Editing#Using images and files|below]]. | |||
# Uploads a file. See more about uploading files [[Help:Editing#Uploading|below]]. | |||
# Creates a heading. See more [[Help:Editing#Sections|below]]. | |||
# Creates a bulleted list. If choose a section of your text and then click this, a bullet point will appear in the beginning of every line. See more [[Help:Editing#Basic lists|below]]. | |||
# Creates a numbered list. Works like the bulleted list. See more [[Help:Editing#Numbered lists|below]]. | |||
# Indentation. See more [[Help:Editing#Indentation|below]]. | |||
# Creates a piece of text (selected when clicking the button) that doesn't have any formatting in it even on the actual page, even if there were some codes creating formatting in that piece of text. | |||
# Creates a new line. See more [[Help:Editing#New line|below]]. | |||
# Text that has been striked through. | |||
# Creates a horizontal line through the page. | |||
# Underlined text. | |||
# Text in the center of the page. | |||
# An attack. These are used when you disagree about something on the page, or, most commonly, in [[Discussion|discussions]] in Opasnet. | |||
# A defend. Works like the the attack, except defending. | |||
# A comment. Works like the attack and defend, except is neutral to the thing it's commenting. | |||
# Bigger text. | |||
# Smaller text. | |||
# Superscript. | |||
# Subscript. | |||
# Creates a picture gallery, that ties a bunch of pictures together and lets them be treated as a group. | |||
# Redirects a page. This is used only if the text (or information) on an existing page is moved to a better page. Used only on empty pages. The empty page is redirected to the new, and trying to open the page leads straight to the page it is redirected to. | |||
# Creates a table. See more [[Help:Editing#Tables|below]]. | |||
After editing the page (or preferably also in between, if you're doing a long edit), you need to save it. Click '''Save page''' to save your text. You may, however, wish to click '''Show preview''' before saving your work. | |||
For more information about editing basics, please see [http://meta.wikimedia.org/wiki/Help:Editing#Editing__basics] | For more information about editing basics, please see [http://meta.wikimedia.org/wiki/Help:Editing#Editing__basics] | ||
=== Text formatting === | === Text formatting === | ||
Line 262: | Line 184: | ||
</pre> | </pre> | ||
====Special characters==== | |||
For a list of special characters (math, Greek etc.), [http://tlt.its.psu.edu/suggestions/international/bylanguage/mathchart.html see here]. | |||
=== Lists === | === Lists === | ||
Line 364: | Line 288: | ||
</pre> | </pre> | ||
So you just type your section name between the '''=''' signs. The number of = signs defines the level of the section. Please note that the section numbers are normally not shown in the section headings, except for the table of context. If you would like to see sections numbers in the text, you'll need to change your [[Special:Preferences|user preferences]]. | So you just type your section name between the '''=''' signs. The number of = signs defines the level of the section. Please note that the section numbers are normally not shown in the section headings, except for the table of context. If you would like to see sections numbers in the text, you'll need to change your [[Special:Preferences|user preferences]]. Not that the level 1 title <nowiki>= Title =</nowiki> is used only in the page title, so on a page you should use headings beginning with two = signs. | ||
For more information about creating sections, please see [http://meta.wikimedia.org/wiki/Help:Section]. | For more information about creating sections, please see [http://meta.wikimedia.org/wiki/Help:Section]. | ||
=== Tables === | === Tables === | ||
Line 376: | Line 298: | ||
You can create tables in MediaWiki with standard '''HTML''' code, or you can use special '''wikicode'''. The latter method is described here. If you are interested in HTML table syntax, you can learn it from [http://www.w3.org/TR/html4/struct/tables.html here]. | You can create tables in MediaWiki with standard '''HTML''' code, or you can use special '''wikicode'''. The latter method is described here. If you are interested in HTML table syntax, you can learn it from [http://www.w3.org/TR/html4/struct/tables.html here]. | ||
The most basic type of table is a "pretty table", which is used to present facts clearly in a table. These tables don't have any special properties and they can be used only in presenting facts. The template <nowiki>{{prettytable}}</nowiki> on the first row before any of the actual cells makes all the basic formatting for you. | |||
<nowiki>{|{{prettytable}} | |||
|+ Table caption | |||
! Column title 0 | |||
! Column title 1 | |||
|----- | |||
| element 0.1 | |||
| element 1.1 | |||
|----- | |||
| element 0.2 | |||
| element 1.2 | |||
|}</nowiki> | |||
This is what the above will look like: | |||
{|{{prettytable}} | |||
|+ Table caption | |||
! Column title 0 | |||
! Column title 1 | |||
|----- | |||
| element 0.1 | |||
| element 1.1 | |||
|----- | |||
| element 0.2 | |||
| element 1.2 | |||
|} | |||
You can also do your own formatting for the table, for example define the thickness of the borders (without any formatting there are no borders at all): | |||
<pre> | |||
{| border="1" | {| border="1" | ||
|+ The table's caption | |+ The table's caption | ||
Line 388: | Line 340: | ||
|Cell C | |Cell C | ||
|} | |} | ||
</pre> | |||
{| border="1" | {| border="1" | ||
|+ The table's caption | |+ The table's caption | ||
Line 403: | Line 353: | ||
|Cell C | |Cell C | ||
|} | |} | ||
* Table code is encased with curly brackets and a pipe '''<nowiki>{|</nowiki>''' table code here '''<nowiki> |}</nowiki>'''. | * Table code is encased with curly brackets and a pipe '''<nowiki>{|</nowiki>''' table code here '''<nowiki> |}</nowiki>'''. | ||
Line 410: | Line 358: | ||
* The table caption is optional | * The table caption is optional | ||
* The first column heading is marked with a single '''!''', and next column headings are separated with double '''!!''' | * The first column heading is marked with a single '''!''', and next column headings are separated with double '''!!''' | ||
* Rows are separated with '''<nowiki>|-</nowiki>''' | * Rows are separated with '''<nowiki>|-</nowiki>'''. Note that |- and |---- have the same effect but often the latter is used to make it easier to see a new row from the code. | ||
* A single '''!''' marks row headings | * A single '''!''' marks row headings | ||
* Cells within the same row are separated with '''||''' or with a new line and a single bar '''|''' | * Cells within the same row are separated with '''||''' or with a new line and a single bar '''|''' | ||
* You can also create a table by pressing '''Table''' in the edit screen you can bring out the '''Table generator''', which lets you choose the number of rows and columns of the table. By pressing '''Insert table code''' the table generator creates the code of the table on the page. | |||
For more information about creating tables, please see [http://meta.wikimedia.org/wiki/Help:Table#Pipe_syntax_tutorial]. | For more information about creating tables, please see [http://meta.wikimedia.org/wiki/Help:Table#Pipe_syntax_tutorial]. | ||
Line 431: | Line 379: | ||
# paste it into your article! | # paste it into your article! | ||
< | ====Data table==== | ||
'''Datatable''' is a table which has some special properties. The content of a datatable is stored in the [[Opasnet Base]] database, and it can be retrieved from there for modelling and other purposes. You should definitely read [[Table2Base]] for more instructions and explanations all parameters. In brief, | |||
* ''name'' is the title of the table | |||
* ''index'' is a list of index columns, | |||
* ''locations'' is a list of the locations of the last index (each location gets an own column) | |||
* ''obs'' is the name of the result column (if not Result) | |||
* ''unit'' is the unit of the result | |||
* ''desc'' is a list of description columns (they are not stored in the database) | |||
<t2b index="index1" Locations="Location0,Location1,Location2" unit="nro"> | |||
Location0.1|Location1.1|Location2.1 | |||
Location0.2|Location1.2|Location2.2 | |||
</t2b> | |||
Code: | |||
<nowiki> | |||
<t2b index="index1" Locations="Location0,Location1,Location2" unit="nro"> | |||
Location0.1|Location1.1|Location2.1 | |||
Location0.2|Location1.2|Location2.2 | |||
</t2b> | |||
</nowiki> | |||
=== Table of contents === | === Table of contents === | ||
Line 443: | Line 414: | ||
=== Linking === | === Linking === | ||
{| {{prettytable}} | |||
!What to do | |||
!What to write | |||
!How it looks | |||
|---- | |||
| Links to articles in the same MediaWiki project | |||
| <nowiki>[[Sandbox]]</nowiki> | |||
| [[Sandbox]] | |||
|---- | |||
| Links to articles in different MediaWiki projects | |||
It is also possible to link articles between different MediaWiki projects easily without typing in the whole URL. [[Main Page|Opasnet in English]], [[:op_fi:Etusivu|Etusivu]] and [[:heande:Main Page|Heande]] (password-protected) are the three most common projects, but you can also link to e.g. [[:en:Main Page|Wikipedia]]. For a full list, see [[Opasnet structure#Opasnet wiki]]. | |||
For | Note! If you add a bar {{!}} in the link, the project name will not be shown. | ||
| <nowiki>[[:op_fi:Etusivu|]]</nowiki> | |||
| [[:op_fi:Etusivu|Etusivu]] | |||
|---- | |||
| Links to sections on a page. For more information about links, please see [http://meta.wikimedia.org/wiki/Help:Link]. | |||
| <nowiki>[[Opasnet structure#Opasnet wiki]]</nowiki> | |||
| [[Opasnet structure#Opasnet wiki]] | |||
|---- | |||
|Piped links can be used to name links differently from the name of the target page. In piped links, a | (pipe) sign is used for separating the name of the target page from the label shown in the text. For more information about piped links, please see [http://meta.wikimedia.org/wiki/Help:Piped_link]. | |||
| <nowiki>[[Main Page|Main Page of Opasnet]] </nowiki> | |||
| [[Main Page|Main Page of Opasnet]] | |||
|---- | |||
| External links are used to point to any internet pages beyond the local MediaWiki projects. You can show the URL on the page by simply typing the address. | |||
| <nowiki>http://www.thl.fi</nowiki> | |||
| http://www.thl.fi | |||
|---- | |||
| If you only type the URL between brackets, the link address will ''not'' be shown, only a number. | |||
| <nowiki>[http://www.thl.fi]</nowiki> | |||
| [http://www.ktl.fi] | |||
|---- | |||
|You can '''name''' the link by typing both the URL and the name between the brackets, separated by a space. '''Note''' that you need not use the pipe sign to separate a URL-formed link from the name. For more information about external links, please see [http://meta.wikimedia.org/wiki/Help:URL#URLs_in_external_links]. | |||
| <nowiki>[http://www.thl.fi THL homepage] </nowiki> | |||
| [http://www.THL.fi THL homepage] | |||
|---- | |||
| You can give special parameters to the link, if you use a specific format for the link. It must be used like an external link. | |||
* oldid gives a permanent link to a specific version of a page. | |||
| <nowiki>http://en.opasnet.org/en-opwiki/index.php?title=Main_Page&oldid=25805</nowiki> | |||
| [http://en.opasnet.org/en-opwiki/index.php?title=Main_Page&oldid=25805 Permanent link] | |||
|---- | |||
| | |||
* redirect=no prevents redirects to other pages | |||
| <nowiki>http://en.opasnet.org/en-opwiki/index.php?title=Opasnet_base&redirect=no</nowiki> | |||
| [http://en.opasnet.org/en-opwiki/index.php?title=Opasnet_base&redirect=no No redirect] | |||
|---- | |||
| | |||
* action=render makes all formatting and side bars go away. This is useful if you want to use the contents of a page as a part of another web page. | |||
| <nowiki>http://en.opasnet.org/en-opwiki/index.php?title=Main_Page&action=render</nowiki> | |||
| [http://en.opasnet.org/en-opwiki/index.php?title=Main_Page&action=render Show only content] | |||
|} | |||
=== Templates === | |||
'''Templates''' are wiki pages that contain text that is repeated on several pages. This ensures that the content on all pages is coherent. It is easy to update all pages simultaneously by updating the template. Templates locate in a specific namespace ''Template'', e.g. [[:Template:Help]]. Templates are called with this syntax: | |||
<nowiki>{{Help}}</nowiki> | |||
and, based on page [[:Template:Help]], it produces | |||
{{Help}} | |||
It is also possible to use as templates pages that are not in the Template namespace. Then, the namespace number must be defined. E.g. page [[Bootstrap]] from the main namespace (ns:0) can be called like this: | |||
<nowiki>{{{{ns:0}}:Bootstrap}}</nowiki> | |||
and, based on page [[Bootstrap]] it produces this: | |||
= | {| border="1" | ||
| | |||
{{{{ns:0}}:Bootstrap}} | |||
|} | |||
... all the way here (the box is added for clarity to separate the template contents from the rest of the page). Note that all content, including a subheading and references, are used on the page that calls the other page. | |||
Templates can be given parameters separated by bar |. For details about this, see [[:en:Help:Template]]. | |||
=== | ===Mathematical formulas=== | ||
You can create mathematical formulas using the <nowiki><math></math></nowiki> tags. Within the tags, you can use [[:en:LaTeX|LaTeX]] formatting. For a summary of instructions, see the [http://en.wikibooks.org/wiki/LaTeX/Mathematics Wikibook LaTeX]. | |||
===Other tabs in the edit-page=== | |||
On the upper edit-bar there are three parts that open as the lower bar: Advanced, Special characters and Help. The image above shows the Advanced-bar and explains the buttons it has. | |||
[[File:editing_special_characters.png|800px]] | |||
The Special characters -bar gives you the option to add special characters into the text by clicking it. There are hundreds of characters, divided into different sections that can be seen on the left. | |||
[[File:editing_screen_help.png|800px]] | |||
The Help -bar gives a brief summary of the text formatting that has been described above. If you don't remember how to make a link or bold the text, the answer can be found easily here while editing the page. | |||
== Using Images and Files == | == Using Images and Files == | ||
Line 514: | Line 516: | ||
=== Uploading === | === Uploading === | ||
You need to be logged in before you can upload files. | You need to be logged in before you can upload files. The easiest way to upload files is to click on the button on the editing bar, numbered 8 in the picture above. Clicking this opens a window that lets you choose as many files as you like from your computer. After clicking '''Open''' it then tells you if files with the same name already exist in Opasnet, and if not, by clicking '''Click here to upload all files''' (or this file), it uploads all files at once. You can also get them directly onto the page (to the spot where the cursor is) by clicking '''Insert file''' or '''Insert picture''', if you want a picture on the page. | ||
For more information about uploading, please see [http://meta.wikimedia.org/wiki/Help:Images_and_other_uploaded_files#Uploading]. | For more information about uploading, please see [http://meta.wikimedia.org/wiki/Help:Images_and_other_uploaded_files#Uploading]. | ||
=== Supported file types === | === Supported file types === | ||
Line 573: | Line 571: | ||
</pre> | </pre> | ||
==Simple reference list== | ==Rerference lists== | ||
In case you should want to add references to your pages, you need a little bit of code to help you along. Basically you can cite your reference in whichever way you want, but the most straightforward way is probably by using superscript numbers that refer to a set of footnotes. | |||
===Simple reference list=== | |||
In case you should want to add references to your pages (which is a good manner in Opasnet), you need a little bit of code to help you along. Basically you can cite your reference in whichever way you want, but the most straightforward way is probably by using superscript numbers that refer to a set of footnotes. | |||
You go about this by adding your reference in the text, between the markers '''<nowiki><ref> and </ref></nowiki>'''. The text in between these "ref" markers can take any form you like, including hyperlinks to external web sources, or just plain text etc. | You go about this by adding your reference in the text, between the markers '''<nowiki><ref> and </ref></nowiki>'''. The text in between these "ref" markers can take any form you like, including hyperlinks to external web sources, or just plain text etc. | ||
Line 580: | Line 581: | ||
At the very bottom of the document, you then add in the title '''<nowiki>==References==</nowiki>''' and the marker '''<nowiki><references /></nowiki>'''. When you save the page, you will see your reference in the text appear only as a superscript number, and your reference list is automatically populated with the text added between the "ref" markers. This all sounds much worse than it is in practice! | At the very bottom of the document, you then add in the title '''<nowiki>==References==</nowiki>''' and the marker '''<nowiki><references /></nowiki>'''. When you save the page, you will see your reference in the text appear only as a superscript number, and your reference list is automatically populated with the text added between the "ref" markers. This all sounds much worse than it is in practice! | ||
===Example=== | ====Example==== | ||
Enter the references between the '''<nowiki><ref></ref></nowiki>''' markers at the appropriate point in your text: | Enter the references between the '''<nowiki><ref></ref></nowiki>''' markers at the appropriate point in your text: | ||
<nowiki>The quick brown fox jumped over the lazy dog.<ref>Smith, J. 1998. Foxes are faster than dogs. Journal of </nowiki><br/> | <nowiki>The quick brown fox jumped over the lazy dog.<ref>Smith, J. 1998. Foxes are faster than dogs. Journal of </nowiki><br/> | ||
Line 588: | Line 589: | ||
The quick brown fox jumped over the lazy dog.<ref>Smith, J. 1998. Foxes are faster than dogs. Journal of animal research. 30:19-20</ref> The lazy brown fox jumped over the quick dog.<ref>Jones, S. 1999. Dogs are faster than foxes. Journal of advanced animal research. 31:20-21</ref> | The quick brown fox jumped over the lazy dog.<ref>Smith, J. 1998. Foxes are faster than dogs. Journal of animal research. 30:19-20</ref> The lazy brown fox jumped over the quick dog.<ref>Jones, S. 1999. Dogs are faster than foxes. Journal of advanced animal research. 31:20-21</ref> | ||
Adding the '''<nowiki><references/></nowiki>''' marker then generates the following list automatically from all the references inserted in this document ''up to that point'': | Adding the '''<nowiki><references/></nowiki>''' marker then generates the following list automatically from all the references inserted in this document ''up to that point'': | ||
<references/> | <references/> | ||
==Adding hyperlinks to your references== | The normal place for this is at the end of the page, under the heading '''References''' | ||
===Adding hyperlinks to your references=== | |||
Often when citing a journal it may be desirable to include a hyperlink to a specific article online. This is easy in Mediawiki referencing, since all the usual Mediawiki markup codes apply within the '''<nowiki><ref></ref></nowiki>''' markers. If you wanted to link to a specific article online, simply insert the web address as the first item in square brackets, in between the reference markers as follows: | Often when citing a journal it may be desirable to include a hyperlink to a specific article online. This is easy in Mediawiki referencing, since all the usual Mediawiki markup codes apply within the '''<nowiki><ref></ref></nowiki>''' markers. If you wanted to link to a specific article online, simply insert the web address as the first item in square brackets, in between the reference markers as follows: | ||
Line 605: | Line 608: | ||
The INTARESE Consortium comprises of 33 partners from many of the leading research and user organisations in Europe.<ref>[http://www.intarese.org/ Intarese website, accessed 27/09/2007]</ref> | The INTARESE Consortium comprises of 33 partners from many of the leading research and user organisations in Europe.<ref>[http://www.intarese.org/ Intarese website, accessed 27/09/2007]</ref> | ||
===...And the new references list will look like this=== | =====...And the new references list will look like this===== | ||
<References/> | <References/> | ||
==More complicated reference lists== | ===More complicated reference lists=== | ||
More extensive options relating to reference lists can be found at [http://en.wikipedia.org/wiki/Wikipedia:Footnotes this link in Wikipedia help] | More extensive options relating to reference lists can be found at [http://en.wikipedia.org/wiki/Wikipedia:Footnotes this link in Wikipedia help] | ||
==Useful links to other help pages | ==Categories, categorizing== | ||
Categorizing eases finding the right pages. You create a cathegory by placing a page to the desired cathegory. By clicking the name of the category at the end of the page you will get to the class-page which lists all the pages of the category. There is also a short description of the cathegory. | |||
<nowiki>[[Category:Name of the Category]]</nowiki> | |||
If the page pelongs to more cathegories than one it should be written like this: | |||
<nowiki>[[Category:Name of the Category]] | |||
[[Category:Name of the Category]]</nowiki> | |||
<nowiki>[[:Category:Name of the Category]]</nowiki> | |||
is a link to te cathegory which can be placed to the text. | |||
==Some parser functions== | |||
'''#if: | |||
:<tt><nowiki>{{#if:</nowiki> ''test string'' | ''value if true'' | ''value if false'' <nowiki>}}</nowiki></tt> | |||
This function tests whether the first parameter is 'non-empty'. It evaluates to false if the test string is empty or contains only whitespace characters (space, newline, etc). | |||
:<tt><nowiki>{{#if: | yes | no}}</nowiki></tt> → '''{{#if: | yes | no}}''' | |||
:<tt><nowiki>{{#if: string | yes | no}}</nowiki></tt> → '''{{#if: string | yes | no}}''' | |||
:<tt><nowiki>{{#if: | yes | no}}</nowiki></tt> → '''{{#if: | yes | no}}''' | |||
:<tt><nowiki>{{#if: </nowiki> | |||
<nowiki> | yes | no}}</nowiki></tt> → '''{{#if: | |||
| yes | no}}''' | |||
The test string is always interpreted as pure text, so mathematical expressions are not evaluated: | |||
:<tt><nowiki>{{#if: 1==2 | yes | no}}</nowiki></tt> → '''{{#if: 1==2 | yes | no}}''' | |||
Either or both the return values may be omitted: | |||
:<tt><nowiki>{{#if: foo | yes }}</nowiki></tt> → ''' {{#if: foo | yes }}''' | |||
:<tt><nowiki>{{#if: | yes }}</nowiki></tt> → ''' {{#if: | yes }}''' | |||
:<tt><nowiki>{{#if: foo | | no}}</nowiki></tt> → ''' {{#if: foo | | no}}''' | |||
See [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions] for more examples of this parser function. | |||
==Useful links to other help pages== | |||
{{Help}} | |||
'''In Wikipedia: | |||
* [[:en:Wikipedia:Quick_guide | Quick guide to editing]] | * [[:en:Wikipedia:Quick_guide | Quick guide to editing]] | ||
* [[:en:Wikipedia:Refactoring_talk_pages | How to use refactoring]] | * [[:en:Wikipedia:Refactoring_talk_pages | How to use refactoring]] | ||
* [[:en:Wikipedia:How_to_archive_a_talk_page#Permanent_link_archives_method | How to archive argumentation]]. In pyrkilo, permanent link method should be used; not the subpage method, although is more common in Wikipedia. | * [[:en:Wikipedia:How_to_archive_a_talk_page#Permanent_link_archives_method | How to archive argumentation]]. In pyrkilo, permanent link method should be used; not the subpage method, although is more common in Wikipedia. | ||
* [[:en:Wikipedia:Resolving_disputes | How to resolve disputes]] | * [[:en:Wikipedia:Resolving_disputes | How to resolve disputes]] | ||
* [http://www.mediawiki.org/wiki/Help:Magic_words#Parser_functions Magic words in Mediawiki] | |||
* [[:en:Help:External link icons]] | |||
* [[:en:Help:Magic words]] | |||
[[Category:Help]] |
Latest revision as of 19:10, 6 April 2015
Guide to editing in MediaWiki. Recently asked questions
- How do I link to pages in other wikis?
- You can use shorcuts instead of full URLs. The following shortcuts are in operation: [[:en:To English Wikipedia|]] (goes to a page named "To English Wikipedia" in English Wikipedia) [[:fi:To Finnish Wikipedia|]] [[:op_en:To English Opasnet|]] [[:op_fi:To Finnish Opasnet|]] [[:heande:To protected Heande wiki|]]. Also other shortcut links work to project wikis of Intarese, Beneris etc., but those wikis are being merged with Heande soon, so the usage of these shortcut links is not recommended although they should work even after the merge. The bar (|) at the end of the link hides the first part of the link (e.g. :op_en:), showing only the page name.
- How to make nice-looking tables?
- The easiest way is to use {{prettytable}} template in the first row of table definition.
- Should Rich editor be used?
- Rich editor makes many features look more user-friendly during editin. However, it has two major drawbacks, and therefore we discourage its use:
- Many buttons designed for Opasnet (e.g. about discussions) don't show up.
- Rich editor adds some code into the text although the user does not want it, e.g. <br> tags.
Introduction
Below, please find further information on using the local MediaWiki pages.
Please feel free to test your skills in the Sandbox page!
Remember! You need not be afraid of causing any permanent damage to wikipages - because the previous versions of any page can always be restored.
So have fun editing and creating!
Creating an account and logging in
It is recommended that you create an account (for logging in with your username) before editing any MediaWiki-pages. This enables others to identify who have created or edited a particular page. However, please note that you can create, edit, and read wikipages also without having an account or logging in.
To create an account, click login or create an account in the upper right corner. From there you can choose your User name and password. It is recommended to use your full name in the username.
For more information about logging in and user accounts, please see [1].
Editing
Starting a new page
There are several alternative ways to create new articles (wikipages) in MediaWiki. (The result will be the same regardless of the method.)
Creating a new article using the sidebar tool
The recommended way to create a new page is to use the Create articles tool on the left sidebar. It will lead you to a page where you can select a page type. Write the name of your page in the appropriate box and click "Create variable" (or whatever page type you are creating).
In this way, you will get a pre-filled page with the default subheadings, instructions, and other useful stuff.
Creating a new article through the search-box method
Type the name of the article to the search box on the left and click the Go button. From there you can simply click the text which says this exact title, and the editing window opens.
Creating a new article through the link method
Make a link from an existing page to a new article. For example, to create a new page called Name of the new article, type [[Name of the new article]] in the existing page and save it. When you click on this link, an edit window will automatically open for the article named Name of the new article.
For more information on linking, see the "linking" section below.
Creating a new article through the address-bar method
Type the name of the article to the browser's address bar after index.php?title=
For example, index.php?title=Name of your new article
However, this way is NOT recommended because typically the web browser uses a simplified version of the address which does not show "index.php" at all.
For further information about starting a new page, please see [2].
Naming a new article - basic guidelines
You can name your articles quite freely. However, it is a good practice to keep in mind the following guidelines:
- Use descriptive names
- Names can consist of several words
- Numbers and spaces are allowed
- However, do not use special characters such as # < > [ ] | { }
- Capitalization matters, except for the first letter
- for example, "mediaWiki" and "MediaWiki" point to the same page, while "mediawiki" points to a different page
For more information about naming, please see [3].
Editing basics
To start editing, simply click the edit link at the top of the page. This opens the edit page, which looks like this:
In the "edit" page, simply type in your text. Alternatively, copy and paste text from another source (for example Word).
There are also multiple different ways to format the text you have. The buttons shown in the image with numbers next to them help with that.
- Bold. See more below.
- Italic. See more below.
- Signature. This brings --~~~~ to the page. When saving the page, this is replaced by your user name and the time of the same. It can be used when leaving comments or in a discussion
- Creates a link. See more below.
- Creates a link to an already uploaded file. See more about files below.
- Helps you create a reference. See more below.
- Creates a direct link to a file instead of to the file page. See more about files below.
- Uploads a file. See more about uploading files below.
- Creates a heading. See more below.
- Creates a bulleted list. If choose a section of your text and then click this, a bullet point will appear in the beginning of every line. See more below.
- Creates a numbered list. Works like the bulleted list. See more below.
- Indentation. See more below.
- Creates a piece of text (selected when clicking the button) that doesn't have any formatting in it even on the actual page, even if there were some codes creating formatting in that piece of text.
- Creates a new line. See more below.
- Text that has been striked through.
- Creates a horizontal line through the page.
- Underlined text.
- Text in the center of the page.
- An attack. These are used when you disagree about something on the page, or, most commonly, in discussions in Opasnet.
- A defend. Works like the the attack, except defending.
- A comment. Works like the attack and defend, except is neutral to the thing it's commenting.
- Bigger text.
- Smaller text.
- Superscript.
- Subscript.
- Creates a picture gallery, that ties a bunch of pictures together and lets them be treated as a group.
- Redirects a page. This is used only if the text (or information) on an existing page is moved to a better page. Used only on empty pages. The empty page is redirected to the new, and trying to open the page leads straight to the page it is redirected to.
- Creates a table. See more below.
After editing the page (or preferably also in between, if you're doing a long edit), you need to save it. Click Save page to save your text. You may, however, wish to click Show preview before saving your work.
For more information about editing basics, please see [4]
Text formatting
New line
To start a new line, you need to press enter twice. It is also possible to use the HTML command <BR> (break) to start a new line.
Italic text
What you type: You can ''italicize text'' by putting 2 apostrophes on each side.
What you get: You can italicize text by putting 2 apostrophes on each side.
Bold text
What you type: 3 apostrophes will '''bold the text'''.
What you get: 3 apostrophes will bold the text.
Bold & italic text
What you type: 5 apostrophes will '''''bold & italicize the text'''''
What you get: 5 apostrophes will bold & italicize the text
Centered text
You can center text by placing it between <center> and </center>.
Example code:
<center> This is centered text </center>
Superscripts and subscripts
Superscripts are typed by placing text between <sup> and </sup>.
Subscripts are done placing text between <sub> and </sub>.
X2 and H2O
Example code:
X<sup>2</sup> and H<sub>2</sub>O
Indentation
You can indent lines with : (colon). More colons mean deeper indentation.
- first-level indentation
- second-level indentation
- ...and so on.
- second-level indentation
Example code:
: first-level indentation :: second-level indentation ::: ...and so on.
Special characters
For a list of special characters (math, Greek etc.), see here.
Lists
Basic lists
Lists are done with * (star) signs in MediaWiki. Just put * at the beginning of the new line. More stars mean deeper levels.
- 1 star
- 2 stars
- 3 stars
- 2 stars
Example code:
* 1 star ** 2 stars *** 3 stars
Numbered lists
Numbered lists are done with # signs. Just put one # sign at the beginning of the everyline you want to be included in your numbered list. Numbers are generated automatically.
- This is list item number 1
- This is obviously list item number 2
Example code:
# This is list item number 1 # This is obviously list item number 2
You can also use different depths of numbered lines. For example:
- First level
- Second level
- Second level
- Third level
- Quite easy?
Example code:
# First level ## Second level ## Second level ### Third level # Quite easy?
Definition lists
Definition lists can be used for defining a word or a phrase for example. Colons (:) and semicolons (;) are used to create a definition list. See example:
- Word or a phrase
- and the definition
- you can also add more than one definitions
Example code:
;Word or a phrase: and the definition : you can also add more than one definitions
Mixed lists
It is possible to combine different lists (numbered and basic lists for example):
- Numbered list
- option 1
- option 2
- Second item in numbered list
- Word
- and its definition
Example code:
# Numbered list #* option 1 #* option 2 # Second item in numbered list #*;Word: and its definition
Sections
Creating sections is done with = (equal) signs in MediaWiki.
Example code:
== 1 Section == === 1.1 Subsection === ==== 1.1.1 Sub-subsection ====
So you just type your section name between the = signs. The number of = signs defines the level of the section. Please note that the section numbers are normally not shown in the section headings, except for the table of context. If you would like to see sections numbers in the text, you'll need to change your user preferences. Not that the level 1 title = Title = is used only in the page title, so on a page you should use headings beginning with two = signs.
For more information about creating sections, please see [5].
Tables
Standard wiki tables
You can create tables in MediaWiki with standard HTML code, or you can use special wikicode. The latter method is described here. If you are interested in HTML table syntax, you can learn it from here.
The most basic type of table is a "pretty table", which is used to present facts clearly in a table. These tables don't have any special properties and they can be used only in presenting facts. The template {{prettytable}} on the first row before any of the actual cells makes all the basic formatting for you.
{|{{prettytable}} |+ Table caption ! Column title 0 ! Column title 1 |----- | element 0.1 | element 1.1 |----- | element 0.2 | element 1.2 |}
This is what the above will look like:
Column title 0 | Column title 1 |
---|---|
element 0.1 | element 1.1 |
element 0.2 | element 1.2 |
You can also do your own formatting for the table, for example define the thickness of the borders (without any formatting there are no borders at all):
{| border="1" |+ The table's caption ! Column heading 1 !! Column heading 2 !! Column heading 3 |- ! Row heading 1 | Cell 2 || Cell 3 |- ! Row heading A |Cell B |Cell C |}
Column heading 1 | Column heading 2 | Column heading 3 |
---|---|---|
Row heading 1 | Cell 2 | Cell 3 |
Row heading A | Cell B | Cell C |
- Table code is encased with curly brackets and a pipe {| table code here |}.
- The border is optional (the bigger the number, the thicker the border)
- The table caption is optional
- The first column heading is marked with a single !, and next column headings are separated with double !!
- Rows are separated with |-. Note that |- and |---- have the same effect but often the latter is used to make it easier to see a new row from the code.
- A single ! marks row headings
- Cells within the same row are separated with || or with a new line and a single bar |
- You can also create a table by pressing Table in the edit screen you can bring out the Table generator, which lets you choose the number of rows and columns of the table. By pressing Insert table code the table generator creates the code of the table on the page.
For more information about creating tables, please see [6].
Converting tables from Excel or Word
The easiest way to convert tables from Excel or Word is to use the Excel to WIKI converter found from the list of tools on the left.
Instructions:
- select the (part of the) table you want to import to MediaWiki
- copy it (CTRL+c)
- paste it to converter (CTRL+v)
- press the "Convert to MediaWiki" button
- select the output text (CTRL+a)
- copy it
- paste it into your article!
Data table
Datatable is a table which has some special properties. The content of a datatable is stored in the Opasnet Base database, and it can be retrieved from there for modelling and other purposes. You should definitely read Table2Base for more instructions and explanations all parameters. In brief,
- name is the title of the table
- index is a list of index columns,
- locations is a list of the locations of the last index (each location gets an own column)
- obs is the name of the result column (if not Result)
- unit is the unit of the result
- desc is a list of description columns (they are not stored in the database)
Obs | Location0 | Location1 | Location2 |
---|---|---|---|
1 | Location0.1 | Location1.1 | Location2.1 |
2 | Location0.2 | Location1.2 | Location2.2 |
Code:
<t2b index="index1" Locations="Location0,Location1,Location2" unit="nro"> Location0.1|Location1.1|Location2.1 Location0.2|Location1.2|Location2.2 </t2b>
Table of contents
MediaWiki creates automatically a table of contents, if there are more than 3 headings (sections) in the article.
For more information about tables of contents, please see [7]
Linking
What to do | What to write | How it looks |
---|---|---|
Links to articles in the same MediaWiki project | [[Sandbox]] | Sandbox |
Links to articles in different MediaWiki projects
It is also possible to link articles between different MediaWiki projects easily without typing in the whole URL. Opasnet in English, Etusivu and Heande (password-protected) are the three most common projects, but you can also link to e.g. Wikipedia. For a full list, see Opasnet structure#Opasnet wiki. Note! If you add a bar | in the link, the project name will not be shown. |
[[:op_fi:Etusivu|]] | Etusivu |
Links to sections on a page. For more information about links, please see [8]. | [[Opasnet structure#Opasnet wiki]] | Opasnet structure#Opasnet wiki |
(pipe) sign is used for separating the name of the target page from the label shown in the text. For more information about piped links, please see [9]. | [[Main Page|Main Page of Opasnet]] | Main Page of Opasnet |
External links are used to point to any internet pages beyond the local MediaWiki projects. You can show the URL on the page by simply typing the address. | http://www.thl.fi | http://www.thl.fi |
If you only type the URL between brackets, the link address will not be shown, only a number. | [http://www.thl.fi] | [10] |
You can name the link by typing both the URL and the name between the brackets, separated by a space. Note that you need not use the pipe sign to separate a URL-formed link from the name. For more information about external links, please see [11]. | [http://www.thl.fi THL homepage] | THL homepage |
You can give special parameters to the link, if you use a specific format for the link. It must be used like an external link.
|
http://en.opasnet.org/en-opwiki/index.php?title=Main_Page&oldid=25805 | Permanent link |
|
http://en.opasnet.org/en-opwiki/index.php?title=Opasnet_base&redirect=no | No redirect |
|
http://en.opasnet.org/en-opwiki/index.php?title=Main_Page&action=render | Show only content |
Templates
Templates are wiki pages that contain text that is repeated on several pages. This ensures that the content on all pages is coherent. It is easy to update all pages simultaneously by updating the template. Templates locate in a specific namespace Template, e.g. Template:Help. Templates are called with this syntax:
{{Help}}
and, based on page Template:Help, it produces
Basics of Opasnet: What is Opasnet · Welcome to Opasnet · Opasnet policies · Open assessment · What is improved by Opasnet and open assessment? · FAQ |
How to participate?: Contributing to Opasnet · Discussions in Opasnet · Watching pages · Open assessment method |
How to edit pages?: Basic editing · More advanced editing · Quick reference for wiki editing · Wikipedia cheatsheet · Templates |
Help for more advanced participation: Copyright · Archiving pages · Copying from Wikipedia · ImageMap · SQL-queries · Analytica conventions · Developing variables · Extended causal diagram · GIS tool · Risk assessment · M-files · Stakeholders · Heande · Todo · Text from PDFs and pictures · Word2MediaWiki · Glossary terms · Formulae |
It is also possible to use as templates pages that are not in the Template namespace. Then, the namespace number must be defined. E.g. page Bootstrap from the main namespace (ns:0) can be called like this:
{{{{ns:0}}:Bootstrap}}
and, based on page Bootstrap it produces this:
<section end=glossary /> References |
... all the way here (the box is added for clarity to separate the template contents from the rest of the page). Note that all content, including a subheading and references, are used on the page that calls the other page.
Templates can be given parameters separated by bar |. For details about this, see en:Help:Template.
Mathematical formulas
You can create mathematical formulas using the <math></math> tags. Within the tags, you can use LaTeX formatting. For a summary of instructions, see the Wikibook LaTeX.
Other tabs in the edit-page
On the upper edit-bar there are three parts that open as the lower bar: Advanced, Special characters and Help. The image above shows the Advanced-bar and explains the buttons it has.
The Special characters -bar gives you the option to add special characters into the text by clicking it. There are hundreds of characters, divided into different sections that can be seen on the left.
The Help -bar gives a brief summary of the text formatting that has been described above. If you don't remember how to make a link or bold the text, the answer can be found easily here while editing the page.
Using Images and Files
Before images and other files can be used, they need to be uploaded into the MediaWiki system.
Uploading
You need to be logged in before you can upload files. The easiest way to upload files is to click on the button on the editing bar, numbered 8 in the picture above. Clicking this opens a window that lets you choose as many files as you like from your computer. After clicking Open it then tells you if files with the same name already exist in Opasnet, and if not, by clicking Click here to upload all files (or this file), it uploads all files at once. You can also get them directly onto the page (to the spot where the cursor is) by clicking Insert file or Insert picture, if you want a picture on the page.
For more information about uploading, please see [12].
Supported file types
So far, our MediaWiki projects support the following file types:
- ana (Analytica)
- ppt (Microsoft PowerPoint)
- pps (PowerPoint show)
- xls (Microsoft Excel)
- pdf (Adobe)
- doc (Microsoft Word)
- bmp (bitmap pictures)
- tif (Tagged Image File pictures)
- png (Portable Network Graphics pictures)
- gif (Graphics Interchange Format pictures)
- jpg & jpeg (stands for Joint Photographic Experts Group pictures)
- ogg (audio files)
You cannot upload files with a format different from those mentioned above.
Adding images to articles
Images are added to articles using the [[Image:name of your picture]] code. Remember that pictures have to be uploaded before they can be used.
In the example below, the name of the picture is picture.GIF:
Example code:
[[Image:picture.GIF]]
Adding other types of files into articles
Files other than images can also be attached to articles, using the [[Media:filename]] code.
Example:
This is a link to Media:Ytos28_6.pdf. It is also possible to use piped links such as this. You can add xls files or any other supported file types as well Media:Testixls.xls.
Example code:
This is a link to [[Media:Ytos28_6.pdf]]. It is also possible use piped links such as [[Media:Ytos28_6.pdf|this]]. You can add xls files or any other supported file types as well [[Media:Testixls.xls]].
Rerference lists
Simple reference list
In case you should want to add references to your pages (which is a good manner in Opasnet), you need a little bit of code to help you along. Basically you can cite your reference in whichever way you want, but the most straightforward way is probably by using superscript numbers that refer to a set of footnotes.
You go about this by adding your reference in the text, between the markers <ref> and </ref>. The text in between these "ref" markers can take any form you like, including hyperlinks to external web sources, or just plain text etc.
At the very bottom of the document, you then add in the title ==References== and the marker <references />. When you save the page, you will see your reference in the text appear only as a superscript number, and your reference list is automatically populated with the text added between the "ref" markers. This all sounds much worse than it is in practice!
Example
Enter the references between the <ref></ref> markers at the appropriate point in your text:
The quick brown fox jumped over the lazy dog.<ref>Smith, J. 1998. Foxes are faster than dogs. Journal of
animal research. 30:19-20</ref> The lazy brown fox jumped over the quick dog.<ref>Jones, S. 1999.
Dogs are faster than foxes. Journal of advanced animal research. 31:20-21</ref>
The quick brown fox jumped over the lazy dog.[1] The lazy brown fox jumped over the quick dog.[2]
Adding the <references/> marker then generates the following list automatically from all the references inserted in this document up to that point:
The normal place for this is at the end of the page, under the heading References
Adding hyperlinks to your references
Often when citing a journal it may be desirable to include a hyperlink to a specific article online. This is easy in Mediawiki referencing, since all the usual Mediawiki markup codes apply within the <ref></ref> markers. If you wanted to link to a specific article online, simply insert the web address as the first item in square brackets, in between the reference markers as follows:
The INTARESE Consortium comprises of 33 partners from many of the leading research
and user organisations in Europe.<ref>[http://www.intarese.org/ INTARESE website, accessed 27/09/2007]</ref>
Note the space between the website address and the text you would like to be displayed in the references list.
In context, the footnote appears thus:
The INTARESE Consortium comprises of 33 partners from many of the leading research and user organisations in Europe.[1]
...And the new references list will look like this
More complicated reference lists
More extensive options relating to reference lists can be found at this link in Wikipedia help
Categories, categorizing
Categorizing eases finding the right pages. You create a cathegory by placing a page to the desired cathegory. By clicking the name of the category at the end of the page you will get to the class-page which lists all the pages of the category. There is also a short description of the cathegory.
[[Category:Name of the Category]]
If the page pelongs to more cathegories than one it should be written like this:
[[Category:Name of the Category]] [[Category:Name of the Category]]
[[:Category:Name of the Category]]
is a link to te cathegory which can be placed to the text.
Some parser functions
#if:
- {{#if: test string | value if true | value if false }}
This function tests whether the first parameter is 'non-empty'. It evaluates to false if the test string is empty or contains only whitespace characters (space, newline, etc).
- {{#if: | yes | no}} → no
- {{#if: string | yes | no}} → yes
- {{#if: | yes | no}} → no
- {{#if:
| yes | no}} → no
The test string is always interpreted as pure text, so mathematical expressions are not evaluated:
- {{#if: 1==2 | yes | no}} → yes
Either or both the return values may be omitted:
- {{#if: foo | yes }} → yes
- {{#if: | yes }} →
- {{#if: foo | | no}} →
See [13] for more examples of this parser function.
Useful links to other help pages
Basics of Opasnet: What is Opasnet · Welcome to Opasnet · Opasnet policies · Open assessment · What is improved by Opasnet and open assessment? · FAQ |
How to participate?: Contributing to Opasnet · Discussions in Opasnet · Watching pages · Open assessment method |
How to edit pages?: Basic editing · More advanced editing · Quick reference for wiki editing · Wikipedia cheatsheet · Templates |
Help for more advanced participation: Copyright · Archiving pages · Copying from Wikipedia · ImageMap · SQL-queries · Analytica conventions · Developing variables · Extended causal diagram · GIS tool · Risk assessment · M-files · Stakeholders · Heande · Todo · Text from PDFs and pictures · Word2MediaWiki · Glossary terms · Formulae |
In Wikipedia:
- Quick guide to editing
- How to use refactoring
- How to archive argumentation. In pyrkilo, permanent link method should be used; not the subpage method, although is more common in Wikipedia.
- How to resolve disputes
- Magic words in Mediawiki
- en:Help:External link icons
- en:Help:Magic words