Difference between revisions of "How to MediaWiki Code"

From Tar Valon Library
Jump to: navigation, search
m (Protected "How to MediaWiki Code" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(copy editing thanks to Stasia)
 
Line 1: Line 1:
 
<div style="margin-left: 25px; float: right;">__TOC__</div>
 
<div style="margin-left: 25px; float: right;">__TOC__</div>
 
  
 
This is a short guide to the basic formatting we most often use in TarValon.Net's Library.
 
This is a short guide to the basic formatting we most often use in TarValon.Net's Library.
Line 9: Line 8:
 
</blockquote>
 
</blockquote>
  
TarValon.Net's wiki runs on a software called MediaWiki. MediaWiki.org also have a Formatting guide, which can be accessed [https://www.mediawiki.org/wiki/Help:Formatting here].
+
TarValon.Net's wiki runs on a software called MediaWiki. MediaWiki.org also has a Formatting guide, which can be accessed [https://www.mediawiki.org/wiki/Help:Formatting here].
 
MediaWiki is a wiki editing software created for use on Wikipedia, and remains in use on Wikipedia, but is also used in almost all other Wikimedia websites - wiktionary, wikidata, etc.
 
MediaWiki is a wiki editing software created for use on Wikipedia, and remains in use on Wikipedia, but is also used in almost all other Wikimedia websites - wiktionary, wikidata, etc.
  
Line 23: Line 22:
 
Top section heading (two equal signs) - <nowiki>==Title Written in Title Case==</nowiki>
 
Top section heading (two equal signs) - <nowiki>==Title Written in Title Case==</nowiki>
  
Sub section heading (three equal signs) - <nowiki>=== Title Written in Title Case ===</nowiki>
+
Subsection heading (three equal signs) - <nowiki>=== Title Written in Title Case ===</nowiki>
  
 
TarValon.Net Library does not use the highest level (Level 1) headings, therefore writing <nowiki>=Title=</nowiki> is prohibited.
 
TarValon.Net Library does not use the highest level (Level 1) headings, therefore writing <nowiki>=Title=</nowiki> is prohibited.
Line 30: Line 29:
  
 
==Paragraphs==
 
==Paragraphs==
To start a new paragraph, a single Enter/Return press in not enough. This is not very intuitive, but to create a new line in the rendered text, there should be a whole empty line left in the code, in order to start a new paragraph.  
+
To start a new paragraph, a single Enter/Return press is not enough. To create a new line in the rendered text, there should be a whole empty line left in the code, in order to start a new paragraph.  
 
   
 
   
 
<blockquote>
 
<blockquote>
Line 46: Line 45:
 
Text formatting is available, but not used too often. The most often uses are described below:
 
Text formatting is available, but not used too often. The most often uses are described below:
  
*To make text render Italic surround it in two single quotes: <nowiki>''italic text''</nowiki> - gives us ''italic text''.
+
*To make text render Italic, surround it in two single quotes: <nowiki>''italic text''</nowiki> - results in ''italic text''.
*To make text render Bold surround it in three single quotes: <nowiki>'''bold text'''</nowiki> - gives us '''bold text'''.
+
*To make text render Bold surround it in three single quotes: <nowiki>'''bold text'''</nowiki> - results in '''bold text'''.
*To make the text render Bold AND Italic, surround it in five single quotes: <nowiki>'''''italic and bold text'''''</nowiki> – gives us '''''italic and bold text'''''.
+
*To make the text render Bold AND Italic, surround it in five single quotes: <nowiki>'''''italic and bold text'''''</nowiki> – results in '''''italic and bold text'''''.
*To Underline text, use <nowiki><u>text</u></nowiki> - gives us <u>underlined text</u>.
+
*To Underline text, use <nowiki><u>text</u></nowiki> - results in <u>underlined text</u>.
*To have text stroked through, use <nowiki><s>text</s></nowiki> - gives us <s>striked through text</s>.
+
*To Strikethrough text, use <nowiki><s>text</s></nowiki> - results in <s>struck-through text</s>.
  
 
==Lists==
 
==Lists==
Line 117: Line 116:
 
<blockquote>Example: <nowiki>[[Page Title]]</nowiki></blockquote>
 
<blockquote>Example: <nowiki>[[Page Title]]</nowiki></blockquote>
  
If the page title is not what should be rendered on the page, you may try the following:
+
If the page title is not what should be rendered on the page, use the following:
  
 
<nowiki>[[Page Title|Name]]</nowiki> creates an internal link to the page with Name as the rendered text.
 
<nowiki>[[Page Title|Name]]</nowiki> creates an internal link to the page with Name as the rendered text.
Line 123: Line 122:
 
<blockquote>Example: <nowiki>[[Ilverin Matriam|Ilvy]]</nowiki> makes the word "Ilvy" link to the page "Ilverin Matriam".</blockquote>
 
<blockquote>Example: <nowiki>[[Ilverin Matriam|Ilvy]]</nowiki> makes the word "Ilvy" link to the page "Ilverin Matriam".</blockquote>
  
Sometimes, linking to outside sources might be necessary. In such cases, surround the url you wish to link to in single square brackets.
+
Sometimes, linking to outside sources might be necessary. In such cases, surround the URL to be linked to in single square brackets.
  
 
<blockquote>Example: <nowiki>[url-to-external-website]</nowiki></blockquote>
 
<blockquote>Example: <nowiki>[url-to-external-website]</nowiki></blockquote>
  
As with the internal links, you can render a certain text on the page, when using an external link. However, instead of a pipe character, only a space is needed to separate the link from the text.
+
As with the internal links, certain text can be rendered on the page when using an external link. However, instead of a pipe character, only a space is needed to separate the link from the text.
  
 
<blockquote>Example: <nowiki>[url-to-external-website Text to Show]</nowiki></blockquote>
 
<blockquote>Example: <nowiki>[url-to-external-website Text to Show]</nowiki></blockquote>
  
 
==Pages, Categories and Templates==
 
==Pages, Categories and Templates==
All of the brackets might get confusing for first time editors. This is how to distinguish them:
+
All of the brackets might get confusing for first-time editors. This is how to distinguish them:
 
*<nowiki>[[Red Ajah Aes Sedai]]</nowiki> - This is the link to a page.
 
*<nowiki>[[Red Ajah Aes Sedai]]</nowiki> - This is the link to a page.
 
*<nowiki>[[:Category:Red Ajah Aes Sedai]]</nowiki> - This is a link to a category.
 
*<nowiki>[[:Category:Red Ajah Aes Sedai]]</nowiki> - This is a link to a category.
 
*<nowiki>{{red2}}</nowiki> - this is a template, displaying the text Red Ajah and linking to the Red Ajah Community Page.  
 
*<nowiki>{{red2}}</nowiki> - this is a template, displaying the text Red Ajah and linking to the Red Ajah Community Page.  
  
Templates are created internally and are used internally only in TarValon.Net's Library. So a template that renders or formats certain text may exist in our Library, but not in any other wiki.
+
Templates are created internally and are used internally only in TarValon.Net's Library. So a template that renders or formats certain text may exist in the Library, but not in any other wiki.
  
 
Categories are used to group pages, whereas templates are mainly used to shorten long links and to link to pages within the community. (<nowiki>[[brown]]</nowiki> links to page on the Brown Ajah in the book series, whereas <nowiki>{{brown}}</nowiki> links to the TarValon.Net Ajah.)
 
Categories are used to group pages, whereas templates are mainly used to shorten long links and to link to pages within the community. (<nowiki>[[brown]]</nowiki> links to page on the Brown Ajah in the book series, whereas <nowiki>{{brown}}</nowiki> links to the TarValon.Net Ajah.)
  
We use a lot of Wheel of Time and TarValon.Net specific templates, to make things easier to type, for example:
+
The Library uses a lot of Wheel of Time and TarValon.Net specific templates to make things easier to type. For example:
  
 
*<nowiki>{{teotw|1}}</nowiki> is replaced with TEotW, Ch. 1 as a link.
 
*<nowiki>{{teotw|1}}</nowiki> is replaced with TEotW, Ch. 1 as a link.
Line 154: Line 153:
 
Tables are an excellent way of listing information. Tables are used a lot in TarValon.Net's Library.
 
Tables are an excellent way of listing information. Tables are used a lot in TarValon.Net's Library.
  
A basic table with two fields and two columns, as well as a title row on top would be coded like this:
+
A basic table with two fields and two columns, as well as a title row on top, would be coded like this:
 
  {<nowiki/>| class="wikitable"
 
  {<nowiki/>| class="wikitable"
 
  ! Title 1
 
  ! Title 1
Line 181: Line 180:
 
The table's start ( {| ) and end ( |} ) elements are absolutely required to create a table. Each row is separated by the ( |- ) character. A table cell in this row is separated by a single pipe character and it is written underneath the row. A cell beginning with an exclamation mark is rendered as table header.
 
The table's start ( {| ) and end ( |} ) elements are absolutely required to create a table. Each row is separated by the ( |- ) character. A table cell in this row is separated by a single pipe character and it is written underneath the row. A cell beginning with an exclamation mark is rendered as table header.
  
Make the table sortable by adding class ="wikitable sortable" to the top row.
+
To make the table sortable, add the class ="wikitable sortable" to the top row.
  
Determine the width of the table by adding width=percentage of page (e.g. width=50%).
+
To set the width of the table, add width=percentage of page (e.g. width=50%).
  
Determine the width of a separate column by adding the same to and before the title of that column (!width=15%|Title 1 will make that column take up 15% of the width of the table).
+
To set the width of a separate column, add the same to and before the title of that column (!width=15%|Title 1 will make that column take up 15% of the width of the table).
  
 
More on tables can be learned on MediaWiki.org’s help page on [https://www.mediawiki.org/wiki/Help:Tables tables].
 
More on tables can be learned on MediaWiki.org’s help page on [https://www.mediawiki.org/wiki/Help:Tables tables].

Latest revision as of 05:06, 23 May 2022

This is a short guide to the basic formatting we most often use in TarValon.Net's Library.

What is a Wiki?

"A wiki is a collaborative editing and working environment, containing multiple pages on certain topics, either public or limited, to use within an organization for maintaining its internal knowledge base. A wiki is enabled by wiki software, also known as wiki engines."

TarValon.Net's wiki runs on a software called MediaWiki. MediaWiki.org also has a Formatting guide, which can be accessed here. MediaWiki is a wiki editing software created for use on Wikipedia, and remains in use on Wikipedia, but is also used in almost all other Wikimedia websites - wiktionary, wikidata, etc.

Starting to edit an article happens when the Edit button in the Navigation bar is clicked. Editing can be done either by manually writing code or using the toolbar at the top of the editing area.

Headings

Section headings, headlines, or just headings, separate different sections of information on the page. The headings usually describe what the section that follows will be about.

Each section can have subsections, which are also headings.

To create a heading, the title of the heading (written in title case) should be surrounded by an equal number of equal signs. Text should not be put on the same line after the equal signs.

Top section heading (two equal signs) - ==Title Written in Title Case==

Subsection heading (three equal signs) - === Title Written in Title Case ===

TarValon.Net Library does not use the highest level (Level 1) headings, therefore writing =Title= is prohibited.

Placing more than three headings on a page will create a Table of Contents (TOC) at the top of the page. If a Table of Contents is unnecessary on the page, __NOTOC__ should be written at the top of the page.

Paragraphs

To start a new paragraph, a single Enter/Return press is not enough. To create a new line in the rendered text, there should be a whole empty line left in the code, in order to start a new paragraph.

Example: Rand al'Thor is a young man from the Two Rivers.

[a whole empty line]

Rand al'Thor is also NOT born in the Two Rivers.

Long text paragraphs are automatically wrapped on the next line, so in cases where sentences are very long, there is no need to break lines.

Basic Text Formatting

Text formatting is available, but not used too often. The most often uses are described below:

  • To make text render Italic, surround it in two single quotes: ''italic text'' - results in italic text.
  • To make text render Bold surround it in three single quotes: '''bold text''' - results in bold text.
  • To make the text render Bold AND Italic, surround it in five single quotes: '''''italic and bold text''''' – results in italic and bold text.
  • To Underline text, use <u>text</u> - results in underlined text.
  • To Strikethrough text, use <s>text</s> - results in struck-through text.

Lists

Lists are used to combine several items of the same kind. By default the TarValon.Net Library uses bulleted, or unordered lists, but there might be instances of ordered or numbered lists.

To create a list in the wiki, you need to add special characters to the beginning of each list item. The special characters tell the software how to format the list on screen.

Wikitext Rendering
For bulleted lists
*List item 1
*List item 2
  • List item 1
  • List item 2
For numbered lists
#List item 1
#List item 2
  1. List item 1
  2. List item 2
Need indented lists? It is also possible.
*List item 1
** List item 1.2

#List item 1
##List item 1.2
  • List item 1
    • List item 1.2
  1. List item 1
    1. List item 1.2
Definition Lists
;List item 1
: definition 1

;List item 2
: definition 2-1
: definition 2-2
List item 1
definition 1
List item 2
definition 2-1
definition 2-2

Links

Linking to pages in the wiki is one of the most common editing cases. To link to a page of TarValon.Net Library, put the name of the page in double square brackets.

Example: [[Page Title]]

If the page title is not what should be rendered on the page, use the following:

[[Page Title|Name]] creates an internal link to the page with Name as the rendered text.

Example: [[Ilverin Matriam|Ilvy]] makes the word "Ilvy" link to the page "Ilverin Matriam".

Sometimes, linking to outside sources might be necessary. In such cases, surround the URL to be linked to in single square brackets.

Example: [url-to-external-website]

As with the internal links, certain text can be rendered on the page when using an external link. However, instead of a pipe character, only a space is needed to separate the link from the text.

Example: [url-to-external-website Text to Show]

Pages, Categories and Templates

All of the brackets might get confusing for first-time editors. This is how to distinguish them:

  • [[Red Ajah Aes Sedai]] - This is the link to a page.
  • [[:Category:Red Ajah Aes Sedai]] - This is a link to a category.
  • {{red2}} - this is a template, displaying the text Red Ajah and linking to the Red Ajah Community Page.

Templates are created internally and are used internally only in TarValon.Net's Library. So a template that renders or formats certain text may exist in the Library, but not in any other wiki.

Categories are used to group pages, whereas templates are mainly used to shorten long links and to link to pages within the community. ([[brown]] links to page on the Brown Ajah in the book series, whereas {{brown}} links to the TarValon.Net Ajah.)

The Library uses a lot of Wheel of Time and TarValon.Net specific templates to make things easier to type. For example:

  • {{teotw|1}} is replaced with TEotW, Ch. 1 as a link.
  • {{teotw2|Chapter 1}} is replaced with The Eye of the World, Chapter 1, as a link.
  • {{BWB}} is replaced by The World of Robert Jordan's "The Wheel of Time", Chapter .
  • {{bwb}} is replaced by TWoRJTWoT, Ch.
  • {{main|article}} is replaced by Main article: article, with article as a link.

All the TarValon templates used in the Library can be found under Category:Templates.

Tables

Tables are an excellent way of listing information. Tables are used a lot in TarValon.Net's Library.

A basic table with two fields and two columns, as well as a title row on top, would be coded like this:

{| class="wikitable"
! Title 1
! Title 2
|-
| Column 1 Row 1
| Column 2 Row 1
|-
| Column 1, Row 2
| Column 2, Row 2
|}

To render the following table:

Title 1 Title 2
Column 1, Row 1 Column 2, Row 1
Column 1, Row 2 Column 2, Row 2

The table's start ( {| ) and end ( |} ) elements are absolutely required to create a table. Each row is separated by the ( |- ) character. A table cell in this row is separated by a single pipe character and it is written underneath the row. A cell beginning with an exclamation mark is rendered as table header.

To make the table sortable, add the class ="wikitable sortable" to the top row.

To set the width of the table, add width=percentage of page (e.g. width=50%).

To set the width of a separate column, add the same to and before the title of that column (!width=15%|Title 1 will make that column take up 15% of the width of the table).

More on tables can be learned on MediaWiki.org’s help page on tables.


For more information, feel free to contact the Director of Research and Records at library@tarvalon.net.