Markdown has gained popularity because it's easy to use and it's widely accepted across platforms.
You can use markdown to write content that can be conveyed in plain text. A good example would be a blog post.
In this article, you'll learn what markdown is and how to use it.
What is Markdown?
Markdown is a markup language just like HTML. We use it to parse text and convert it into a specific format. You can also think of it as a text to HTML converter tool.
Many developers like writing in markdown because it gives them fine-grained control over their text and code. We'll see how and why in the coming paragraphs.
In this guide we'll cover the following topics.
- How to create your first markdown file.
- Create a cheat sheet for markdown
- Discuss how markdown can be rendered in VS Code
Tools that Support Markdown
Markdown works in any browser even if you use a simple notepad. But there are certain tools that can help enhance your productivity by providing a real time view (of markdown and rich text) side by side.
The following are some of the tools that support working with markdown:
- VSCode (We'll cover this in this article)
- Sublime text
How to Work with Markdown
Download VSCode and enable the plugin
VSCode is a text editor like notepad, but it has many more capabilities. You can also use it for coding and it supports numerous programming languages.
We'll be using VSCode to write and render markdown files.
You can download VSCode from here.
Once your download is completed, activate the below extension:
How to create your first markdown file
To work with markdown, simply save the text file with
.md extension. After that, you'll be able to apply markdown syntax.
After creating your file and activating the plugin, the workspace should look something like this.
Markdown in action
In markdown, we use a specific syntax to denote headings, bold text, lists, and other text formatting.
You can refer to the table below for an overview of basic markdown syntax:
|Unordered list||* List item * List item|
|Code Block||`insert code here`|
Simply start writing in your
.md file and see the results side by side.
How to write code blocks in Markdown
There is language support available for many programming languages in VSCode.
Here are some examples of coding in different languages.
Code blocks for HTML and Bash
Code blocks for Python and JS
Escape characters in markdown
If you want the browser to ignore the syntax and retain the characters, the characters can be escaped using the backslash
For instance, \* would not parse its succeeding characters as italics.
Practical Applications of Markdown
You can use markdown in email templates, and it is a natural fit for technical documentation.
A great example for markdown is the GitHub README.md file. There, code blocks are easily combined with well-formatted text.
Download the Markdown Cheat Sheet
I've compiled all the tips you've learned here in a cheat sheet.
You can download the cheat sheet here.
By now I hope you're confident enough to write your own markdown. Once you get the hang of it, it's easy enough. Apart from being simple, it is also very powerful and widely accepted.
If you found this post helpful, share it :)
Check out my other blog posts. Let's connect on Twitter.