Markdown Basics Cheat Sheet

Understand all about Markdown (for absolute beginners)

Markdown Basics Cheat Sheet

What is Markdown? Why we use it?

Markdown is one of the world's most popular markup languages, meaning, the data represented to the end users can be made different from the document's content by using this language. These files have .md as their extension. Markdown has many advantages:

  • People use it to create websites, documents, notes, books, presentations, email messages, and technical documentation.
  • Markdown is platform independent and portable.
  • Markdown is future proof.

Also, the README.md files are written in this language to explain our projects clearly, in Github. Even to write this blog, we use Markdown syntaxes in Hashnode. So, not only these, there are many other applications like Reddit, which supports Markdown.

So, let's learn the basics of Markdown.

Basics of Markdown

Headings

# Heading 1
## Heading 2
### Heading 3
#### Heading 4

Output:

image.png

For compatibility, always put a space between the signs and the heading name.

Paragraphs

This is my line one.
This is my line two.
For next line, use two spaces after the end of first statement and click enter.
Then write your second statement in new line.

You can also use <br> tags for nextline.

Output:

You can also use
tags for nextline.

Emphasis

- Bold

To make the text as bold, enclose it using two asterisks or two underscores.

I'm **bold**
<br>
Even I'm __bold__

Output:

I'm bold
Even I'm bold

- Italic

To make the text as italic, enclose it using single asterisk or single underscore.

I'm *italic*
<br>
Even I'm _italic_

Output:

I'm italic
Even I'm italic

Markdown applications cannot handle underscores in the middle of a word. So, it's better to use two asterisks for bold text and one asterisk for italic text.

  • To bold and italicize the middle of a word for emphasis, the best practice is to add three asterisks without spaces around the letters.
This ***highlighted text*** is so important.

Output:

This highlighted text is so important.

Blockquotes

> To create a blockquote, add a > in front of a paragraph.

Output:

To create a blockquote, add a > in front of a paragraph.

> Blockquotes can contain multiple paragraphs. Add a '>'
> 
> on the blank lines between the paragraphs.

Output:

Blockquotes can contain multiple paragraphs. Add a '>'

on the blank lines between the paragraphs.

Lists

- Unordered lists

To create an unordered list, add dashes (-), asterisks (*), or plus signs (+) in front of line items. Indent one or more items to create a nested list.

- Item 1
* Item 2
+ Item 3
    - Item 4
+ Item 5

Output:

  • Item 1
  • Item 2
  • Item 3
    • Item 4
  • Item 5

- Ordered lists

To create an ordered list, add line items with numbers followed by periods. The numbers don’t have to be in numerical order, but the list should start with the number one. Observe the numbers in output.

1. Item 1
3. Item 2
2. Item 3
7. Item 4

Output:

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4

You can nest an unordered list in an ordered list, or vice versa.

Code

To denote a word or phrase as code, enclose it in backticks (```).

#include<iostream>
using namespace std;

int main()
{

     return 0;
}

To embed links use "[]()" syntax for name of the link and the actual link respectively.


[Give Link-Name(Click here)](https://swathiwrites.hashnode.dev/)

Output:

Click here

Image

To embed images use ! before "[]()"

![Markdown](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/1200px-Markdown-mark.svg.png)

Output:

Markdown

Table

| Syntax      | Description |
| ---------- | ----------- |
| Header     | Title          |
| Paragraph| Text        |
SyntaxDescription
HeaderTitle
ParagraphText

Conclusion

image.png These are the frequently used markdown syntaxes. Hope this article added some value to your learning. Thanks for reading :)

References

Markdown Guide