Markdown 101

Philosophy

Markdown is a lightweight markup language with plain text formatting syntax. Its design allows it to be converted to many output formats. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor. Markdown's syntax is intended for one purpose: to be used as a format for writing for the web. Markdown is a lightweight markup language that you can use to add formatting elements to plain text documents. It was created by John Gruber in 2004. Markdown is now one of the world's most popular markup languages.

Markdown syntax is designed to be readable and unobstrusive, so the text in markdown files can be read even if it isn't rendered.

Markdown in not a replacement for HTML, or even close to it. Its syntax is very small subset of HTML tags. The overriding design goal for markdown's formatting syntax is to make it as readable as possible. The idea is that a markdown-formatted document should be publishable as-is, as plaintext, without looking like it's be marked up with tags or formatting instructions.

Syntax

HEADERS

Markdown supports two styles of headers, Setext and atx.

Setext-style headers are "underlined" using equal signs for first-level headers and dashes for second level headers.

Header 1

Header 1
========

Header 2

Header 2
--------

Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example:

Heading 1

# Heading 1

Heading 2

## Heading 2

Heading 3

## Heading 3

Heading 4

#### Heading 4
Heading 5
##### Heading 5
Heading 6
###### Heading 6

EMPHASIS

Emphasis, aka italics using asterisks or underscores.

*asterisks* or _underscores_

For strong emphasis, aka bold using two asterisks or two underscores

**two asterisks** or __two underscores__

For strikethrough use two tildes(~). Strikethrough

~~Strikethrough~~

There are two ways to create links.

Inline Link

[Inline Link](http://www.example.com)

Inline link with title

[Inline link with title](http://www.example.com "Example Website")

Reference type Link
line text itself

[Reference type Link][reference]
....
[reference]: http://example.com
[line text itself]: http://example.com

Images

Images can be included in multiple ways same as the links. It use the following syntax -
![Alt Text][link of the image]

Github Logo

![Github Logo](https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png)

It can also benefit from other advantages of the link syntax such as reference link syntax.

Letter Inside Bottle

![Letter Inside Bottle][bottle image link]
....
....
[bottle image link]: https://cdn.pixabay.com/photo/2018/05/28/22/11/message-in-a-bottle-3437294__340.jpg

Lists

For including unordered lists in the document you can use * or - and a space for list items.

  • List item one
  • List item wwo

  • Another list item

  • Some another list item
* List item one
* List item wwo

- Another list item 
- Some another list item

For including ordered list we prefix each list item with its number followed by one dot(.) and one space after the number.

1. Ordered list item 1
2. Ordered list item 2
  1. Ordered list item 1
  2. Ordered list item 2

You can use the same number for multiple items, orded will be auto created.

1. Some item
1. Some item
  1. Some item
  2. Some item

Code

To include code in your document you need to indent the block to four spaces or one tab or you can use contain all the code inside pair of a set of three backtics ( ``` )

..../* This is a comment in a code block*/
....for int i := 0; i < n; i++ {
....    // do something
....    // here leading dots(.) repesent spaces.
....}

```
// some code here

```

If there is a need for inline code for eg. var i = 0 you can use backticks( `some code` ).