Markdown Cheatsheet
This guide will help you to create rich formatted text for any .md file(Markdown).
What is Markdown ?
Markdown is an easy to use language used to format your text. Use markdown syntax to add bold, italics, tables, lists, links, code blocks to blocks of texts.
Heading
Heading can be formed in several ways. Text in Single Hash(#) will be interpreted as an <h1>
HTML tag (a big header). Text in Double Hashes(##) will be interpreted as an <h2>
HTML tag (a smaller header). You can assume as, it will run from <h1>
to <h6>
tag.
# This is Heading 1
## This is Heading 2
### This is Heading 3
#### This is Heading 4
##### This is Heading 5
###### This is Heading 6
Output
This is Heading 1
This is Heading 2
This is Heading 3
This is Heading 4
This is Heading 5
This is Heading 6
List
There are two types of list :
- Order List
- Unorder List
Order List
Order List is used to create a list of related items, in a specific order. Just add numbers followed by a space before each line of text. Any line that begins with a numbered format, even if it isn't 1, will automatically create an ordered list.
1. One
2. Two
3. Three
2. Four
3. Five
Output
- One
- Two
- Three
- Four
- Five
Note: If numbering sequence while defining is incorrect even tough output will automatically reflect in a correct sequence.
Unorder List
Unorder List is used to create a list of related items, in no particular order. Also, called bullet lists, It uses asterisk *, hyphen - or plus + to create an unordered list.
* one
- two
+ three
Output
- one
- two
- three
Nesting in Unorder List
To nest one list within another, indent each item in the sub-list by four spaces.
Nested Unorder List
- Fruit
- Vegetable
- Grocery
- Rice
- Cooking oil
- Flour
Output
- Fruit
- Vegetable
- Grocery
- Rice
- Cooking oil
- Flour
Link
Create a link by placing the link text within square brackets[Text] and the URL in parentheses. It create clickable link and make sure no spaces between the two brackets
[Text](Link)
Output
Horizontal Line
A line with at least three hyphens will create a horizontal line across the entire comment or description. Include an extra line break after any text before the line of hyphens to prevent the hyphens from being interpreted as header syntax.
---
This is Horizontal Line
---
Output
This is Horizontal Line
Table
To add a table, use three or more hyphens (---) to create each column’s header, and use pipes (|) to separate each column. For compatibility, you should also add a pipe on either end of the row.
| Syntax | Description |
| ----------- | :----------- |
| Header | Title |
| Paragraph | Text |
Output
Syntax | Description |
Header | Title |
Paragraph | Text |
Inline Code
Highlight any code in the paragraph. Add an inline formatted code by enclosing the text within a single backtick ( ` ) on either side Inline code
.
Hello `let` is a keyword
Output
Hello
let
is a keyword
Image
Use of image from server or other remote location
![LCO](https://learncodeonline.in/mascot.png)
Output
Blockquotes
Indent the text by adding an angle bracket (>) to the beginning of each line of the text that you'd like to quote. The text inside a blockquote will be formatted properly only when it is separated from the rest of the text by a blank line.
> Hello
Output
Hello
Text
There are two type of text:
- Bold Text
- Italic Text
Bold Text
To bold text, add two asterisks or underscores before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters.
Bold text is the ** This is Bold text. **
Output
Bold text is the This is Bold text.
Italic Text
To italicize text, add one asterisk or underscore before and after a word or phrase. To italicize the middle of a word for emphasis, add one asterisk without spaces around the letters.
Italicized text is the * This is Italicized text. *
Enclose your text within a *single asterisk* or _underscore_ to create Italic text.
Output
Italicized text is the This is Italicized text.
Enclose your text within a single asterisk or underscore to create Italic text.
Images
Images can be added to any markdown page using the following markdown syntax:
![Image-name](image-path)
Output
Line Break
Add two spaces at the end of the line
Note : This is my first line. (<-- two spaces)
This is my first line.
This is my second line.
Output
This is my first line.
This is my second line.