Guide for Markdown Files

Guide for Markdown Files

Markdown cheatsheet for Begineers


What is Markdown?

According to the markdown guide:

Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. Created by John Gruber in 2004, Markdown is now one of the world’s most popular markup languages.

A Markdown file has a .md extension. It's very popular and easy to use.

HTML tags are also supported in markdown.

Use Cases of Markdown

  • People use it to create websites, documents, notes, books, presentations, email messages, and technical documentation.

  • Websites like Reddit, Github, Dev.to, Discord and lots of desktop and web-based applications use markdown.


How to get started with Markdown

The best way to get started with Markdown is to use it. That’s easier than ever before thanks to a variety of free tools.

You don’t even need to download anything. There are several online Markdown editors that you can use to try writing in Markdown. Dillinger is one of the best online Markdown editors. Just open the site and start typing in the left pane. A preview of the rendered document appears in the right pane.

Basic Syntaxes

Heading

To create a heading add a (#) sign in front of a word or phrase. The number of # represents the level of heading. Just like HTML, there is only six levels of headings.

syntax:

# Heading1
## Heading2
### Heading3
#### Heading4  
##### Heading5
###### Heading6

Output:

Heading1

Heading2

Heading3

Heading4

Heading5
Heading6

Comments

We can also add comments in Markdown files using HTML comments.

Syntax:

<!--This is a comment-->
This is the text i want to show.

Output:

This is the text i want to show.


Emphasis

You can add emphasis by making text bold or italic.

Bold:

Syntax:

This is **Bold**

Output:

This is Bold

Syntax:

**This is multiple words in Bold**

Output:

This is multiple words in Bold

Italic:

Syntax:

This is *Italic*

Output:

This is Italic

Bold and Italic:

Syntax:

This text is ***really Important***

//In above statement really important is bold and italic both.

This text is **really *Important*** 

//In above statement really important is bold but only important is italic.which means the two astericks at end represents bold syntax but the first one is for italics.

Output:

This text is really Important
This text is really Important


Strikethrough

Syntax:

~~Strikethrough~~

Output:

Strikethrough


Blockquote Text

Syntax:

> "This is a Quote."

Output:

"This is a Quote."


Syntax:

[Text](Link)

This is a [Dillinger](https://dillinger.io) Website.

Output:

This is a Dillinger Website.


Images

To add an image, add an exclamation mark (!), followed by alt text in brackets, and the path or URL to the image asset in parentheses.

Syntax:

![alt text](Image)

Output:

This is test Image


Linking an Image

To add a link to an image, enclose the Markdown for the image( ![alt text](Image) )in brackets, and then add the link in parentheses.

Syntax:

[![alt text](Image)](hyperlink)

Output:

alt text


Lists

You can organize items into ordered lists, unordered lists, and checkbox lists.

Ordered lists:

Syntax:

* Item-1
* Item-2
* Item-3

Output:

  • Item-1

  • Item-2

  • Item-3

Unordered lists:

Syntax:

1. Item-1
1. Item-2
1. Item-3

Output:

  1. Item-1

  2. Item-2

  3. Item-3

Checkbox lists:

Syntax:

[x] Item-1
[x] Item-2
[x] Item-3
[ ] Item-4

Output:


Code

There are two ways to format code in Markdown. You can either use inline code, by putting backticks (`) around parts of a line, or you can use a code block.

Inline Code:

Syntax:

`Hello, World!`

Output:

Hello, World!

Code Block:

You can write code in code blocks

Syntax:

```
var add2 = function(number) {
  return number + 2;
}
```
( or )
to highlight the syntax of code add name of the language after backticks, for example:
```js
var add2 = function(number) {
  return number + 2;
}
```

Output:


var add2 = function(number) {
  return number + 2;
}

var add2 = function(number) {
  return number + 2;
}

Horizontal line

Syntax:

---

Output:


Emojis

Syntax:

This is a :mango:
This is a :lemon:

Output:

This is a 🥭

This is a 🍋


Table

Syntax:

| Column-1 | Column-2 |
| -------- | -------- |
| Row1coulumn1 | Row1column2 |
| Row2coulumn1 | Row2column2 |
Column-1Column-2
Row1coulumn1Row1column2
Row2coulumn1Row2column2

Table with Alignment

Syntax:

| Column-1(left)      | Column-2(center)      | Column-3(right) |
| :--- | :---: | ---: |
| Row1coulumn1 | Row1column2 | Row1column3 |
| Row2coulumn1 | Row2column2 | Row2column3 |

Output:


Conclusion

This is the list for all of you as your guide. Hope all went well and you enjoyed the article.

Hope this helps you. Thanks for reading.

Suggestion for any improvement or addition to this article.