learn-markdown

What is Markdown?


Markdown is a lightweight markup language for creating formatted text using a plain-text editor. Markdown is extensively used for creating readme files and in the API documentation.


The way of thinking behind Markdown is that plain content should be crisp and clear without the taggings muddling everything up. However, there should still be text modifiers present such as italics, bolds, etc.


Why use Markdown?


Recently Markdown is getting popular and has become a go-to language in API documentation because of its simplicity. With growing API documentation Markdown has been used extensively for creating documentation for the following reasons:

  1. Markdown is easy to write and no complicated syntax.

  2. Markdown can be easily converted into HTML.

  3. Markdown can be viewed with a text editor as well as with the browser.


Where it is used?


Since Markdown is easy to read, write, and publish, markdown popularity has been growing ever since it has been introduced. Following are the places where Markdown is used:


  1. Markdown is a standard for open source site- GitHub for writing the readme files.

  2. Tools such as Swagger, RAML, ReadMe.io, and Apiary.io uses Markdown to publish HTML files for the API documentation.

  3. Markdown is used in different flavors on Skype, Slack, and Facebook Messenger.




Here are the 10 tips which we have compiled for you understand markdown syntax and become a pro user:


  1. Using Headings

Add number signs (#) in front of a sentence to create headings. The number of “#” determines the heading level.



Markdown

Output

# Heading level 1

Heading level 1

## Heading level 2

Heading level 2

### Heading level 3

Heading level 3


NOTE: You must add a space between “#” and the starting word of the sentence.




  1. Using Paragraphs


You should use a blank line to separate one or more lines of text. The new lines create a new paragraph.



Markdown

Output

This is a sentence.


Paragraphs are easy to write.

This is a sentence.

Paragraphs are easy to write.



NOTE: Do not indent paragraphs with spaces or tabs unless there is a specific need for it.



  1. Using Italics text


Add one asterisk before and after a word or phrase to italicize.



Markdown

Output

I love *Markdown*.

I love Markdown.

Markdown is *easy* to understand.

Markdown is easy to understand.


NOTE: You can also use an underscore instead of an asterisk. However, it is not a good practice to use underscore.




  1. Using Bold text


Add two asterisk before and after a word or phrase to italicize.



Markdown

Output

I love **Markdown**.

I love Markdown.

Markdown is **easy** to understand.

Markdown is easy to understand.


NOTE: You can also use two underscores instead of asterisks. However, it is not a good practice to use underscores.




  1. Using Bold and Italics text


Add three asterisk before and after a word or phrase to italicize.



Markdown

Output

I love ***Markdown***.

I love Markdown.

Markdown is ***easy*** to understand.

Markdown is easy to understand.


NOTE: You can also use three underscore instead of asterisks. However, it is not a good practice to use underscores.




  1. Using a Numbered list (Ordered list)


Add line items with numbers followed by periods for example 1. 

Do not use 1) or 1). Or >1.


The numbers don’t have to be in numerical order, however, the list should always start with the number one.


Markdown

Output

1. First item

2. Second item

3. Third item

4. Fourth item

  1. First item
  2. Second item
  3. Third item
  4. Fourth item

1. First item

1. Second item

1. Third item

1. Fourth item

  1. First item

  2. Second item

  3. Third item

  4. Fourth item


2. First item

3. Second item

    1. Indented item

    2. Indented item

4. Third item

  1. First item
  2. Second item
    1. Indented item
    2. Indented item
  3. Third item




  1. Using a bulleted list (Un-ordered list)


Add line items with asterisks (*) or plus (+) or an underscore (_).


You should choose any one of three and use them consistently across your full content.


Markdown

Output

* First item

* Second item

* Third item

* Fourth item

  • First item
  • Second item
  • Third item
  • Fourth item

- First item

- Second item

- Third item

    - Indented item

    - Indented item

- Fourth item

  • First item
  • Second item
  • Third item
    • Indented item
    • Indented item
  • Fourth item




  1. Using code blocks


When you need to cite a block of code or a phrase, then you must indent four spaces of a tab before the lines of code. When the lines of code is inside a list, use two tabs or eight spaces.


Markdown


1.  Open the file.

2.  Find the following code block on line 21:


        <html>

          <head>

            <title>Test</title>

          </head>


3.  Update the title to match the name of your website.


Output






  1. Using links


To create links, you should use the following syntax:

[Link text which appears](Link url)


Markdown

I love [Facebook](https://www.facebook.com/).


Output

I love Facebook.




  1. Using images


To add images, you should use the following syntax:

![Alterntate text goes here](image URL patch)





  1. Using tables


To create tables you need to use the pipe (|) and hyphen (-) characters. 

To define the columns you must use “|” and define the header row by using hyphens.



Markdown


| Syntax | Description |

| ----------- | ----------- |

| Header | Title |

| Paragraph | Text |


Output





Conclusion

Markdown is a lightweight markup language that is easy to write and read. It can be converted directly into HTML that makes it very easy to publish on the web. There is several application that uses Markdown.


Some of the web application like GitHub defines “.md” files as the standard to document the readme files. There are also various other application that uses different flavors of this language. 


If you found this article helpful, please share it.


Thanks for reading it.

Cheers 🍻


0 Comments