As I was starting out with Github, I always wondered that how can people get to learn about markdown? It seemed to me, like completely whole alien’s language using “#” or “##”. I thought I would never be able to learn this language, at least not in this life. Who knew I was going to be wrong. If you are like me and you think that you too can’t learn Github markdown syntax, you might be wrong. So, in this article, we will learn about markdown syntax and what is markdown in general. So, let’s start.
What is Markdown?
Before we start learning anything, we must know what it is. Markdown is a lightweight markup language that we can use to add formatting to a plain-text document on the web. We can transform the text to italic, bold, or underlined and we can create lists, links, and heading using alpha-numeric characters like ‘*’ and ‘#’. Sometimes, we also use markdown as a utility to convert the files into HTML(Hyper-text markup language).
It was developed by John Gruber in 2004 and is almost the world’s most popular markup language. Markdown is often used to format README.md files, for writing messages in the online discussion forums, and to create rich posts, Like In Dev. to, you can only write and format posts using markdown.
P.S. Don’t forget to follow me there. 😜
Github Flavored Markdown (GFM).
Github has released its own markdown language based on the original markdown. GFM provides an additional set of useful features, many of which make it easier to work with content on GitHub.com. Most of It is almost the same as markdown.
Markdown Syntax
Heading
Almost in the every-text document, you will see the headings. Like Html in markdown, we also have six headings based on their size(H1-H6). The syntax of the headings is ‘# ’.
# heading 1
## heading 2
### heading 3
#### heading 4
##### heading 5
###### heading 6
Bold text
In Markdown, we use “**….**” to make the text bold.
**This will be Bold**
Italic text
In Markdown, we use “*….*” to make the text italic.
*This will be italic*
Italic and bold text
In Markdown, we use “***….***” to make the text italic.
***This will be both bold and italic***
Lists
Like Html in markdown, we also have two types of lists.
- Ordered List
- UnOrdered list
So let’s discuss both of them.
Ordered List
In markdown, we can easily create an ordered list in the way given below.
1. item 1
2. item 2
3. item 3
1. sub-item 1 of item 3
2. sub-item 2 of item 3
UnOrdered List
In markdown, we can easily create an unordered list in the way given below.
* item 1
* item 2
* item 3
* sub-item 1 of item 3
* sub-item 2 of item 3
Links
In markdown, we can create links using “[Name of Website](address of the website)”
[Github](https://www.github.com)
Images
In markdown, we can create links using “![Alt-text for image](address of the image)”
![Github logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
BlockQuotes
In markdown, we use “>” for writing quotes.
As Albert Einstein said:
> Insanity is repeating things and excepting different results.
Escape Sequences
In markdown, there are some words that are the syntax of markdown, and what if we need them in our text? To write the words which are the syntax of markdown we have to use “\” in front of that words and those words are
\ backslash
` backtick
* asterisk
_ underscore
{} curly braces
[] square brackets
() parentheses
# hash mark
+ plus sign
— minus sign (hyphen)
. dot
! exclamation mark
Conclusion
These were some important syntax that you will need most of the time. This is not the complete markdown cheat sheet, there may be some more left. I guess these are quite enough to get your work done and most people never go beyond these. I hope you have learned something from my article. If you want to learn more about markdown, check out this cheat sheet by Github, where you will also learn some of the GFM Syntax. To practice the markdown, feel free to check out this app.
This article was originally published at medium
Top comments (0)