What is markdown?
For formatting text in a plain-text editor, Markdown is a simple markup language.
1) Headings
Use the (#) sign in front of the word or phrase to add headings, and there are six levels to choose from for different heading sizes.
# Heading - 1
## Heading - 2
### Heading - 3
#### Heading - 4
##### Heading - 5
###### Heading - 6
Output:
2) Bold Text
There are two different ways to write bold text: use two asterisks (**) or two underscores (__) before and after the word or phrase.
**Bold text**
__Bold text__
Output:
3) Italic Text
There are two different ways to write Italic text: use one asterisk (*) or one underscore (_) before and after the word or phrase.
*Italic text*
_Italic text_
Output:
4) Paragraphs
There is no specific syntax for paragraphs, just write the plain text that's it.
There is no specific syntax for Paragraphs, just write the plain text that's it.
Output:
4) Lists
There are two types of lists ordered lists and unordered lists.
a) ordered list
To create ordered lists write the numbers followed by a full stop after that word or phrase.
1. list - 1
2. list - 2
3. list - 3
4. list - 4
1. list - 1
2. list - 2
3. list - 3
4. list - 4
Output:
NOTE: We can have a sub-list by giving indentation.
b) unordered lists
To create unordered list use symbols before the word (-) dash or Asterisk(*) or plus sign(+)
- list - 1
- list - 2
* list - 3
* list - 4
+ list - 5
+ list - 6
- list - 1
- list - 2
- list - 3
- list - 4
Output:
5) Code
To write code use three backticks (```) before and after the code.
for(var i=1;i<11;i++){
for(var j=1;j<11;j++){
}
}
Output:
Also, we can write code and keywords in between paragraphs by adding single backticks (`) before and after the code as shown in the below example
Keyword `for` is used for the for loop.
Output:
6) Image
To use the images in the markdown file use ![]()
, in brackets []
write the name of the image, and in parentheses ()
to give the image source link.
![image name](image link)
Output:
7) Links
To write links in the markdown file use []()
, in brackets, write the name of the link, and in parentheses ()
write the source link.
[LCO](https://web.learncodeonline.in/)
Output:
8) Blockquotes
To create blockquotes use this symbol (>) before the paragraph
> 1st rule of programming: If it works, don't touch it.
Output: