UQWorld

Markdown User Reference Guide

For text formatting, the post editor utilizes Markdown, a light and easy-to-use markup language.
While Discourse post editor supports basic text formatting via the graphical user interface, advanced formatting can only be done directly by Markdown syntax.

text_editing

This post is a guide on how to use Markdown in UQWorld. If you have never used Markdown before, try the 10-minute tutorial.

Table of contents


Paragraphs[toc]

To start a new paragraph, put a blank line between two blocks of text:

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

Text formatting[toc]

To create bold text, add two asterisks before and after the text:

Here comes **a bold phrase**.

which will be rendered as:

Here comes a bold phrase.

To create italicized text, add one underscore before and after the text:

Here comes _an italicized phrase_.

which will be rendered as:

Here comes an italicized phrase.

To strikethrough text, add two tildes before and after the text:

Here comes ~~a strikethrough phrase~~.

which will be rendered as:

Here comes a strikethrough phrase.

These formattings can be combined. For instance:

Here comes **_a really emphasized phrase_**.

which will be rendered as:

Here comes a really emphasized phrase.

Text heading[toc]

Six levels of heading are supported:

# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6

Each will be rendered as:

Heading level 1

Heading level 2

Heading level 3

Heading level 4

Heading level 5
Heading level 6

A horizontal rule can also be added by using three asterisks:

***

that produces:


Lists[toc]

Unordered list

To create an unordered (bulleted) list, add list items on separate lines prepended by an asterisk and a space.

* Item list 1
* Item list 2
* Item list 3

which produces:

  • Item list 1
  • Item list 2
  • Item list 3

A bulleted list can be nested by indenting the nested items on separate lines with 4 spaces as follows:

* Item list 1
    * Item list 1-1
    * Item list 1-2
    * Item list 1-3
* Item list 2

which produces:

  • Item list 1
    • Item list 1-1
    • Item list 1-2
    • Item list 1-3
  • Item list 2

Ordered list[toc]

To create an ordered (numbered) list, add items on separate lines prepended by numbers followed by periods and spaces.

1. List item 1
2. List item 2
3. List item 3

which produces:

  1. List item 1
  2. List item 2
  3. List item 3

A numbered list can be nested by indenting the nested items on separate lines with 4 spaces as follows:

1 Item list 1
    1 Item list 1-1
    2 Item list 1-2
    3 Item list 1-3
2 Item list 2

which produces:

  1. Item list 1
    1. Item list 1-1
    2. Item list 1-2
    3. Item list 1-3
  2. Item list 2

Tables[toc]

To add a table, use one or more hyphens (`) to create each column header and use pipe character (|) to separate each column.

| Header 1 | Header 2 | Header 3 |
| - | - | - |
| Row 1-1 | Row 1-2 | Row 1-3 |
| Row 2-1 | Row 2-2 | Row 2-3 |

The rendered output is as follows:

Header 1 Header 2 Header 3
Row 1-1 Row 1-2 Row 1-3
Row 2-1 Row 2-2 Row 2-3

Blockquotes[toc]

To create a blockquote, add a > in front of a paragraph:

> Far far away, behind the word mountains

which produces:

Far far away, behind the word mountains

Blockquotes can be nested using >> as follows:

> Far far away, behind the word mountains
>> far from the countries Vokalia and Consonantia

which renders to:

Far far away, behind the word mountains

far from the countries Vokalia and Consonantia

Code formatting[toc]

Inline code

To create an inline code formatting, enclose the code with backticks (`):

Create a UQLab INPUT object using `uq_createInput()` function.

which produces:

Create a UQLab INPUT object using uq_createInput() function.

Block of codes

To create a block of code, surround the block with three backticks (```):

```
x = ā€˜zā€™;
y = 10;
z = y + 5;
```

which produces:

x = 'z';
y = 10;
z = y + 5;

To create a text as a link to a URL, surround the link text in brackets ([])
and then follow it immediately with the URL in parentheses (()):

Download UQLab from the [download site](https://www.uqlab.com/download).

that produces:

Download UQLab from the download page.

To add a tooltip to a link, add the tooltip phrase enclosed by quotation marks right after the URL address:

Download UQLab from the [download page](https://www.uqlab.com/download "Download UQLab!").

The link will be rendered as before but hovering the cursor will bring out the tooltip phrase.

hover

To simply create a URL or email address into a link, surround them in angle brackets (<>):

<https://www.uqworld.org>
<john.smith@uqworld.org>

that produces:

https://www.uqworld.org
john.smith@uqmail.com

Finally, you can create a link preview by just pasting a URL into the editor on a separate line:

link preview

Images[toc]

To put an image either:

  • use the Add an image button in the user interface
  • drag-and-drop an image into the post editor

Either of this method will first upload the image to Discourse database and provide a link to access it.

For an image that is already on the web (incl. already uploaded image to Discourse database), the syntax is:

![title text](URL)

For instance, suppose an image is available at the URL (upload://xdkzTjFkezL1rNZaAPdnKAtC80x.png).
Adding this image is done as follows:

![An example of image](upload://xdkzTjFkezL1rNZaAPdnKAtC80x.png)

giving:

An example of image

An image can be resized manually by specifying its size in pixels:

By pixels (200x200) ![By pixels|200x200](upload://xdkzTjFkezL1rNZaAPdnKAtC80x.png)

By pixels (200x200) By pixels

or by pixels and then percentage:

 resized by pixels and then 75% ![By pixels|200x200, 75%](upload://xdkzTjFkezL1rNZaAPdnKAtC80x.png)

resized by pixels and then 75% By pixels

Note: resizing by percentage only works if the pixels are first given.

LaTeX[toc]

Mathematics rendering is supported in Discourse by MathJax via the official plugin. The syntax follows (mostly) standard LaTeX

Equations can be added in line by wrapping a LaTeX formula inside $. Typing $e^{ix} = \cos x + i \sin x$ renders as e^{ix} = \cos x + i \sin x.

Alternatively, equations can be displayed by wrapping a block of LaTeX formula in a double dollar signs $$:

$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.
$$ 

which renders as:

x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.