DEV Community

Luka Dušak
Luka Dušak

Posted on • Edited on

The Only Markdown Cheatsheet You Will Ever Need

You must have found yourself in a situation where you needed to write something using Markdown.

Wait, so what is Markdown anyway? It looks like plain text and kinda feels like HTML, but it’s neither of those things?

Don’t worry, I was a bit confused the first time I had to use Markdown. But after a short time, I got used to it and realized it was really cool. By the end of the article, you will know everything there is to know in order to be able to use Markdown on a daily basis.

Typewriter

Photo by Bernard Hermant on Unsplash

OK, tell me again, what is Markdown and where will I use it anyway?

Markdown is a lightweight markup language that you can use to format plain text documents.

You probably know that every repository on GitHub has its own README file that explains the very purpose of the repository. Every project needs good documentation. Documentation for GitHub is written using Markdown. That is exactly why it’s necessary to handle some basics well. The second reason is that you are most likely to attract new connections and improve your networking by having an attractive profile README.

That’s it! Enough theory for today. The pure practical part goes on.


Markdown Cheatsheet

There are a lot of elements you can write in Markdown, so let’s dive into it.

📄 I have also created PDF version of the Cheatsheet. You can find & download it here. Feel free to use it & share it! ✌🏼

PS. Please note that GitHub Markdown still needs to support some of the features below. Perhaps in the future, they might include it. Here you can find the GitHub link of the repo where I wrote detailed docs specifically for GitHub Markdown.

Paragraph

By writing the regular text, you are basically writing a paragraph.

Paragraph

Paragraph

Headings

There are 6 heading variants. The number of “#“ symbols, followed by text, indicates the importance of the heading.

Headings

Headings

Emphasis

Modifying text is so neat and easy. You can make your text bold, italic, strikethrough, highlighted, subscript, or superscript.

Emphasis

Emphasis

Blockquote

Want to emphasize the importance of the text? Say no more.

Blockquote

Blockquote

Images

If you are using GitHub, the best way is to simply drag & drop the image from your computer directly to README file. You can also create a reference to the image and assign it that way. Here is the syntax.

Images

Images

Links

Similar to images, links can also be inserted directly or by creating a reference. You can create both inline and block links.

Links

Links

Code

You can create both inline and full-block code snippets. You can also define the programming language you were using in your snippet. All by using backticks.

Code

Code Snippets

Lists

As you can do in HTML, Markdown allows the creation of both ordered and unordered lists.

Ordered List

Ordered List

Unordered List

Unordered List

You can also mix both lists and create sublists.

PS. Try not to create lists deeper than two levels. It’s the best practice.

Mix List

Mix List

It’s also possible to create definition lists (term — definition), something you may not use often, but there is a possibility.

Definition List

Definition List

Table

Great way to display well-arranged data. Use “|“ symbol to separate columns and “:“ symbol to align row content.

Table

Table

You can also create a “messy“ table by excluding outer “|“ symbols and not making your code well structured. Of course, it will still work, but hey → we should always arrange small things in the right way.

Messy Table

Messy Table

Task List

Keeping track of the tasks that are done and those that need to be done.

Task List

Task List

Footnote

Want to describe something at the end of the file? Use footnote!

Footnote

Footnote

Heading ID

You can give ID to a heading to jump straight to that part of the file from wherever you are.

Heading ID

Heading ID

Horizontal Line

You can use asterisks, hyphens or underlines (*, -, _) to create a horizontal line. The only rule is that you must include at least three chars of the symbol.

Horizontal Line

Horizontal Line

HTML

You can also use raw HTML in your Markdown file. Most of the time that will work well, but sometimes you can experience some differences that you are not used to when working with standard HTML. Using CSS will not work.

HTML

HTML

Voila!

Thank you for reading! I showed you everything there is to offer about using Markdown.

You can also download PDF version of the Cheatsheet & view docs specifically for GitHub Markdown here.

Feel free to use it and consider supporting me by giving it a star if you like it & following me on my socials! ✌🏼

Also, take a look at my GitHub README file that I created using Markdown.

You can also find some great Markdown docs here.


You can always find me on GitHub, LinkedIn and Twitter.

Let’s connect! 📲

Latest comments (38)

Collapse
 
martydevs profile image
Andre Marti

when i was discovering Markdown, for coding projects, I lef MS Word, makes you productive and let you straight in your articles.

If I would drop an aportation in this article, I create a documentation maded with a markdown library named material mkdocs with python and markdown with material styled UI for a Visual Basic Desktop App; Also this documentation is hosted with Gh pages

Collapse
 
sagnikghoshcr7 profile image
Sagnik Ghosh

Please add Collapsible Items too in this Cheatsheet

Collapse
 
imluka profile image
Luka Dušak

Well, the only way to add collapsible items is to add them using HTML tags. I did write a little about HTML in general. But now I have also included it in this article as well as my PDF version ✌🏼

