Advanced Use of Markdown
This section expands upon the basic information given in the section titled 'Enhancing Text With Markdown' to give those with special requirements the information needed to make the most of Markdown. If you don't recognise, or don't need, the formatting listed below then you should feel free to skip this section and return to it as and when needed.
In some texts, for instance in poetry and verse, it is often necessary to insert line breaks. Trying to do so with the return key will not give the intended effect as by default the lines will be run together to create a paragraph.
The above input, using the enter key to insert line breaks will give the following output as such breaks are ignored:
The best laid schemes o' Mice an' Men, Gang aft agley, An' lea'e us nought but grief an' pain, For promis'd joy!
But by ending each line with two spaces you can force a line break as follows:
The best laid schemes o' Mice an' Men,
Horizontal rules can be created by placing three or more asterisks (*), hyphens (-) or underscores (_) on a line by themselves.
This will work:
but you can add spaces or further characters to make it more obviously a section break in the text editing window e.g.
All of these methods give the exact same result:
The Enhancing Text With Markdown document gives instructions for creating web links and inserting images. It may not be obvious that these can be combined to create images that are also clickable links.
Above are a standard web link and image. By placing the image where the link text would be found you end up with this:
This line above, in combination with the following link definitions elsewhere in the document:
combine to produce the following clickable image link (with tooltip if you hover over it):
An example of where this technique might be handy is in linking small 'thumbnail' images to downloads of the larger photos.
If you are already proficient in HTML then there may be occasions when Markdown does not allow you as much control as you are used to. Luckily Markdown is designed for this eventuality and allows you to embed HTML directly within Markdown formatted text.
Note that the HTML markup co-exists with the Markdown code for bullet lists. This frees you from the mundane task of writing complex HTML for basic formatting features such as paragraphs and lists while still allowing you to access the full power of HTML in specific situations.
If, unlike in the section above, you wish the HTML you enter to be displayed exactly as you typed it, rather than processed as HTML then you can start each line with four space characters.
This also works for displaying computer code:
As this formatting is often used for computer program listings and other text which may plausibly contain the characters that Markdown uses to indicate different types of formatting, Markdown's formatting is switched off for these lines:
To include such characters within normal text, see the section below.
If you wish to use any of the special characters that trigger Markdown formatting without them being processed simply precede them with a backslash character (\). This is known as 'escaping' a character. The backslash is not displayed but the character immediately following it is shown, exactly as entered.
*asterisks, not emphasis*
emphasis, not asterisks
The Markdown system is not unique to Moodle, it is used in an ever increasing number of web publishing tools. You can find out more about it at http://daringfireball.net/projects/markdown/