Markdown Cheatsheet

Markdown Cheatsheet

Let's understand the basics of markdown

What is the use of Markdown?

  • Lightweight markup language with a plain text formatting syntax.

  • Markdown is simply a file extension used to document your code using markdown language and is the default documentation option in most code repositories like GitHub or GitLab.

  • In GitHub, a markdown file is created with the name README.md

Heading

To create a heading, add number signs (#) in front of a word or phrase. The number of number sign you use should correspond to the heading level.

You can structure your texts in the following way:

# Title
## Subtitle
### Another deeper title
#### deeper title
##### text heading title
###### normal text heading

You can use one `#` all the way up to `######` six for different title sizes

You can structure your texts in the following way:

Output:

Title

Subtitle

Another deeper title

deeper title

text heading title
normal text heading

List

Unordered List

To create an unordered list of items, you can use the hyphen(-) and space as a prefix to the list item, as shown below:

- Bread
- Milk
- Butter

It will output a bulleted unordered list like this:

  • Bread

  • Milk

  • Butter

The alternate syntax for the unordered list uses the asterisks(*) symbol instead of the hyphen(-) we used above.

* Bread
* Milk
* Butter

It will output of unordered list like this:

  • Bread

  • Milk

  • Butter

Ordered List of Items

You can prefix the list items with the 1. and space for the ordered list.

1. Shopping
2. Swimming
3. Reading

Output:

  1. Shopping

  2. Swimming

  3. Reading

Blockquote

Use the > symbol with space as a prefix to render a text as a quote(or blockquote).

> This is a blockquote

Output:

This is a blockquote

Bold

You need to use two asterisks(**) symbols as a prefix and a suffix to highlight a text as bold.

**bold text**

Output:

bold text

Italic

You need to use single asterisk(*) symbol as a prefix and suffix to highlight a text as italic.

*Italic text*

output:

Italic text

Bold and Italic

You need to use three asterisks(***) symbols as a prefix and a suffix to highlight a text as both bold and italic.

***Bold and Italic text***

output:

Bold and Italic text

Strikethrough:

To achieve strikethrough in markdown we can write the words in between pairs of 2 ~(Tilde) symbols at the start and 2 ~(Tilde) symbols at the end.

~~Strikethrough text~~

Output:

Strikethrough text

Code Snippet

It starts with triple back ticks(```) and ends with the same and then mentions the programming language name.

```js
console.log('Hello World');
```
console.log('Hello World');

Table

A table is made using pipes and hyphens.

| FirstName     | LastName       | City     |
| ------------- | -------------- | -------- |
| FirstName1    | LastName1      | City1    |
| FirstName2    | LastName2      | City2    |

output:

FirstNameLastNameCity
FirstName1LastName1City1
FirstName2LastName2City2

Inline Code

The inline code syntax uses the backtick symbols(``) around the code to highlight it.

The syntax goes like this:

`JavaScript`

Output:

JavaScript

Images

If you want to insert images, this is how you do it:

![Image](https://plus.unsplash.com/premium_photo-1667859385445-b8afacae6f91?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80)

Output:

image

Link

To create a link, enclose the link text in brackets (e.g., [Google]) and then follow it immediately with the URL in parentheses (e.g., (google.com)).

[Google](https://google.com )
<https://google.com>

Output:

Google

https://google.com

Horizontal Rule

---

Our discussion of markdown is now complete. If you have made it this far, thank you so much. I would love to hear what you think.

Please comment below and if you want to connect follow me on Twitter.