Collapse
 
andre_adpc profile image
Andre Du Plessis • Edited

Thanks for this reference Luka. I like
the graphical way in which you presented it.

Here's a few you may want to consider adding:

Underlining Text

The standard methods don't work in the DEV.TO MD Editor, so you can use HTML tags as a workaround.

Underline

underline ( Not flying here ... )

__underline__
Enter fullscreen mode Exit fullscreen mode

Use:
My Underlined Text

<u>My Underlined Text</u>

Underline Italics

underline italics ( Not flying here ... )

__*underline italics*__
Enter fullscreen mode Exit fullscreen mode

Use:
My Underlined Italics Text

<u>*My Underlined Italics Text*</u>

Underline Bold

__**underline bold**__ ( Not flying here ... )
Enter fullscreen mode Exit fullscreen mode

Use:
My Underline Bold Text

<u>__**My Underline Bold Text**__</u>

Underline Bold Italics

__***underline bold italics***__ ( Not flying here ... )

Enter fullscreen mode Exit fullscreen mode

Use:
My Underlined Bold Italic Text

<u>__***My Underlined Bold Italic Text***__</u>

Underline Strikethrough

__~~Strikethrough~~__ ( Not flying here ... )
Enter fullscreen mode Exit fullscreen mode

Use:
My Stricken Text

<u>~~My Stricken Text~~</u>

The Underline Strikethrough is weird and ⅄Z∀ᴚƆ, someone might not want to use it, while others would be 🤔 this is Great ⅄Z∀ɹƆ but not ZǝupɐW

As far as Emojis go there are some great repos on those too, which you could add, seeing that its fairly common to use them here and other Forem sites, as you have shown.

Thanks for your effort with this, as well as the numerous great comments that comes/came from it, which all makes it a great reference thread too!

Collapse
 
imluka profile image
Luka Dušak

Great comment @andre_adpc, thanks for sharing!

Connection with HTML when writing Markdown is very strong, lots of possibilities. But I wanted to focus more on Markdown and leave the HTML to itself.

I will definitely include your tips in the PDF version I am currently working on ✌🏼

Collapse
 
stefaniefluin profile image
Stefanie Fluin

Oooo! Header IDs and highlighting text was new to me. Very nice summary 👌

Collapse
 
imluka profile image
Luka Dušak

Great, thanks @stefaniefluin! Very glad to hear that ✌🏼

Collapse
 
matija2209 profile image
matija2209

Thanks. That's actually useful.

Collapse
 
imluka profile image
Luka Dušak

You’re welcome @matija2209. Very glad to hear that ✌🏼

Collapse
 
jarvisscript profile image
Chris Jarvis

Great Cheat Sheet. I did know how to align tables. Just fixed a table that was bugging me. I hated the the content was no centered,

Thank you.

Collapse
 
imluka profile image
Luka Dušak

Awesome @jarvisscript! I'm glad to see that it worked for you.

No problem, happy to share 🤙🏼

Collapse
 
agedus profile image
Bas Top

Realy nice. I have also one of my own that I use for when I make notes or make readme`s. But there are some more things on here I did not now yet.

Collapse
 
imluka profile image
Luka Dušak

Thanks @agedus!

That's awesome! I'm really glad you could find something new here and include it in your own version ✌🏼

Collapse
 
loebkes profile image
Lui

Nice cheat sheet! Thank you for that.

As a major tip for any technical documentation that needs diagrams, I would mention Mermaid!
VSCode and IntelliJ need a small plugin for it.
Obsidian can render these diagrams too.

But the best thing is, that even GitHub can render these diagrams by default. So you can include diagrams in your Readme.md and its even git tracked.

Best way yet to include diagrams inside my markdown files!

Collapse
 
andre_adpc profile image
Andre Du Plessis

This is a great tip about Mermaid, thanks Ludwig!

Collapse
 
imluka profile image
Luka Dušak

It's my pleasure @loebkes!

Oh, I didn't know about that. Definitely going to check this up! Thank you for sharing great info!

Collapse
 
adriens profile image
adriens

Very artistic cheatsheet : thanks a lot for sharing the work.

Collapse
 
imluka profile image
Luka Dušak

The pleasure is mine. Thanks for the nice words @adriens!

Collapse
 
adriens profile image
adriens

Maybe could you transform this as a reponsive slideshow in which slides would move by themselves, like a reveal.js ? This could be a relaxing yet teaching object ;-p

Thread Thread
 
imluka profile image
Luka Dušak

That's a good idea. I will definitely see what I can do 👨🏼‍💻

Collapse
 
hellonearthis profile image
Brett Cooper

It's not really a cheatsheet if it can't be printed onto one sheet of A4 paper.

Collapse
 
imluka profile image
Luka Dušak

Well, I understand what you mean. But I wanted to include more examples. I feel that would benefit most of the people. Currently working on a PDF version that I'm also going to post, so you can check that up!