DEV Community

Cover image for What is Markdown and how you can use it to write README.md file for your GitHub project?
Subroto Kumar
Subroto Kumar

Posted on

What is Markdown and how you can use it to write README.md file for your GitHub project?

Markdown is a lightweight markup language that allows us to write in easy-to-read text format and convert it into XHTML (or HTML) to display in a browser or another writing program.


Paragraph

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Enter fullscreen mode Exit fullscreen mode
Output:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


Line-Break

To insert a line break into your Markdown file, finish your line with at least two spaces and press ENTER key. It will render a new line for your text.

Hey there  
I'm a coder.
Enter fullscreen mode Exit fullscreen mode
Output:

Hey there
I'm a coder.


Text Formatting

1. Using Italics in text

To use Italics in text, surround the targeted part of text with single asterisks (*) or single underscores (_).

This is *Morax*.
I'm a _programmer_.
Enter fullscreen mode Exit fullscreen mode
Output:

This is Morax.
I'm a programmer.


2. Using Bold in text

Bold text is created by using two asterisks (**) or two underscores (__).

This is **Morax**.
I'm a __programmer__.
Enter fullscreen mode Exit fullscreen mode
Output:

This is Morax.
I'm a programmer.


3. Using Asterisk or Underscore in a Text

To use a literal asterisk or Underscore in a text, precede it with an escape character backslash ()
e.g.,
\_This is all \*\*plain\*\* text\_.

Output:

_This is all **plain** text_.


Horizontal Line

To draw Horizontal rule, put three or more hyphens (-), asterisks (*), or underscores (_) in a new line.

_ _ _
* * *
_ _ _
Enter fullscreen mode Exit fullscreen mode
Output:

Image description

Heading

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Enter fullscreen mode Exit fullscreen mode
Output:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Making List

Ordered List

1. Java
2. Python
3. Go
Enter fullscreen mode Exit fullscreen mode
Output:
  1. Java
  2. Python
  3. Go

Unordered List

- Java
  - Core Java
  - Advance Java
- Python
- Go
Enter fullscreen mode Exit fullscreen mode
Output:
  • Java
    • Core Java
    • Advance Java
  • Python
  • Go

Tracking task lists

- [x] Windows
- [x] Linux
- [ ] MacOS
Enter fullscreen mode Exit fullscreen mode
Output:

Image description


Building Table

Language | Use 1 | Use 2
- | - | -
Java | Mobile App Development | Cloud-based Application
Python | AL & ML | Data analytics
C# | Game Development | Mobile Apps
Enter fullscreen mode Exit fullscreen mode
Output:
Language Use 1 Use 2
Java Mobile App Development Cloud-based Application
Python AL & ML Data analytics
C# Game Development Mobile Apps

Quoting Text

> "If you don't take risks, you can't create a future!" - Monkey D. Luffy`
Enter fullscreen mode Exit fullscreen mode
Output:

"If you don't take risks, you can't create a future!" - Monkey D. Luffy

> I’ll leave tomorrow’s problems to tomorrow’s me.” – Saitama
> “Being weak is nothing to be ashamed of… Staying weak is !!“ – Fuegoleon Vermillion
Enter fullscreen mode Exit fullscreen mode
Output:

I’ll leave tomorrow’s problems to tomorrow’s me.” – Saitama
“Being weak is nothing to be ashamed of… Staying weak is !!“ – Fuegoleon Vermillion


Link and Image

Using Image

Syntax:

![Image_discription](image-url)

![Picture](https://images.unsplash.com/photo-1496065187959-7f07b8353c55?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTJ8fHRlY2hub2xvZ3l8ZW58MHx8MHx8&auto=format&fit=crop&w=500&q=60)
Enter fullscreen mode Exit fullscreen mode
Output:

Picture

Using Link

Syntax:

[Link-text](url)

[My Linkedin](https://www.linkedin.com/in/kumarsubroto)
Enter fullscreen mode Exit fullscreen mode
Output:

My Linkedin


Code snippets

This is `code`
Enter fullscreen mode Exit fullscreen mode

Output:

This is code


Code Blocks

Syntax:

Image description

Output:

Image description


Syntax:

Image description

Output:

Image description


Extra-Resources

Github Markdown Emoji

Thank you being with me and reading my article. If you like my post, follow me on Dev.to and do connect with me on LinkedIn and GitHub.

Top comments (0)