Styling email message using markdown

July 30, 2017

What is Markdown ?

Markdown is written in plain text format which is converted into structured HTML using javascript. Websites like Github, reddit and jekyll are using markdown for their various purposes. It increases readability for users and now becoming popular popular among writers, developers, scientists and in academics.

Other applications of Markdown:

Examples of various Markdown syntax:

Headings

# This is an <h1> tag
## This is an <h2> tag
###### This is an <h6> tag

converts to:

This is an <h1> tag

This is an <h2> tag

This is an <h6> tag

Emphasis

Lists

Code and syntax highlighting

Syntax highlighting using backticks(``).

For example: I love Python and Javascript Here i put backticks(``) around Python and Javascript and they are highlighted.

Highlight Code block

Code block highlighting supports number of languages and to highlight them, wrap code around triple backticks. Below is an example of highlighting Python and Javascript code:

# to highlight javascript code, type javascript after three backticks
```javascript
var s = "Highlight Javascript code";
alert(s);
```

# to highlight python code, type python after three backticks
```python
s = "Highlight python code snippets"
print s
```

# to highlight normal text, just put text between pair of three backticks
```
Normal text which needs not highlighting.
```

converts to:

var s = "Highlight Javascript code";
alert(s);
s = "Highlight python code snippets"
print s
Normal text which needs not highlighting.

Tables

Using (|) pipes, (-) hyphen and (:) colon, a nice looking table can be drawn. Also, it supports inline markdown syntax inside table such as bold, italics, backticks which makes it more handy to display larger table data in more cleaner way.

| PL rank       | (%) used      |
| ------------- |:-------------:|
| Python        | 80.5%         |
| *Javascript*  | 90.3%         |
| `Ruby`        | 60.3%         |

converts to:

Table markdown image

If you want to link an external webpage or blog, using markdown it is quite easy.

link to [pgAdmin4](http://pgadmin.org) website.

converts to:

link to pgAdmin4

Images

Images can also be displayed with content using markdown syntax. For example to display wikipedia logo, use below format:

![Wikipedia Logo](https://de.wikipedia.org/static/images/project-logos/dewiki-2x.png)
Format: ![Alt Text](url)

converts to:

Wikipedia Logo

How to use Markdown syntax to style the email message?

I personally use Chrome extension Markdown here to serve the purpose. It is quite easy to use.

Follow below steps to use it:

Woohaa! Now message will be looks like:

Hello,

An email with example message:

Enjoy :)


Discussion, links, and tweets

Hello My name is Surinder Kumar, I am Python and Javascript developer from India and work at EnterpriseDB as a software engineer.
I enjoy working on Python(primarily) and other latest technologies such as Node.js, React and like to contribute to open source projects.