Markdown Syntax

Tips and tricks on mastering markdown syntaxes

Markdown is a light-weight markup language with plain text formatting syntax. It’s often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

Here are some key elements of Markdown syntax:

# Header 1
## Header 2
### Header 3

- Bulleted
- List

1. Numbered
2. List

**Bold** and _Italic_ and `Code` ~~Strikethrough~~

[Link](url) and ![Image](src)

> Block quote

`Inline code`

Read Getting started with writing and formatting on GitHub

Code blocks

Code blocks can be used to display your codes on your website. Use triple backticks ``` to form a code block, then close it with another triple backticks ```. Anyting in between will be written in code blocks.

```
Code blocks
```

Syntax highlighting for code blocks

You can also apply syntax highlighting to code blocks by specifying it’s language right after the opening backticks ```language. See “Creating and highlighting code blocks.”

For example
```html
  <html>
    <title>Html code blocks</title>
    <body>Will format and render html codes</body>
  </html>
```

The supported languages for syntax highlighting depends on the builder you use.

GitHub Pages use Linguist to perform language detection and syntax highlighting. You can find out which keywords are valid in the languages YAML file. See the aliases attibutes.

For example
ApacheConf:
  aliases:
  - aconf
  - apache
```apache
<IfModule mod_rewrite.c>

# Turn on engine
RewriteEngine On

# return 301 for old-page to new-page
RewriteRule ^old-page$ /new-page [R=301,L]

</IfModule>
```

Bitbucket has it’s own support list Bitbucket markdown supported languages.

 

✨ Made with Mallet