Difference between revisions of "Help:Editing"

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 2.7. Up-to-date documentation for the latest stable version of Moodle may be available here: Editing.

(editing basics, wikitext markup)
 
(See also: tidying up links)
 
(145 intermediate revisions by 50 users not shown)
Line 1: Line 1:
== Editing Basics ==
+
{{Help}}
 +
This page is for editing Moodle Documentation (MoodleDocs), which is based on MediaWiki format (similar to Wikipedia).
  
;Start editing
+
==Edit tab==
:To start editing a page, click on the "'''Edit this page'''" (or just "'''edit'''") link at one of its edges. This will bring you to the '''edit page''': a page with a text box containing the ''wikitext'': the editable source code from which the server produces the webpage.
+
Every MoodleDoc page has an "edit" tab at the top . This link will let you edit the page you are viewing. Please try editing a page by using this  [[Sandbox|sandbox link]]. We will cover more formatting and special MoodleDoc features below.  The edit tool bar is easy to use.  
  
;Summarize your changes
+
There are 3 parts to the edit page: the content areas to edit with its toolbar at the top;  the save, preview, changes and summary box; the preview area.
:You should write a short edit summary in the small field below the edit-box.
 
  
;Preview before saving
+
===Edit tool bar===
:When you have finished, press preview to see how your changes will look - '''before''' you make them permanentRepeat the edit/preview process until you are satisfied, then click "Save" and your changes will be immediately applied to the article.
+
[[Image:MoodleDocs Edit Toolbar.png|frame|center|Edit tool bar]]
 +
Hold the mouse cursor over the edit tool bar to see what functions each icon will doFrom left to right:  Bold, Italics, Internal (page) link, external link, Level 2 heading, embedded image, media file link, mathematical formula, no wiki, signature and time stamp, horizontal line.
  
