The Ultimate Guide To Markdown

The Ultimate Guide To Markdown

What Is Markdown?

Markdown is a plain text formatting syntax used to write content on the web, It doesn’t take long to learn the Markdown syntax, and once you know how to use it, you can write using Markdown just about everywhere.Markdown is commonly used by programmers and content writers to write quickly without having to take time using editors. Markdown is also good for formatting everything from email messages to grocery lists.

Basic syntax

Nearly all markdown applications use the basic syntax, let's learn all the basic formatting techniques that you will get to start with markdown in no time.

Headings

Any line which is prefixed with # is converted to a heading the number of # indicates the level of heading for eg, One # goes from h1 till h6

MarkdownHTMLFinal Output
# Heading level 1<h1>Heading level 1</h1>

Heading level 1

## Heading level 2<h2>Heading level 2</h2>

Heading level 2

### Heading level 3<h3>Heading level 1</h3>

Heading level 3

#### Heading level 4<h4>Heading level 1</h4>

Heading level 4

##### Heading level 5<h5>Heading level 1</h5>
Heading level 4
###### Heading level 5<h6>Heading level 1</h6>
Heading level 5

Alternate Syntax

Use ==== form h1 and ---- form h2 Below your heading Alternate way of using the heading

MarkdownHTMLFinal Output
Heading level 1 example -----------------------<h1>Heading level 1 example</h1>

Heading level 1 example

Heading level 2 example =======================<h2>Heading level 2 example </h2>

Heading level 2 example

Paragraphs

MarkdownHTMLFinal Output
lorem Ipsum is simply dummy text of the printing and typesetting industry<p>lorem Ipsum is simply dummy text of the printing and typesetting industry</p>lorem Ipsum is simply dummy text of the printing and typesetting industry
Lorem Ipsum is simply dummy<p> Lorem Ipsum is simply dummy </p>Lorem Ipsum is simply dummy

Line Breaks

To add a line break <br> use two or more spaces and then return.

MarkdownHTMLFinal Output
This is first line example. And this is second example<p>This is first line example.<br> And this is second example</p>This is first line example. And this is second example

Emphasis

Bold

To bold text, add ** or __ before and after the text,

MarkdownHTMLFinal Output
**This text is bold**<b>This text is bold</b>This text is bold
__This text is bold__<b>This text is bold</b>This text is bold
This text is**bold**This text is <b>bold</b>This text is bold

Italic

To italicize text, add * or _ before and after the text,

MarkdownHTMLFinal Output
*This text is Italic*<em>This text is Italic</em>This text is Italic
_This text is Italic_<b>This text is Italic</b>This text is Italic
This text is*Italic*This text is <em>Italic</em>This text is Italic

Bold and Italic

MarkdownHTMLFinal Output
__*This text is Italic and bold*__<em><b>This text is Italic and bold </b></em>This text is Italic and bold
This text is _**Italic and bold**_This text is <em><b>Italic and bold </b></em>This text is Italic and bold
This text is__*Italic*__This text is <em><b>italic</b></em> and <em><b>bold</b></em>This text is italic and bold

Blockquotes

To create Blockquotes, just add > before your text or paragraph.

Example

> Lorem Ipsum is simply dummy text of the printing and typesetting industry

Output

Lorem Ipsum is simply dummy text of the printing and typesetting industry

Blockquotes with Multiple Paragraphs

Example

> Lorem Ipsum is simply dummy text of the printing and typesetting industry

> unchanged. It was popularised in the 1960s with the release.

Output

Lorem Ipsum is simply dummy text of the printing and typesetting industry

unchanged. It was popularised in the 1960s with the release.

Nested Blockquotes

To create nested bolckquotes use << before line or paragraph.

Example

> Lorem Ipsum is simply dummy text of the printing and typesetting industry
>> unchanged. It was popularised in the 1960s with the release.  
>  page editors now use Lorem Ipsum as their default model text,

Output

Lorem Ipsum is simply dummy text of the printing and typesetting industry

unchanged. It was popularised in the 1960s with the release.
page editors now use Lorem Ipsum as their default model text, and a

Lists

Ordered Lists

To create an unordered list add a numerical order number before the list item. The ordered list will order the list from number 1.

Example 1:

1. First item
2. Second item
3. Third item
4. Fourth item

Output :

  1. First item
  2. Second item
  3. Third item
  4. Fourth item

Example 2:

1. First item
5. Second item
3. Third item
4. Fourth item

Output :

  1. First item
  2. Second item
  3. Third item
  4. Fourth item

Example 3:

1. First item
5. Second item
     1. fifth item
     2.sixth item
3. Third item
4. Fourth item

Output :

  1. First item
  2. Second item
    1. fifth item
    2. sixth item
  3. Third item
  4. Fourth item

Unordered Lists

To create the unordered list use *,-,+ before the list item,

Example 1:

* First item
* Second item
* Third item
* Fourth item

Output :

  • First item
  • Second item
  • Third item
  • Fourth item

Code

To highlight your text use before and after your text ` something ` . or for code use ``` <code snippet> ```

Example: <html> <head> </head> </html>

<html>
  <head>
  </head>
</html>

To create a link, add text in the square bracket [ ] and the actual link in the round bracket( ).

Example:

[Article on CSS Position](https://mangeshthakre.hashnode.dev/css-selectors)

Output :

Article on CSS Position

Adding Image

To create a link, add alt text in the square bracket [ ] and the image link in the round bracket( ).

Example:

![alt text](https://www.markdownguide.org/assets/images/tux.png)

Output : alt text

Extended Syntax

Tables

Use hyphen ---- for column header and | for separating rows.

Example:

| Syntax      | Description |
| ----------- | ----------- |
| Header      | Title           |
| Paragraph   | Text        |

output :

SyntaxDescription
HeaderTitle
ParagraphText

Fenced Code Blocks

Use ``` ```

Example:

{ "firstName": "John", "lastName": "Smith", "age": 25 } Output :

{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Syntax Highlighting

use language after first ```` Example:

```javascript const obj = { "firstName": "John", "lastName": "Smith", "age": 25 } ``` ,

output :

const obj =  {
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}