Difference between revisions of "Help:MediaWiki basics/Beginner training"

From LIMSWiki
Jump to navigationJump to search
m (→‎Links: New example)
(Added more content.)
Line 58: Line 58:
Consult the relevant [[Help:Contents#Links|Help:Contents]] section for more information.
Consult the relevant [[Help:Contents#Links|Help:Contents]] section for more information.


===Templates===
===Text formatting===
 
Let's get back to that box with text and a big blue "i" at the top. We call that an "infobox." That's created using the template "ombox," referenced above in the first set of example links. Open one of those links in a new tab or window to learn more about this template.
 
Templates are distinct because they contain two braces in front (like this: <nowiki>{{</nowiki> ) and two in the back (like this: <nowiki>}}</nowiki> ).
 
Here are some internal links to pages on this wiki that utilize a variety of different templates. Let's look at each page (open in a new tab or window) and choose the "edit" option to see the code:
 
* [[LIMS vendor]]
* [[LIMSWiki:Vendor page]]
* [[2nd Sight Solutions]]
* [[National Cancer Institute]]
* [[LIMSWiki:Product page]]
 
Consult the relevant [[Help:Contents#Templates|Help:Contents]] section for more information.
 
===Formatting text===


====Bold text====
====Bold text====
Line 81: Line 65:


I can even make a link appear in bold like this: '''[[LIMS vendor]]'''
I can even make a link appear in bold like this: '''[[LIMS vendor]]'''
<pre>
How did I do that? I simply added three apostrophes to each side like so:


'''Here I bold this text for effect'''
How did I do that? I simply added three apostrophes to each side like so: <code><nowiki>'''Here I bold this text for effect'''</nowiki></code> yields... '''Here I bold this text for effect''' and <code><nowiki>'''[[LIMS vendor]]'''</nowiki></code> yields... '''[[LIMS vendor]]'''
 
'''[[LIMS vendor]]'''
</pre>


====Italic text====
====Italic text====
Line 95: Line 74:
Like bold text, I can italicize a link like this: ''[[LIMS vendor]]''
Like bold text, I can italicize a link like this: ''[[LIMS vendor]]''


<pre>
How did I do that? I simply added two apostrophes to each side like so: <code><nowiki>''Here's italic text for you''</nowiki></code> yields... ''Here's italic text for you'' and <code><nowiki>''[[LIMS vendor]]''</nowiki></code> yields...''[[LIMS vendor]]''
How did I do that? I simply added two apostrophes to each side like so:
 
''Here's italic text for you''
 
''[[LIMS vendor]]''
</pre>
 
====Preformatted text====
 
You'll notice so far I've used several instances of gray boxes with wiki code in them on this page. How do you display that wiki code like that without the browser running it? You do it by using the preformatted text tag:
 
<pre>&lt;pre&gt;This is preformatted text. Here is the ombox code used on this page:
 
{{ombox
| type      = notice
| style    = width: 960px;
| text     = This is my sandbox, where I play with features and test MediaWiki code. If you wish to leave a comment for me, please see [[User_talk:Shawndouglas|my discussion page]] instead.<p></p>
}}
&lt;/pre&gt;</pre>
 
So you essentially use the <nowiki><pre></nowiki> tag to display the code without rendering it.
 
But wait a minute. How did I just get the <nowiki><pre></nowiki> tag to show on the page without the browser running it? In this sentence and the one previous to this, I used a different technique to display the tag:
 
<pre>
&lt;nowiki&gt;&lt;pre&gt;&lt;/nowiki&gt;
</pre>
 
I used the <nowiki><nowiki></nowiki> tag to display what would otherwise be rendered as code. Note that with both tags, I had to "close" their use with a corresponding duplicate but with the "/" character in front of the word.
 
This may seem a bit confusing at first, but don't worry. You'll get the hang of this type of formatting. I wanted to introduce it for the next topic: spacing.


====Spacing====
====Spacing====
Line 139: Line 87:
</pre>
</pre>


Notice what happens if I don't put a space between the lines of text in the edit screen? The lines run together. You'd think putting a line under another with a hard return would be enough, but it's not. You must add an additional hard return, creating a space between the lines in the edit box.
Notice what happens if I don't put a space between the lines of text in the edit screen? The lines run together. You'd think putting a line under another with a hard return would be enough, but it's not. You must add an additional hard return, creating a space between the lines in the edit box. I actually want it to look like this:
 
I actually want it to look like this:


This is my first line of text.
This is my first line of text.
Line 155: Line 101:
</pre>
</pre>


There are several relevant [[Help:Contents]] sections with more information about text formatting.
Several other relevant text formatting techniques exist, but we'll get to them in the [[Help:MediaWiki basics/Intermediate training|intermediate training guide]].


===Organizing text===
===Organizing text===
====Headings and subheadings====


If you are viewing the code to this page, you'll notice there are several bits of code with numerous "=" signs. These are responsible for creating headings and subheadings.
If you are viewing the code to this page, you'll notice there are several bits of code with numerous "=" signs. These are responsible for creating headings and subheadings.


You'll notice the first example:
<pre>
<pre>
You'll notice the first example:
==Getting started with MediaWiki==
 
</pre>
==Sandbox begins below==


This is the first level of headings, the section heading. You do this by placing two "=" in front and behind some text.  
This is the first level of headings, the section heading. You do this by placing two "=" in front and behind some text.  
</pre>


'''NOTE''': ''Know we have a rule here, just as in Wikipedia; with the exception of proper nouns, only the first word of the heading or subheading is capitalized! In this case, it's "Organizing text," not "Organizing Text."''
'''NOTE''': ''Know we have a rule here, just as in Wikipedia; with the exception of proper nouns, only the first word of the heading or subheading is capitalized!'' In this case, it's "Getting started with MediaWiki", not "Getting Started With MediaWiki".


If you look under the heading "Getting started with MediaWiki", you'll notice numerous subheadings. And in the subsection "Text formatting" there is yet another subheading below that:
<pre>
<pre>
If you look under the heading "Sandbox begins below," you'll notice numerous subheadings. And in the subsection "Formatting text" there is yet another subheading below that:
===Text formatting===
 
===Formatting text===


====Bold text====
====Bold text====
</pre>


Simply add another "=" to the front and back to create an additional subheading.
Simply add another "=" to the front and back to create an additional subheading.
</pre>


You can also create ordered and unordered lists, add definition lists, add extra spacing in the front of text (useful for commenting on talk pages), and how to sign your comments (also very important). Learn about these items and more in the relevant [[Help:Contents#Organizing_your_writing|Help:Contents]] section.
====Bulleted and numbered lists====


===Citation===
In several subsections of this page, you should have noticed two types of lists: bulleted and numbered lists. Both are simple to use and effective for organizing information in a wiki entry.


To begin using citations, it's easy to start with a copy/paste of existing citation code. Inline citations are added directly after a piece of information or quote in a body of wiki text.
First let's look at the code for the first couple of bulleted items in the the [[Help:MediaWiki basics/Beginner training#Creating|Creating a page]] section:


You'll want to use this page as your initial guide: [[LIMSWiki:Citation guidelines]]
<pre>
 
* [[User:Shawndouglas]] (in the "User" namespace)
It details the citation code you'll use on probably 95 percent of the references you make: Cite web, Cite book, and Cite journal
* [[Help:MediaWiki basics]] (in the "Help" namespace; note the lowercase "basics")
</pre>


You can copy code from there, paste it into your edit, and then edit the values of the fields. That page also has links to the original templates in case you need additional attributes not listed in the examples.
Adding an asterisk (*) in front of the lines of text produced a bulleted list. Feel free to place the bulleted items as shown above or add a hard return between each item (exhibited in the [[Help:MediaWiki basics/Beginner training#Links|Links]] section of this page) to space out your bulleted items.  


Also, it's imperative to include a references section on any page that includes inline citations. Otherwise, pages won't show up properly. You do that by placing the following code:
Now let's look at the code for the first couple of numbered items in the the [[Help:MediaWiki basics/Beginner training#Links|Links]] section:


<pre>
<pre>
==References==
# This is an internal link to the "Laboratory" page (on this wiki): [[Laboratory]]
<references />
# This is an internal link to the "Laboratory" page, but this time making different text appear for the link: [[Laboratory|I'm such a rebel]]
</pre>
</pre>


===Images===
Adding the pound sign (#) in front of the lines of text produced an ordered numerical list. Notice no extra hard return was placed between the two items. This is an important distinction: look what happens if we separate the two lines with a hard return:
 
# This is an internal link to the "Laboratory" page (on this wiki): [[Laboratory]]
 
# This is an internal link to the "Laboratory" page, but this time making different text appear for the link: [[Laboratory|I'm such a rebel]]


[[File:Wiki puzzle.svg|Wiki puzzle]]This is me playing with linking to images on Wikimedia Commons. We'll get into image uploading and linking a little later.
Several other relevant text organization techniques exist, but we'll get to them in the [[Help:MediaWiki basics/Intermediate training|intermediate training guide]].

Revision as of 23:18, 20 October 2013

Getting started with MediaWiki

Note: When opening links from wiki pages, right-click a link and choose to open it in a new tab. This should make navigating your way through the wiki less complex.

You'll notice a box with text and a big blue "i" in it above. We'll get to that in a bit. But first let's talk about...

Creating a page

A wiki is made up of parent pages and subpages, and each page has a unique title. When choosing a title for a page on LIMSwiki, the editor must be aware of the naming conventions for article titles. That previous blue link takes you to a page explaining those rules, including using lower case, using singular nouns, and avoiding abbreviations among others. Right-click that link, open it in a new tab, and read more about these naming conventions.

Done? The next thing we need to know about titles and page creation is that choosing a correct namespace is vital. Namespaces are a mechanism for grouping/separating wiki pages, differentiating between the purpose of the pages at a high level. Pages in certain namespaces can have special properties or behave differently when they interact with other pages. Namespaces are indicated in page titles by prefixing the page name with "namespace:", so the prefix "Help:" in this page's title ("Help:MediaWiki basics/Beginner training") indicates that this page is in the Help namespace. A page whose name is not prefixed by a namespace lies in the mainspace.

If you're not sure what space your page belongs in, you might want to check out Help:Namespaces.

How to create a page

The easiest way to create a new page on this site is to use this wiki's "create a new page" tool. Following the previously mentioned naming conventions, choose the correct namespace and simply enter the title of the parent page. For non-mainspace pages, be sure to add the title after the namespace prefix.

Otherwise, simply type the full title of the page you wish to create into the search box on any page and select "Go". If the page does not already exist, you'll be asked if you want to create it. For example, if you wish to create a page titled "Nuclear reactor", type it into the search box, select "Go", and you'll see "Create the page 'Nuclear reactor" on this wiki!"

Finally, to create a subpage, simply add a / and the subtitle, following the usual naming conventions. This page you are on ("Help:MediaWiki basics/Beginner training") is an example of a subpage of Help:MediaWiki basics. Subpages should be created sparingly if at all.

Examples of page titles:

Links

Links provide embedded navigation to other content within the wiki or to content outside the wiki. They are an important part of wiki editing and provide convenient avenues for further user research.

Here are four of the most common link formation methods in MediaWiki:

  1. This is an internal link to the "Laboratory" page (on this wiki): Laboratory
  2. This is an internal link to the "Laboratory" page, but this time making different text appear for the link: I'm such a rebel
  3. This is an external link to the same page located on Wikipedia: [1]
  4. This is an external link to the same page located on Wikipedia, using different link text: Wikipedia's page on the laboratory

You should notice the differences between internal and external links and how to format them:

  • You can make an internal link by using a set of double square brackets. The title can be left as the default: [[Laboratory informatics]] yields... Laboratory informatics
  • Or you can give it a new title by adding a pipe (|) and then typing the text you want to appear in place of the original: [[Laboratory informatics|cool laboratory stuff]] yields... cool laboratory stuff
  • You can make an external link by using a set of single square brackets. The title can be left blank: [http://clinfowiki.org] yields... [2]
  • However, it's better you give it a title by adding one space and typing the text you want to appear in place of the URL: [http://clinfowiki.org ClinfoWiki.org] yields... ClinfoWiki.org

Consult the relevant Help:Contents section for more information.

Text formatting

Bold text

Here I bold this text for effect: Do you think it looks ok?

I can even make a link appear in bold like this: LIMS vendor

How did I do that? I simply added three apostrophes to each side like so: '''Here I bold this text for effect''' yields... Here I bold this text for effect and '''[[LIMS vendor]]''' yields... LIMS vendor

Italic text

Here's italic text for you: What do you think?

Like bold text, I can italicize a link like this: LIMS vendor

How did I do that? I simply added two apostrophes to each side like so: ''Here's italic text for you'' yields... Here's italic text for you and ''[[LIMS vendor]]'' yields...LIMS vendor

Spacing

This is my first line of text. This is my second line of text.

Here's what I entered into the edit box to get the above to appear:

This is my first line of text.
This is my second line of text.

Notice what happens if I don't put a space between the lines of text in the edit screen? The lines run together. You'd think putting a line under another with a hard return would be enough, but it's not. You must add an additional hard return, creating a space between the lines in the edit box. I actually want it to look like this:

This is my first line of text.

This is my second line of text.

So I have to edit it like this in the code:

This is my first line of text.

This is my second line of text.

Several other relevant text formatting techniques exist, but we'll get to them in the intermediate training guide.

Organizing text

Headings and subheadings

If you are viewing the code to this page, you'll notice there are several bits of code with numerous "=" signs. These are responsible for creating headings and subheadings.

You'll notice the first example:

==Getting started with MediaWiki==

This is the first level of headings, the section heading. You do this by placing two "=" in front and behind some text.

NOTE: Know we have a rule here, just as in Wikipedia; with the exception of proper nouns, only the first word of the heading or subheading is capitalized! In this case, it's "Getting started with MediaWiki", not "Getting Started With MediaWiki".

If you look under the heading "Getting started with MediaWiki", you'll notice numerous subheadings. And in the subsection "Text formatting" there is yet another subheading below that:

===Text formatting===

====Bold text====

Simply add another "=" to the front and back to create an additional subheading.

Bulleted and numbered lists

In several subsections of this page, you should have noticed two types of lists: bulleted and numbered lists. Both are simple to use and effective for organizing information in a wiki entry.

First let's look at the code for the first couple of bulleted items in the the Creating a page section:

* [[User:Shawndouglas]] (in the "User" namespace)
* [[Help:MediaWiki basics]] (in the "Help" namespace; note the lowercase "basics")

Adding an asterisk (*) in front of the lines of text produced a bulleted list. Feel free to place the bulleted items as shown above or add a hard return between each item (exhibited in the Links section of this page) to space out your bulleted items.

Now let's look at the code for the first couple of numbered items in the the Links section:

# This is an internal link to the "Laboratory" page (on this wiki): [[Laboratory]]
# This is an internal link to the "Laboratory" page, but this time making different text appear for the link: [[Laboratory|I'm such a rebel]]

Adding the pound sign (#) in front of the lines of text produced an ordered numerical list. Notice no extra hard return was placed between the two items. This is an important distinction: look what happens if we separate the two lines with a hard return:

  1. This is an internal link to the "Laboratory" page (on this wiki): Laboratory
  1. This is an internal link to the "Laboratory" page, but this time making different text appear for the link: I'm such a rebel

Several other relevant text organization techniques exist, but we'll get to them in the intermediate training guide.