== Wikitext markup ==
+
=== Show preview ===
{| border="1" cellpadding="2" cellspacing="0"
+
[[Image:MoodleDocs save edit area 1.png|frame|center|Example of the save, preview, comment area below the edit box]]
|-
+
In edit mode, the show preview button at the bottom of the page lets you see what the page will look like after your edit, before you actually save.  We all make mistakes; this feature lets you catch them immediately.  Using Show preview before saving also lets you try format changes and other edits without cluttering up the page history, and has a number of other advantages.  Don't forget to save your edits after previewing, though!
!What it looks like
+
 
!What you type
+
=== Edit summary ===
|-
+
Before saving the page, it's considered good practice to enter a very brief summary of your changes in the summary box below the edit-box. 
|
 
Start sections with header lines
 
  
Note: Single equal signs give the highest level heading, like the page title; usually projects have the convention not to use them.
+
In the example above, the contributor used the edit link next to a heading called "Tips and tricks". MoodleDocs automatically added "/* Tips and tricks */" to the summary box. The  The contributor added a comment "Put comment here about edit - will rollback".
  
<!-- This is the original
+
See [[Help:Editing#Page history|Page history below]] where the example is continued.
= DO NOT USE THIS =
 
== New section ==
 
=== Subsection ===
 
==== Sub-subsection ====
 
-->
 
  
<!-- next set
+
===Show changes===
<h1> DO NOT USE THIS </h1>
+
This button will change the preview area. One column will show current areas that will be changed and another column will show the resulting changes from what has been done in the content editing box.
<h2> New section </h2>
 
<h3> Subsection </h3>
 
<h4> Sub-subsection </h4>
 
-->
 
  
<!-- This code prevents confusion in the section editing feature-->
+
== Formatting ==
<b><font style="font-size:120%"> New section </font></b>
 
  
<b><font style="font-size:110%"> Subsection</font></b>
+
Most '''formatting'''  in MoodleDocs is usually done with MediaWiki markup - you don't have to learn HTML!
  
<b><font style="font-size:100%"> Sub-subsection</font></b>
+
=== Bold and italics ===
 +
'''Bolding''' and ''italicizing'' is done by surrounding a word or phrase with multiple apostrophes (<tt>'</tt>):
  
*Start with a second-level heading (<tt><nowiki>==</nowiki></tt>); don't use first-level headings (=).
+
:<code><nowiki>''italics''</nowiki></code> appears as ''italics''. (2 apostrophes on both sides)
*Don't skip levels (for example, second-level followed by fourth-level).
+
:<code><nowiki>'''bold'''</nowiki></code> appears as '''bold'''. (3 apostrophes on both sides)
*A [[#Table of contents|table of contents]] will automatically be added to an article that has four or more sections.
+
:<code><nowiki>'''''bolded italics'''''</nowiki></code> appears as '''''bolded italics'''''.  (5 apostrophes on both sides)
*If you want to keep headings out of the TOC you have to use HTML heading tags and close them without using a slash e.g. <nowiki><h4>heading too low level to be in the toc of large page<h4></nowiki>.
 
|<pre><nowiki>
 
  
== New section ==
+
=== Headings and subheadings ===
 +
Headings and subheadings are an easy way to improve the organization of an article.
  
=== Subsection ===
+
Headings can be created like this:
 +
:<code><nowiki>==Top level heading==</nowiki></code> (2 equals signs)
 +
:<code><nowiki>===Subheading===</nowiki></code> (3 equals signs)
 +
:<code><nowiki>====Another level down====</nowiki></code> (4 equals signs)
  
==== Sub-subsection ====
+
If an article has at least four headings, a table of contents will automatically be generated.
</nowiki></pre>
 
  
 +
=== Indentations ===
 +
The simplest way of indenting is to place a colon (<code>:</code>) at the beginning of a line. The more colons you put, the further indented the text will be. A newline marks the end of the indented paragraph e.g.
 +
:<code>This is aligned all the way to the left.</code>
 +
:<code><nowiki>:</nowiki>This is indented slightly.</code>
 +
:<code><nowiki>::</nowiki>This is indented more.</code>
 +
is shown as
 +
:This is aligned all the way to the left.
 +
::This is indented slightly.
 +
:::This is indented more.
  
 +
=== Lists ===
 +
{| class="nicetable"
 
|-
 
|-
|
+
!What it looks like
;Newline:
+
!What you type
 
 
A single
 
newline
 
has no
 
effect on the
 
layout.
 
 
 
But an empty line
 
starts a new paragraph,
 
or ends a list or indented part.
 
(<nowiki><p></nowiki> disables this paragraphing until <nowiki></p></nowiki> or the end  of the section)
 
 
 
You can make the wikitext more readable by putting in newlines.
 
 
 
|<pre><nowiki>
 
 
 
A single
 
newline
 
has no
 
effect on the
 
layout.
 
 
 
But an empty line
 
starts a new paragraph.</nowiki></pre>
 
 
 
 
|-
 
|-
 
|
 
|
Line 92: Line 69:
 
*in a list   
 
*in a list   
 
marks the end of the list.
 
marks the end of the list.
*Of course
 
*you can
 
*start again.
 
  
 
|<pre><nowiki>* Unordered Lists are easy to do:
 
|<pre><nowiki>* Unordered Lists are easy to do:
Line 102: Line 76:
 
*in a list   
 
*in a list   
 
marks the end of the list.
 
marks the end of the list.
*Of course
 
*you can
 
*start again.
 
 
 
</nowiki></pre>
 
</nowiki></pre>
 
|-
 
|-
Line 115: Line 85:
 
#in a list   
 
#in a list   
 
marks the end of the list.
 
marks the end of the list.
#New numbering starts
 
#with 1.
 
 
 
|<pre><nowiki># Numbered lists are also good
 
|<pre><nowiki># Numbered lists are also good
 
## very organized
 
## very organized
Line 124: Line 91:
 
#in a list   
 
#in a list   
 
marks the end of the list.
 
marks the end of the list.
#New numbering starts
 
#with 1.
 
 
</nowiki></pre>
 
</nowiki></pre>
 
|-
 
|-
|
+
|Descriptive lists:
* You can even do mixed lists
+
; first tag : accompanying description
*# and nest them
+
; second tag : more description
*#* or break lines<br>in lists
+
; third tag : surprise! more description
|<pre><nowiki>* You can even do mixed lists
+
|<pre><nowiki>Descriptive lists:
*# and nest them
+
; first tag : accompanying description
*#* or break lines<br>in lists</nowiki></pre>
+
; second tag : more description
 +
; third tag : surprise! more description
 +
</nowiki></pre>
 +
|}
 +
 
 +
=== Preserving formatting ===
 +
 
 +
{| class="nicetable"
 
|-
 
|-
|'''Definition list'''
+
!What it looks like
; word : definition of the word
+
!What you type
; longer phrase
 
: phrase defined
 
|<pre><nowiki>; word : definition of the word
 
; longer phrase
 
: phrase defined</nowiki></pre>
 
 
 
* One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.
 
 
|-
 
|-
 
|
 
|
;indenting
+
Leading spaces are another way to preserve formatting.
:A colon indents a line or paragraph.
+
 
A manual newline starts a new paragraph.
+
Putting a space at the beginning of each line
* This is often used for discussion on [[Help:Talk page|Talk page]]s.
+
  stops the text from being reformatted.  
|<pre><nowiki>: A colon indents a line or paragraph.
+
|<pre><nowiki>Leading spaces are another way to preserve formatting.
A manual newline starts a new paragraph.
 
</nowiki></pre>
 
|-
 
|
 
When there is a need for separating a block of text
 
<blockquote>
 
the '''blockquote''' command will indent both margins when needed instead of the left margin only as the colon does. 
 
</blockquote>
 
This is useful for (as the name says) inserting blocks of quoted (and cited) text.  
 
|
 
<pre><nowiki>
 
<blockquote>
 
The '''blockquote''' command will indent
 
both margins when needed instead of the  
 
left margin only as the colon does. 
 
</blockquote>
 
</nowiki></pre>
 
|-
 
|<center>Centered text.</center>
 
* Please note the US-English spelling of "center".
 
|<pre><nowiki><center>Centered text.</center></nowiki></pre>
 
|-
 
|A horizontal dividing line:
 
this is above it...
 
----
 
...and this is below it.
 
  
If you don't use a section header, you don't get a TOC entry.
+
Putting a space at the beginning of each line
|<pre><nowiki>A horizontal dividing line:
+
stops the text from being reformatted.
this is above it...
 
----
 
...and this is below it.
 
 
</nowiki></pre>
 
</nowiki></pre>
 
|}
 
|}
  
=== Links, URLs ===
+
You can also use <nowiki><pre></nowiki> tags.
==== Internal links ====
+
 
*Enclose the '''target name''' in double square brackets -- <nowiki>"[[" and "]]"</nowiki>
+
A "nowiki" tag on either side of text area, starts and stops wiki formatting within a line of text. For example, placing the tags here <nowiki> <nowiki> turns off linking [[Main page]] </nowiki> </nowiki> and then starts the wiki formatting again. Here is the same link [[Main page]] without the tags on either side.  
*First letter of target name is automatically capitalized
+
 
*Spaces are represented as underscores (but don't do underscores yourself)
+
The HTML edit tool bar has a nowiki icon.
*[[the weather in London|Links to nonexistent pages]] are shown in red -- [[Help:Starting a new page]] tells about creating the page.
+
 
*When the mouse cursor "hovers" over the link, you see a "hover box" containing...
+
===PHP syntax higlighting===
{| border="1" cellpadding="2" cellspacing="0"
+
 
 +
{| class="nicetable"
 
|-
 
|-
 
!What it looks like
 
!What it looks like
Line 200: Line 137:
 
|-
 
|-
 
|
 
|
;Basic
+
<code php>$user = $DB->get_record('user', array('id'=>'1');</code>
Sue is reading the [[official position]]
+
|<pre><nowiki><code php>$user = $DB->get_record('user', array('id'=>'1');</code></nowiki></pre>
(or [[Official position]]s).
+
|}
|<pre><nowiki>Sue is reading the
+
 
[[official position]]
+
===Tables===
(or [[Official position]]s).</nowiki></pre>
+
 
 +
See [http://meta.wikimedia.org/wiki/Help:Table#Spreadsheet_to_wiki_table_format the Mediawiki help] for full details of the table syntax.
 +
 
 +
{| class="nicetable"
 
|-
 
|-
|
+
!What it looks like
;Interwiki linking
+
!What you type
A link to the page on another wiki (e.g. the same subject in another language)
 
*For more info see [[m:Help:Interwiki linking]].
 
*[[:fr:Wikipédia:Aide]].
 
|<pre><nowiki>
 
*For more info see [[m:Help:Interwiki linking]].
 
*[[:fr:Wikipédia:Aide]].
 
</nowiki></pre>
 
 
|-
 
|-
|
+
| A table:
;Section of page
+
 
*[[List of cities by country#Morocco]].
+
{| class="nicetable"
*[[List of cities by country#Sealand]].
 
If the section doesn't exist, the link goes to the top of the page.
 
If there are multiple sections by the same name, link to specific ones by adding how many times that header has alreay appeared (e.g. if there are 3 sections entitled "Example header," and you wish to link to the third one, then use <nowiki>[[#Example section 3]]</nowiki>. For more info, see [[Help:Editing FAQ#Q: Can I link to a specific section header if there are multiple section headers of the same name? If so, how?|Help:Editing FAQ]].
 
|
 
<pre><nowiki>*[[List of cities by country#Morocco]].
 
*[[List of cities by country#Sealand]].</nowiki></pre>
 
<pre><nowiki></nowiki></pre>
 
 
|-
 
|-
|
+
! header 1
;[[Help:Piped link|Piped link]]
+
! header 2
Use a pipe "'''|'''" to create a '''link label''':
+
! header 3
*[[Help:Link|About Links]]
 
*[[List of cities by country#Morocco|
 
Cities in Morocco]]
 
|<pre><nowiki>*[[Help:Link|About Links]]
 
*[[List of cities by country#Morocco|
 
Cities in Morocco]]
 
</nowiki></pre>
 
 
|-
 
|-
|'''"blank" pipes''' hide:
+
| row 1, cell 1
*Words in parentheses: [[kingdom (biology)|kingdom]].
+
| row 1, cell 2
*Namespace: [[Meta:Requests for adminship|Requests for adminship]].
+
| row 1, cell 3
After you save, the server automatically fills in the link label.
 
|<pre><nowiki>*In parentheses: [[kingdom (biology)|]].
 
*Namespace: [[Meta:Requests for adminship|]].</nowiki></pre>
 
 
|-
 
|-
|
+
| row 2, cell 1
;Links to nonexistent pages
+
| row 2, cell 2
[[The weather in London]] is a page that doesn't exist yet.
+
| row 2, cell 3
*You can create it by clicking on the link.
+
|}
*Have a look at [[Help:Starting a new page|how to start a page]] guide and the naming conventions page for your project.
+
 
|<pre><nowiki>[[The weather in London]] is a page
+
| <pre><nowiki>A table:
that doesn't exist yet.</nowiki></pre>
+
 
 +
{| class="nicetable"
 
|-
 
|-
|
+
! header 1
;Link to yourself
+
! header 2
You should "sign" your comments on talk pages:
+
! header 3
: Your user name: [[User:Karl Wick|Karl Wick]]
 
: Or your user name plus date/time: [[User:Karl Wick|Karl Wick]] 08:10 Oct 5, 2002 (UTC)
 
The server will fill in the link after you save.
 
|<pre><nowiki>You should "sign" your comments on talk pages:
 
: Your user name: ~~~
 
: Or your user name plus date/time: ~~~~
 
</nowiki></pre>
 
 
|-
 
|-
|
+
| row 1, cell 1
;[[Help:Redirect|Redirect]]s
+
| row 1, cell 2
one article title to another with this special link.
+
| row 1, cell 3
|<pre><nowiki>#REDIRECT [[United States]]</nowiki></pre>
 
 
|-
 
|-
|
+
| row 2, cell 1
;"Magic" links
+
| row 2, cell 2
* [[w:ISBN|ISBN]] links to books: ISBN 0123456789X (See [[Help:ISBN links]]
+
| row 2, cell 3
* [[w:Request for Comments|RFC]] links to Requests for Comments: RFC 123 (See [[mediawiki:Rfcurl]])
+
|}
|<pre><nowiki>
 
ISBN 0123456789X
 
RFC 123</nowiki></pre>
 
|-
 
|
 
;Media links
 
To include links to non-image uploads such as sounds, use a "media" link.
 
<br/>[[media:Sg_mrob.ogg|Sound]]
 
|<pre>
 
<nowiki>
 
[[media:Sg_mrob.ogg|Sound]]
 
 
</nowiki></pre>
 
</nowiki></pre>
|-
 
|
 
;Links to Categories
 
To include links to a Category page.
 
<br/>[[:Category:English documentation]]
 
|<pre>
 
<nowiki>
 
[[:Category:English documentation]]
 
</nowiki></pre>
 
|-
 
|
 
;Dates:
 
Use links for dates, so everyone can set their own display order. Use [[Special:Preferences]] to change your own date display setting.
 
|<pre><nowiki>[[July 20]], [[1969]] , [[20 July]] [[1969]]
 
and [[1969]]-[[07-20]]
 
</nowiki></pre>will all appear as [[20 July]]-[[1969]] if you set your date display preference to 1 January 2001.
 
|-
 
|
 
;Special pages
 
"What links here" and "Recent changes" can be linked as:<br/>
 
[[Special:Whatlinkshere/{{NAMESPACE}}:{{PAGENAME}}]] and
 
[[Special:Recentchangeslinked/{{NAMESPACE}}:{{PAGENAME}}]]
 
|<pre><nowiki>
 
[[Special:Whatlinkshere/
 
Help:Editing]] and
 
[[Special:Recentchangeslinked/
 
Help:Editing]]</nowiki></pre>
 
 
|}
 
|}
  
====External links====
+
Note, the class="nicetable" is our local hack for Moodledocs.  You can leave it out to get a table without borders.
{| border="1" cellpadding="2" cellspacing="0"
+
 
|-
+
You can also add in more attributes if you do not want to use class="nicetable"
|[http://www.nupedia.com Nupedia], [http://www.nupedia.com]
+
 
|<pre><nowiki>
+
  <nowiki>border="1" cellpadding="5" cellspacing="0" align="center"</nowiki>
[http://www.nupedia.com Nupedia],
+
Or perhaps you want a floating table.
[http://www.nupedia.com]</nowiki></pre>
+
  <nowiki>style="float: right;"</nowiki>
|-
+
 
|Or just give the URL: http://www.nupedia.com.
+
Like HTML, you can also have a combined use of "colspan" and "rowspan":
*In the [[Help:URL|URL]] all symbols must be among: A-Z a-z 0-9 ._\/~%- &amp;#?!=()@ \x80-\xFF. If a URL contains a different character it should be converted; for example, ^ has to be written ^ (to be looked up in [[w:ASCII|ASCII]]). A blank space can also be converted into an underscore.
+
  <nowiki>| rowspan="2" | A
|<pre><nowiki>Or just give the URL:
+
| colspan="2" style="text-align: center;" | B</nowiki>
http://www.nupedia.com.</nowiki></pre>
+
 
|}
+
(from mediaWiki Help pages)
 +
 
 +
== Using Images ==
 +
Images are included in two parts. The first part is a link in the page to an image and the second is uploading the image. For example:
 +
 
 +
  <nowiki>[[Image:MoodleDocs Edit Toolbar.png|frame|center|Edit tool bar]]</nowiki>
 +
 
 +
is how an image is edited onto the page. The brackets place a link to an image. The Image name tells the wiki renderer that an image is following. The name of the image follows then after that the presentation style of that image is determined. There are a number of different styling possibilities and include thumbnails, resizing, borders, etc.  
 +
 
 +
Images are initially rendered on the page as text, you click the text and a very simple upload process begins. Wikis store images automagically and maintain links internally.  
 +
 
 +
For practical and stylistic reasons, Moodle Docs tend to keep images in the centre of a page and do not often use thumbnails.
 +
 
 +
For full documentation about images, see [https://www.mediawiki.org/wiki/Help:Images Mediawiki Image Docs]
  
=== Images, video, and sounds ===
+
==Embedding videos==
See also: [[Help:Images and other uploaded files]]
 
  
{| border="1" cellpadding="2" cellspacing="0"
+
To embed a YouTube video, simply add <nowiki><mediaplayer></nowiki> tags around the video URL e.g. <nowiki><mediaplayer>http://www.youtube.com/watch?v=U7M3sZL6wts</mediaplayer></nowiki>
|-
 
!What it looks like
 
!What you type
 
|-
 
|
 
;In-line picture: [[Image:Wiki.png|Wikipedia - The Free Encyclopedia]]
 
* For many projects, only images that have been uploaded to the same project or [[commons:|the Commons]] can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]]
 
|<pre><nowiki>
 
A picture: [[Image:Wiki.png]]</nowiki></pre>
 
or, with alternative text (''strongly'' encouraged) <!-- actually required in HTML4 -->    vbgf
 
<pre><nowiki>[[Image:Wiki.png|
 
Wikipedia - The Free Encyclopedia]] </nowiki>
 
</pre>
 
[[w:Web browser|Web browser]]s render alternative text when not displaying an image -- for example, when the image isn't loaded, or in a text-only browser, or when spoken aloud. See [[w:Wikipedia:Alternative text for images|Alternative text for images]] for help on choosing alternative text.  See [[Help:Extended image syntax|Extended image syntax]] for more options.
 
There is  [[Help:Images and other uploaded files#More_details_and_examples_on_embedding_internal_images__into_articles|more information]] on resizing and other formatting tricks.
 
|-
 
|
 
;Other ways of linking to pictures
 
*The [[Help:Image page|Image page]]: [[:Image:Wiki.png]]
 
*A link to just the picture: [[media:Wiki.png|Wikipedia]]
 
* Clicking on an image displayed on a page (such as any of the ones above) also leads to the description page
 
* To include links to images shown as links instead of drawn on the page, use a "media" link.
 
|<pre><nowiki>[[:Image:Wiki.png]]
 
[[media:Wiki.png|Wikipedia]]
 
</nowiki></pre>
 
|-
 
|'''Other Media Links -- Video and Sounds'''
 
Use a "media" link: [[media:Sg_mrob.ogg|Sound]]
 
<br>There is
 
[[Help:Images and other uploaded files#Supported_file_types.3B_miscellaneous|More information on other media types]].
 
|<pre><nowiki>[[media:Sg_mrob.ogg|Sound]]</nowiki></pre>
 
|}
 
  
=== Text formatting -- controlling how it looks ===
+
== Links and Anchors ==
  
<table border="1" cellpadding="2" cellspacing="0">
+
=== Page links ===
<tr>
+
To make a wiki page link, simply put the word in double square brackets, like this: <code><nowiki>[[Sandbox]]</nowiki></code> . Highlight text and using the "internal link" tool will do this as well.
<th>What it looks like</th>
 
<th>What you type</th>
 
</tr>
 
<tr valign="top"><td>
 
''Emphasize'' (italics), '''strongly''' (bold), '''''very strongly''''' (bold italics).
 
(These are double and triple apostrophes, not double quotes.)
 
</td>
 
<td valign="bottom">
 
<pre><nowiki>''Emphasize'', '''strongly''',
 
'''''very strongly'''''.</nowiki></pre>
 
</td>
 
</tr>
 
<tr valign="top"><td>
 
You can also write <i>italic</i> and <b>bold</b>.
 
This is useful in mathematical formulas where you need specific font styles rather than emphasis.
 
:<b>F</b> = <i>m</i><b>a</b>
 
(The difference between these two methods is not very important for graphical browsers, so most people ignore it). But it may make a big difference for the visually impaired ;-)
 
</td>
 
<td>
 
<pre><nowiki>You can also write <i>italic</i> and <b>bold</b>.
 
This is useful in mathematical formulas where you
 
need specific font styles rather than emphasis.
 
:<b>F</b> = <i>m</i><b>a</b></nowiki></pre><!-- that's not a mathematical formula, though -- sure it is, just because it's being applied to physics doesn't make it stop being mathematics -->
 
</td>
 
</tr>
 
<tr valign="top"><td>
 
You can also write
 
<span style="font-variant:small-caps">
 
in small caps</span>.
 
If the wiki has the templates, this can
 
{{bsm}}be much simpler to write{{esm}}.
 
</td>
 
<td>
 
<pre><nowiki>You can also write
 
<span style="font-variant:small-caps">
 
in small caps</span>.
 
If the wiki has the templates, this can
 
{{bsm}}be much simpler to write{{esm}}.</nowiki></pre>
 
</td>
 
</tr>
 
<tr valign=top>
 
<td>A typewriter font, sometimes used for
 
<tt>technical terms</tt> and <code>computer code</code>.
 
</td>
 
<td><pre><nowiki>A typewriter font, sometimes used for
 
<tt>technical terms</tt> and <code>computer code</code>.</nowiki></pre>
 
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.
 
</td><!-- tt is really 'teletype', not 'technical term' -->
 
</tr>
 
<tr valign=top>
 
<td>You can use <small>small text</small> for captions.
 
</td>
 
<td><pre><nowiki>You can use <small>small text</small>
 
for captions.</nowiki></pre>
 
</td>
 
</tr>
 
<tr valign="top"><td>You can <strike>strike out deleted material</strike>
 
and <u>underline new material</u>.
 
  
You can also mark <del>deleted material</del> and
+
If you want to use words other than the article title as the text of the link, you can do so by adding the pipe "|" divider followed by the alternative name or text.
<ins>inserted material</ins> using logical markup
 
rather than visual markup.
 
* When editing regular articles, just make your changes and do not mark them up in any special way.
 
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.
 
</td>
 
<td><pre><nowiki>You can <strike>strike out deleted material</strike>
 
and <u>underline new material</u>.
 
  
You can also mark <del>deleted material</del> and
+
For example, if you wanted to make a link to the [[Sandbox]], but wanted it to say "my text" you would write it as: <code><nowiki>[[Sandbox|my text]]</nowiki>...</code> It would appear as: [[Sandbox|my text]]... but would link to the sandbox.
<ins>inserted material</ins> using logical markup
 
rather than visual markup.
 
</nowiki></pre>
 
</td>
 
</tr>
 
  
<tr valign="bottom" id="subscript"><td>Subscript: x<sub>2</sub><br/>
+
There are some special internal link notations. For example <nowiki>[[#top]]</nowiki> will always jump to the top of the current page.
Superscript: x<sup>2</sup> or x&sup2;
 
  
Most browsers have an easier time formatting lines with &amp;sup2; than with &lt;sup>2&lt;/sup>
+
=== External links ===
  
&epsilon;<sub>0</sub> =
+
The easiest way to make an external link is to simply type in the full URL for the page you want to link to e.g. http://school.demo.moodle.net/.
8.85 &times; 10<sup>&minus;12</sup>
 
C&sup2; / J m.
 
<br/>
 
<br/>
 
1 [[hectare]] = [[1 E4 m²]]
 
</td>
 
  
<td valign="bottom"><pre><nowiki>Subscript: x<sub>2</sub>
+
If you want the link to appear with text that you specify, add an alternative title after the address separated by a '''space''' (''not'' a pipe). So if you want the link to appear as [http://school.demo.moodle.net/ School demo site], just type <code><nowiki>[http://school.demo.moodle.net/ School demo site] </nowiki></code>.
Superscript: x<sup>2</sup> or x&amp;sup2;
 
</nowiki></pre>
 
<pre><nowiki>
 
&amp;epsilon;<sub>0</sub> =
 
8.85 &amp;times; 10<sup>&amp;minus;12</sup>
 
C&amp;sup2; / J m.
 
  
1 [[hectare]] = [[1 E4 m&amp;sup2]]
+
===Tracker links===
</nowiki></pre></td>
 
</tr>
 
</table>
 
  
===Spacing things out -- spaces and tables ===
+
To automatically link to an issue in the Moodle tracker, simply type the issue number MDL-xxxx e.g. MDL-1234.
<table border="1" cellpadding="2" cellspacing="0">
 
<tr valign="top"><td>
 
;Using non-breaking spaces
 
<i>x</i><sup>2</sup>&nbsp;&nbsp;
 
&nbsp;&ge;
 
&nbsp;&nbsp;&nbsp;0 true.
 
</td>
 
<td><pre><nowiki>
 
<i>x</i><sup>2</sup>&amp;nbsp;
 
&amp;nbsp;&amp;ge;
 
&amp;nbsp;&amp;nbsp;0 true.
 
</nowiki></pre></td>
 
</tr>
 
  
<tr>
+
=== Categories links ===
<td>
+
A category is a type of index page, a page of links listed in alphabetical order. In page view mode, a list of categories that a page is linked to, appears at the bottom.
;Using [[Help:Table#Simple_example|Wikitext piped tables]]
 
{||-
 
|<i>x</i><sup>2</sup>
 
| width=20px | || width=20px | &ge;0 || true.
 
|-
 
| a || || b
 
|}
 
See templates [[Template:hs1]], [[Template:hs]], and [[Template:vs]] for more examples
 
</td>
 
<td>
 
<pre><nowiki>
 
{||-
 
|<i>x</i><sup>2</sup>
 
| width=20px | || width=20px | &ge;0 || true.
 
|-
 
| a || || b
 
|}
 
</nowiki></pre>
 
See [[Help:Table]] for more information
 
</td>
 
</tr>
 
  
</table>
+
To '''put a page in a category''', just type <code><nowiki>[[Category:]]</nowiki></code>, and put the name of the category between the colon and the brackets.
  
===Just show what I typed===
+
To '''link directly to a category''' use <code><nowiki>[[:Category:Teacher | teacher]]</nowiki></code>, this will show as [[:Category:Teacher | teacher]], note the preceding ":", which is different to <code><nowiki>[[Category:Teacher | teacher]]</nowiki></code>. The second will put the current page in the teacher category as mentioned above.
&lt;nowiki&gt; and &lt;pre&gt; tags can tell the server and the browser to display things as you typed them.
 
<table border="1" cellpadding="2" cellspacing="0">
 
<tr>
 
<td>
 
;Example:
 
  
arrow      &rarr;
+
If you put a page in a category, it's usually a good idea to '''add a sort key''' to the category like so: <code><nowiki>[[Category:Developer|Eclipse]]</nowiki></code>. This will result in the page being placed under "E" like "Eclipse" in the alphabetical link list where most users will look for it.
  
''italics''
+
You can also use MediaWiki's '''PAGENAME variable''' (= the article title without its namespace) as a sort key: <code><nowiki>[[Category:Developer|{PAGENAME}]]</nowiki></code>.
[[link]]
 
</td>
 
<td valign="bottom">
 
<pre><nowiki>arrow      &amp;rarr;
 
  
''italics''
+
This page is linked to the single category "MoodleDocs".
[[link]]</nowiki></pre>
 
</td>
 
</tr>
 
<tr>
 
<td valign="bottom">
 
;&lt;nowiki>
 
* interpret special characters
 
* don't interpret special wiki markup
 
* reformat text (removing newlines and multiple spaces)
 
<nowiki>
 
arrow      &rarr;
 
  
''italics''
+
===Inter-language links===
[[link]]
 
</nowiki>
 
</td>
 
<td valign="bottom">
 
<pre><nowiki><nowiki>
 
arrow      &amp;rarr;
 
  
''italics''
+
Simply type <code><nowiki>[[es:Corresponding page title in Spanish]]</nowiki></code> in the English Moodle Docs, or <code><nowiki>[[en:Corresponding page title in English]]</nowiki></code> in the [[:es:Portada|Spanish Moodle Docs]], at the bottom of the page, below the category link. Inter-language links will appear automatically in the "In other languages" block.
[[link]]
 
</nowiki></nowiki></pre>
 
  
</td>
+
If for some reason you want to refer to a page in another language version in the running text, precede the language code by a colon.  Thus, the reference in the preceeding paragraph was produced by the text <nowiki>[[:es:Portada|Spanish Moodle Docs]]</nowiki>.
</tr>
 
  
<tr>
+
You can also, using the same way, make link to developper documentation, using links like this one : <nowiki>[[:dev:Page name|Page title to use]]</nowiki>.
<td>
 
;<nowiki><pre></nowiki>  
 
* interpret special characters
 
* don't interpret special wiki markup
 
* don't reformat text
 
  
<pre>arrow      &rarr;
 
  
''italics''
+
<nowiki>[[:en:Page name|Page title to use]]</nowiki> links to the latest version of the page in English.
[[link]]
 
</pre>
 
</td>
 
<td valign="bottom">
 
<pre><nowiki><pre>arrow      &amp;rarr;
 
  
''italics''
+
=== User-page links ===
[[link]]</pre></nowiki></pre>
+
User names can be linked to a user page.  For example <nowiki>[[User:Helen Foster|Helen Foster]] </nowiki> will appear [[User:Helen Foster|Helen Foster]] and link to the user's page. Comments by other users are generally left on the Users page comment tab.
</td>
 
</tr>
 
  
<tr>
+
=== Interwiki links ===
<td>
+
[TODO]
; leading space
 
* interpret special characters
 
* interpret special wiki markup
 
* don't reformat text
 
arrow      &rarr;
 
 
''italics''
 
[[link]]
 
</pre>
 
</td>
 
<td valign="bottom">
 
<pre> <nowiki>arrow      &amp;rarr;
 
  
''italics''
+
===Manual Anchors===
[[link]]</nowiki></pre>
+
Other than automated anchors ([[#Automatic_Anchors|see below]]) manual anchors can be inserted by using something this this:
</td>
 
</tr>
 
  
<tr valign=top>
+
<nowiki><span id="anchor_one">'''My Anchor.'''</span></nowiki>
<td>
 
;preformatted text
 
IF a line of plain text starts with a space
 
  it will be formatted exactly
 
    as typed
 
  in a fixed-width font
 
  lines won't wrap
 
ENDIF
 
this is useful for:
 
  * pasting preformatted text;
 
  * algorithm descriptions;
 
  * program source code
 
  * ASCII art;
 
  * chemical structures;
 
  
For larger preformatted text passages you can use the <nowiki><pre>a lot of text</pre></nowiki> tag.
+
Which if implemented will create an anchor <span id="anchor_one">'''My Anchor.'''</span>.
  
WARNING If you make it wide,
+
Inside the page I can now refer to this link as [[#anchor_one|the link to My Anchor]] by using this:
you [[w:page widening|force the whole page to be wide]] and
 
hence less readable. Never start ordinary lines with spaces.<br>
 
<center>(see also below)</center>
 
</td>
 
<td><pre><nowiki> IF a line of plain text starts with a space
 
  it will be formatted exactly
 
    as typed
 
  in a fixed-width font
 
  lines won't wrap
 
ENDIF
 
this is useful for:
 
  * pasting preformatted text;
 
  * algorithm descriptions;
 
  * program source code
 
  * ASCII art;
 
  * chemical structures;
 
</nowiki></pre>
 
</td>
 
</tr>
 
  
 +
<nowiki>[[#anchor_one|the link to My Anchor]]</nowiki>
  
<tr>
+
If you want to have a link back to the top of a (long) page, just insert:
<td>
 
;typewriter font:
 
  
<tt>arrow      &rarr;</tt>
+
<nowiki>[[#top|Back to top of page]]</nowiki>
  
<tt>''italics''</tt>
+
== Page comments ==
<tt>[[link]]</tt>
+
The page comment tab is used for discussion about the page.  Sometimes before making an edit on the page for the first time, it is a good idea to check the page comments. It can be formatted the same as a main page, thus can be used to show a draft of a proposed change.
  
</td>
+
Talk page contributions may be signed and dated by typing four tildes <nowiki>~~~~</nowiki>. This will appear as [[User:Helen Foster|Helen Foster]] 06:35, 19 February 2006 (WST), for example.
<td valign="bottom">
+
: There's also a handy button for signing in the toolbar of the editing field: [[Image:Signature Icon.png]]
<pre><nowiki><tt>arrow      &amp;rarr;</tt>
 
  
<tt>''italics''</tt>
+
==Page history==
<tt>[[link]]</nowiki></tt></pre>
+
The page history tab allows a way to look at changes between different edits by using the "Compare versions" button and selecting the versions to compare. 
</td>
 
</tr>
 
  
<tr>
+
It is also possible to revert (roll back) an edit to a previous version from this tab.  Usually rollback are left to the MoodleDoc Sysops (administrators), but you certainly can rollback your recent edits.  Hopefully, both MoodleDoc sysops and you will comment why the rollback was performed.
<td>
+
[[Image:MoodleDocs history 1.png|frame|center|Example of top 2 entries on a history tab]]
;Show special character codes:
 
  
&amp;rarr;
+
==Watch and unwatch page==
</td>
+
A watched page will appear on "my watchlist" when ever someone edits the page. There is a tab next to history which acts as a toggle between watch and unwatch. In edit mode, there is also at the bottom of the edit area a "Watch this page" check off box.
<td valign="bottom">
 
<pre>&amp;amp;rarr;</pre>
 
</td>
 
</tr>
 
  
<tr>
+
==See also==
<td>
+
*[http://meta.wikimedia.org/wiki/Help:Editing MediaWiki Help:Editing]
;Comments
+
*[http://meta.wikimedia.org/wiki/Help:HTML_in_wikitext Help:HTML in wikitext]
The text between '''here'''
+
*[http://wikipedia.mozdev.org/ Firefox Wikipedia extension] - The Wikipedia extension makes editing of  wiki pages easier by adding a new toolbar to your browser and by providing new menu items in the context menu (right mouse key).
<!-- comment here -->
 
'''and here''' won't be displayed
 
</td>
 
<td>
 
<pre><nowiki>The text between '''here'''
 
<!-- comment here -->
 
'''and here''' won't be displayed</nowiki></pre>
 
</td>
 
</tr>
 
</table>
 
  
 
[[Category:MoodleDocs]]
 
[[Category:MoodleDocs]]
 +
 +
[[de:Bearbeitung von Moodle Docs Seiten]]
 +
[[es:Ayuda:Cómo se edita una página]]
 +
[[fr:Aide:Comment éditer une page]]
 +
[[ja:Help:編集方法]]

Latest revision as of 06:03, 3 July 2014


This page is for editing Moodle Documentation (MoodleDocs), which is based on MediaWiki format (similar to Wikipedia).

Edit tab

Every MoodleDoc page has an "edit" tab at the top . This link will let you edit the page you are viewing. Please try editing a page by using this sandbox link. We will cover more formatting and special MoodleDoc features below. The edit tool bar is easy to use.

There are 3 parts to the edit page: the content areas to edit with its toolbar at the top; the save, preview, changes and summary box; the preview area.

Edit tool bar

Edit tool bar

Hold the mouse cursor over the edit tool bar to see what functions each icon will do. From left to right: Bold, Italics, Internal (page) link, external link, Level 2 heading, embedded image, media file link, mathematical formula, no wiki, signature and time stamp, horizontal line.

Show preview

Example of the save, preview, comment area below the edit box

In edit mode, the show preview button at the bottom of the page lets you see what the page will look like after your edit, before you actually save. We all make mistakes; this feature lets you catch them immediately. Using Show preview before saving also lets you try format changes and other edits without cluttering up the page history, and has a number of other advantages. Don't forget to save your edits after previewing, though!

Edit summary

Before saving the page, it's considered good practice to enter a very brief summary of your changes in the summary box below the edit-box.

In the example above, the contributor used the edit link next to a heading called "Tips and tricks". MoodleDocs automatically added "/* Tips and tricks */" to the summary box. The The contributor added a comment "Put comment here about edit - will rollback".

See Page history below where the example is continued.

Show changes

This button will change the preview area. One column will show current areas that will be changed and another column will show the resulting changes from what has been done in the content editing box.

Formatting

Most formatting in MoodleDocs is usually done with MediaWiki markup - you don't have to learn HTML!

Bold and italics

Bolding and italicizing is done by surrounding a word or phrase with multiple apostrophes ('):

''italics''
appears as italics. (2 apostrophes on both sides)
'''bold'''
appears as bold. (3 apostrophes on both sides)
'''''bolded italics'''''
appears as bolded italics. (5 apostrophes on both sides)

Headings and subheadings

Headings and subheadings are an easy way to improve the organization of an article.

Headings can be created like this:

==Top level heading==
(2 equals signs)
===Subheading===
(3 equals signs)
====Another level down====
(4 equals signs)

If an article has at least four headings, a table of contents will automatically be generated.

Indentations

The simplest way of indenting is to place a colon (
:
) at the beginning of a line. The more colons you put, the further indented the text will be. A newline marks the end of the indented paragraph e.g.
This is aligned all the way to the left.
:This is indented slightly.
::This is indented more.

is shown as

This is aligned all the way to the left.
This is indented slightly.
This is indented more.

Lists

What it looks like What you type
  • Unordered lists are easy to do:
    • start every line with a star
      • more stars means deeper levels
  • A newline
  • in a list

marks the end of the list.

* Unordered Lists are easy to do:
** start every line with a star
*** more stars means deeper levels
*A newline
*in a list  
marks the end of the list.
  1. Numbered lists are also good
    1. very organized
    2. easy to follow
  2. A newline
  3. in a list

marks the end of the list.

# Numbered lists are also good
## very organized
## easy to follow
#A newline
#in a list  
marks the end of the list.
Descriptive lists:
first tag 
accompanying description
second tag 
more description
third tag 
surprise! more description
Descriptive lists:
; first tag : accompanying description
; second tag : more description
; third tag : surprise! more description

Preserving formatting

What it looks like What you type

Leading spaces are another way to preserve formatting.

Putting a space at the beginning of each line
stops the text from being reformatted. 
Leading spaces are another way to preserve formatting.

 Putting a space at the beginning of each line
 stops the text from being reformatted.

You can also use <pre> tags.

A "nowiki" tag on either side of text area, starts and stops wiki formatting within a line of text. For example, placing the tags here <nowiki> turns off linking [[Main page]] </nowiki> and then starts the wiki formatting again. Here is the same link Main page without the tags on either side.

The HTML edit tool bar has a nowiki icon.

PHP syntax higlighting

What it looks like What you type
$user = $DB->get_record('user', array('id'=>'1');
<code php>$user = $DB->get_record('user', array('id'=>'1');</code>

Tables

See the Mediawiki help for full details of the table syntax.

What it looks like What you type
A table:
header 1 header 2 header 3
row 1, cell 1 row 1, cell 2 row 1, cell 3
row 2, cell 1 row 2, cell 2 row 2, cell 3
A table:

{| class="nicetable"
|-
! header 1
! header 2
! header 3
|-
| row 1, cell 1
| row 1, cell 2
| row 1, cell 3
|-
| row 2, cell 1
| row 2, cell 2
| row 2, cell 3
|}

Note, the class="nicetable" is our local hack for Moodledocs. You can leave it out to get a table without borders.

You can also add in more attributes if you do not want to use class="nicetable"

 border="1" cellpadding="5" cellspacing="0" align="center"

Or perhaps you want a floating table.

 style="float: right;"

Like HTML, you can also have a combined use of "colspan" and "rowspan":

 | rowspan="2" | A
 | colspan="2" style="text-align: center;" | B

(from mediaWiki Help pages)

Using Images

Images are included in two parts. The first part is a link in the page to an image and the second is uploading the image. For example:

 [[Image:MoodleDocs Edit Toolbar.png|frame|center|Edit tool bar]]

is how an image is edited onto the page. The brackets place a link to an image. The Image name tells the wiki renderer that an image is following. The name of the image follows then after that the presentation style of that image is determined. There are a number of different styling possibilities and include thumbnails, resizing, borders, etc.

Images are initially rendered on the page as text, you click the text and a very simple upload process begins. Wikis store images automagically and maintain links internally.

For practical and stylistic reasons, Moodle Docs tend to keep images in the centre of a page and do not often use thumbnails.

For full documentation about images, see Mediawiki Image Docs

Embedding videos

To embed a YouTube video, simply add <mediaplayer> tags around the video URL e.g. <mediaplayer>http://www.youtube.com/watch?v=U7M3sZL6wts</mediaplayer>

Links and Anchors

Page links

To make a wiki page link, simply put the word in double square brackets, like this:
[[Sandbox]]
. Highlight text and using the "internal link" tool will do this as well.

If you want to use words other than the article title as the text of the link, you can do so by adding the pipe "|" divider followed by the alternative name or text.

For example, if you wanted to make a link to the Sandbox, but wanted it to say "my text" you would write it as:
[[Sandbox|my text]]...
It would appear as: my text... but would link to the sandbox.

There are some special internal link notations. For example [[#top]] will always jump to the top of the current page.

External links

The easiest way to make an external link is to simply type in the full URL for the page you want to link to e.g. http://school.demo.moodle.net/.

If you want the link to appear with text that you specify, add an alternative title after the address separated by a space (not a pipe). So if you want the link to appear as School demo site, just type
[http://school.demo.moodle.net/ School demo site] 
.

Tracker links

To automatically link to an issue in the Moodle tracker, simply type the issue number MDL-xxxx e.g. MDL-1234.

Categories links

A category is a type of index page, a page of links listed in alphabetical order. In page view mode, a list of categories that a page is linked to, appears at the bottom.

To put a page in a category, just type
[[Category:]]
, and put the name of the category between the colon and the brackets. To link directly to a category use
[[:Category:Teacher | teacher]]
, this will show as teacher, note the preceding ":", which is different to
[[Category:Teacher | teacher]]
. The second will put the current page in the teacher category as mentioned above. If you put a page in a category, it's usually a good idea to add a sort key to the category like so:
[[Category:Developer|Eclipse]]
. This will result in the page being placed under "E" like "Eclipse" in the alphabetical link list where most users will look for it. You can also use MediaWiki's PAGENAME variable (= the article title without its namespace) as a sort key:
[[Category:Developer|{PAGENAME}]]
.

This page is linked to the single category "MoodleDocs".

Inter-language links

Simply type
[[es:Corresponding page title in Spanish]]
in the English Moodle Docs, or
[[en:Corresponding page title in English]]
in the Spanish Moodle Docs, at the bottom of the page, below the category link. Inter-language links will appear automatically in the "In other languages" block.

If for some reason you want to refer to a page in another language version in the running text, precede the language code by a colon. Thus, the reference in the preceeding paragraph was produced by the text [[:es:Portada|Spanish Moodle Docs]].

You can also, using the same way, make link to developper documentation, using links like this one : [[:dev:Page name|Page title to use]].


[[:en:Page name|Page title to use]] links to the latest version of the page in English.

User-page links

User names can be linked to a user page. For example [[User:Helen Foster|Helen Foster]] will appear Helen Foster and link to the user's page. Comments by other users are generally left on the Users page comment tab.

Interwiki links

[TODO]

Manual Anchors

Other than automated anchors (see below) manual anchors can be inserted by using something this this:

<span id="anchor_one">'''My Anchor.'''</span>

Which if implemented will create an anchor My Anchor..

Inside the page I can now refer to this link as the link to My Anchor by using this:

[[#anchor_one|the link to My Anchor]]

If you want to have a link back to the top of a (long) page, just insert:

[[#top|Back to top of page]]

Page comments

The page comment tab is used for discussion about the page. Sometimes before making an edit on the page for the first time, it is a good idea to check the page comments. It can be formatted the same as a main page, thus can be used to show a draft of a proposed change.

Talk page contributions may be signed and dated by typing four tildes ~~~~. This will appear as Helen Foster 06:35, 19 February 2006 (WST), for example.

There's also a handy button for signing in the toolbar of the editing field: Signature Icon.png

Page history

The page history tab allows a way to look at changes between different edits by using the "Compare versions" button and selecting the versions to compare.

It is also possible to revert (roll back) an edit to a previous version from this tab. Usually rollback are left to the MoodleDoc Sysops (administrators), but you certainly can rollback your recent edits. Hopefully, both MoodleDoc sysops and you will comment why the rollback was performed.

Example of top 2 entries on a history tab

Watch and unwatch page

A watched page will appear on "my watchlist" when ever someone edits the page. There is a tab next to history which acts as a toggle between watch and unwatch. In edit mode, there is also at the bottom of the edit area a "Watch this page" check off box.

See also