Get to know “Markdown”

By Peng Xie

Markdown-mark.svg_-1024x630
What is Markdown?

Markdown is a lightweight markup language that is natural to write and easy to convert to rich text and other formats such as HTML or PDF. Because of its simplicity and portability, it has become the go-to option for developers to document their codes and README files. Find a random repository on GitHub, you’re likely to see at least one file in it written in Markdown. In addition to developer communities, Markdown is also supported in a variety of other places such as blogs and forums. Even some instant messaging apps now have Markdown-inspired formatting features.

Markdown in GitHub

As one of the most popular places where people use Markdown extensively, GitHub actually has its own version of Markdown syntax which is called GitHub Flavored Markdown (GFM for short). Being a Git hosting service, GitHub uses GFM to provide users additional features such as the ability to reference issues, pull requests and SHA-1 hashes of commits.

Markdown in WordPress

WordPress supports Markdown as well but you have to enable it first in your blogs settings. In Settings under Configure section of the side menu, you can turn on Markdown support for composing in the Writing tab and for comments in the Discussion tab. After saving the settings, you can start to write your new blog posts in WordPress using Markdown. As a matter of fact, this whole blog post is written in Markdown!

Time to play?

Now that you know more about Markdown, let’s see some examples!

Codes

You can either put your code inline like this or add a code block in your file like what I’m going to show you below.

This is a code block!

The syntax for inline code is to wrap your code inside a pair of `.
To use a code block, simply put ``` at the lines above and below your code block.

Links

[link to Google](https://google.com)
will be rendered by a Markdown viewer as
link to Google

Lists

* Unordered list item 1
* Unordered list item 2

1. Ordered list item 1
2. Ordered list item 2

The code block above will be rendered as:
* Unordered list item 1
* Unordered list item 2

  1. Ordered list item 1
  2. Ordered list item 2

That’s just a few simple examples of Markdown. There are many other ways and styles to write in Markdown. If you are interested, you can checkout GitHub’s guide on Markdown and the Markdown support page for WordPress.

Also, checkout this awesome post on Ray Wenderlich for some recommendations on Markdown editors for MacOS.

Bonus

Hey, thanks for reading this blog post! Here’s a bonus section for you! Do you know that you can make presentation slides using Markdown as well? I found an interesting presentation writer on GitHub called Marp. Just separate your slides with --- between empty lines and you can literally write a whole presentation using Markdown in a single file!

Advertisements