C

CMarkdown

C.1

General markdown syntax

The following is a summary of the general markdown language syntax.

C.1.1

Headings

Syntax Appearance in GitHub
Normal text
Markdown - normal text
# h1 heading
Markdown - normal text
## h2 heading
Markdown - normal text
### h3 heading
Markdown - normal text
#### h4 heading
Markdown - normal text
##### h5 heading
Markdown - normal text
###### h6 heading
Markdown - normal text
Normal text
Markdown - normal text

C.1.2

Block quotes

Syntax Appearance in GitHub
Normal text
Markdown - normal text
> Yet beautiful and bright
> He stood
> As born to rule the storm
Markdown - normal text

C.1.3

Emphasis

Syntax Appearance in GitHub
Normal text
Markdown - normal text
*This is italics*
Markdown - normal text
_This is also italics_
Markdown - normal text
**This is bold**
Markdown - normal text
__This is also bold__
Markdown - normal text
They *can **be** combined*
Markdown - normal text
This *is **also combined***
Markdown - normal text

C.1.4

Ordered lists

Syntax Appearance in GitHub
Normal text
Markdown - normal text
1. First entry
2. Second entry
3. Third entry
Markdown - normal text
1. First entry
2. Second entry
   1. First sub-entry
   2. Second sub-entry
3. Third entry
Markdown - normal text

C.1.5

Unordered lists

Syntax Appearance in GitHub
Normal text
Markdown - normal text
* First entry
* Second entry
* Third entry
Markdown - normal text
* First entry
   * First sub-entry
   * Second sub-entry
* Second entry
* Third entry
Markdown - normal text

C.1.6

Combined lists

Syntax Appearance in GitHub
Normal text
Markdown - normal text
1. First entry
2. Second entry
   * First sub-entry
   * Second sub-entry
3. Third entry
Markdown - normal text
* First entry
* Second entry
   1. First sub-entry
   2. Second sub-entry
* Third entry
Markdown - normal text

C.1.7

Images & links

Syntax Appearance in GitHub
Normal text
Markdown - normal text
![Logo](/11-resources/02-images/readme.png)
 
![Alt text](URL)
Markdown - normal text
[GitHub](http://github.com)
 
[Link text](URL)
Markdown - normal text

Images can also be added by using basic HTML†1 , this allow the size and position of the image to be adjusted:

<p align="center">
    <img width="200px" src="/11-resources/
    02-images/readme.png ">
</p>
Markdown - normal text
  • README.md files support SVG images if they are referenced as a HTML link, e.g.:
    http://practicalseries.com/1002-vcs/11-resources/02-images/02-build-status/build-badge.svg

If they are given as a relative address:
/11-resources/02-images/02-build-status/build-badge.svg
they will not be displayed.

The reason appears to be some security issue “cross site scripting vulnerabilities”—whatever that means?

†1 In the case of markdown, basic HTML is everything in HTML except the style attribute.

C.2

Git flavoured markdown syntax

GitHub flavoured markdown can use all the general markdown syntax and all of the following additions:

C.2.1

Code fragments

Syntax Appearance in GitHub
Normal text
Markdown - normal text
```
<p align="left">Any text
</p>
```
Markdown - normal text
```html
<p align="left">Semantic colouring
</p>
```
Markdown - normal text
Inline code ```git init``` fragment
Markdown - normal text

The three ``` characters are back-ticks alt+96; follow these with a language identifier to give semantic colouring. See here for a list of language identifiers.

C.2.2

Task lists

Syntax Appearance in GitHub
Normal text
Markdown - normal text
- [x] Completed task
- [ ] Open task
- [x] Completed task
- [ ] Open task
Markdown - normal text

C.2.3

Tables

Syntax Appearance in GitHub
Normal text
Markdown - normal text
| Header 1 | Header 2 |
| -------- | -------- |
| Cell A1  | Cell B1  |
| Cell A2  | Cell B2  |
Markdown - normal text
  • there is a space before and after the bar character (|).

To split a heading onto two lines use <br> where you want the break to occur.

C.2.4

Special GitHub references

Syntax Appearance in GitHub
Normal text
Markdown - normal text
@mgledhill link to a user
Markdown - normal text
#1 issue to be resolved
Markdown - normal text

C.2.5

Escape characters

Escape characters are used to display those characters that would otherwise have special meaning in markdown (putting asterisks around a word for example). Escaping a character is done by putting a reverse oblique (\) in front of it:

Syntax Appearance in GitHub
Normal text
Markdown - normal text
\*asterisk around a phrase\*
Markdown - normal text

The following characters can all be escaped:

\ ` * # + - . ! [ ] { } ( )



End flourish image