DEV Community

Garima
Garima

Posted on • Updated on

Markdown Cheat Sheet part-1

What is Markdown?

Markdown is a lightweight markup language for creating formatted text using a plain-text editor. Markdown is the easy to use syntax for styling the plain text on the GitHub platform.
You can use Markdown in most places around GitHub:-

  • GitHub repo readme.md file
  • Gist
  • Comments in issues and pull requests
  • Files with .md or .markdown extensions

Syntax Guide

Markdown also require some syntax specifications to write it !
Let's check what it is.

Header

  • # h1
  • ## h2
  • ### h3
  • #### h4
  • ##### h5
  • ###### h6

The heading is preceded by a '#' symbol 1 '#' marks symbolizes h1 and 2,3,4,5 '#' symbols indicates h1-h6 .Just make sure you have a space following them (after the '#' symbol).

I am h1 preceded by 1 # symbol.

I am h2 preceded by 2 # symbols.

I am h3 preceded by 3 # symbols.

I am h4 preceded by 4 # symbols.

I am h5 preceded by 5 # symbols.
I am h5 preceded by 5 # symbols.

Emphasis

Emphasis aka italics with *asterisks* or _underscores_.
Strong Emphasis aka Bold with **Double asterisks** or __double underscores__.
Combined emphasis with **asterisks and _underscores_**.
Strike Through with 2 tildes ~~Strike This~~.
Enter fullscreen mode Exit fullscreen mode

Emphasis aka italics with asterisks or underscores.
Strong Emphasis aka Bold with Double asterisks or double underscores.
Combined emphasis with asterisks and underscores.
Strike Through with 2 tildes Strike This.

Lists

#### Ordered list
1. First ordered list item
2. Second ordered list item
  1. First ordered intended list item
  2. Second ordered intended list item

#### Unordered list 
- First unordered list item.
- Second unordered list item.
  - First intended unordered list item.
  - Second intended unordered list item.

Some more ways to write unordered list .
* Unordered list can use a asterisks '*'.
- a minus.
+ or a plus.
Enter fullscreen mode Exit fullscreen mode

Ordered list

  1. First ordered list item.
  2. Second ordered list item.
    1. First ordered intended list item.
    2. Second ordered intended list item.

Unordered list.

  • First unordered list item.
  • Second unordered list item.
    • First intended unordered list item.
    • Second intended unordered list item.

Some more ways to write unordered list.

  • Unordered list can use a asterisks '*'.
  • a minus.
  • or a plus.

Top comments (5)

Collapse
 
tptshoe profile image
Mark Flegg

Nice! I did not know about using asterisk for lists, or how to do strike through, that's cool!

One small thing, in your examples of headings, I think it should be 'I am h2 preceded by 1 # symbol' etc. Followed by means they come after, like:

h1 # <-- this is h1 followed by 1 #
# h1 <-- this is h1 preceded by 1 #
Enter fullscreen mode Exit fullscreen mode
Collapse
 
garimasharma profile image
Garima

Okay thanks I'll update.

Collapse
 
jonasbn profile image
Jonas Brømsø

.mkdn is also common suffix for Markdown files

Collapse
 
epsi profile image
E.R. Nurwijayadi
Collapse
 
deeshansharma profile image
Deeshan Sharma

Cool.. really helpful, thanks for sharing buddy