Andrew (he/him)
Posted on June 8, 2020
Markdown is the language of DEV posts, and is a super-lightweight way to add some pizzazz to your plaintext. It consists of a few easy-to-remember (and easy-to-type) shortcuts. If you're learning Markdown for the first time (or just have trouble remembering what does what) bookmark this cheat sheet and come back to it as necessary.
Common Formatting
To make text italic
...use _single underscores_ or *single asterisks*
To make text bold
...use __double underscores__ or **double asterisks**
To make text bold and italic
...use __*asterisks in double underscores*__,
**_underscores in double asterisks_**,
_**double asterisks in underscores**_, or
*__double underscores in asterisks__*
To add inline code
...use `single backticks`
To add
a code
block
use
```
triple
backticks
```
or
indent
four
spaces
1234
To add
Headings
of various
sizes
use
# one
## or more
### octothorpes
To add horizontal rules (like the one above), write three or more hyphens in a row:
---
- To create
- ordered lists
- of items
1. simply write
1. "1. " before
1. each item
- To create
- unordered lists
- of items
- simply write
- "- " before
- each item
- Create sublists
- by indenting
- four spaces
- for each level
- four spaces
- by indenting
1. Create sublists
- by indenting
1. four spaces
- for each level
To create a hyperlink
put the [link text in square braces](https://timecube.2enp.com/)
(followed by the URL in parentheses)
To create a blockquote
> begin the quote with "> "
To strikethrough text
use ~~double~~ tildes
To add an inline image
Use the same syntax as for a hyperlink, but prepend a '!':
![Trogdor, the Burninator](https://dev-to-uploads.s3.amazonaws.com/i/sguw2x61byhenjclhmmj.png)
pssst hey kid, want some
Super Secret Markdown Tips (They* don't want you to know about!)
Need to write a literal *, _, etc. character?
Escape them by preceding them with backslashes: \*
, \_
Need to put backticks inside inline code?
Use double-backticks `with backticks` inside
``Use double-backticks `with backticks` inside``
Need to put triple-backticks inside a code block?
```
indent four spaces
and then add the backticks
```
``` indent four spaces and then add the backticks ```
Need to put a code block in a list?
- Just make sure
-
To indent
four spaces
to keep the numbering contiguous
1. Just make sure 1. To indent ``` four spaces ``` 1. to keep the numbering contiguous
Need to put a block of code in a blockquote?
You might want to do something like
small bug on DEV.to -- first line is indented one space val x = 42 val y = 42 * 19
...just make sure you start each line with "> "
> You might want to do something like > > small bug on DEV.to -- first line is indented one space > val x = 42 > val y = 42 * 19 > > ...just make sure you start each line with "> "
Need fancy syntax highlighting to impress your friends and frighten your enemies?
def foo (val bar: Int, baz: Double): String = { ... }
Just put the name of the programming language after the initial ```:
```scala
def foo (val bar: Int, baz: Double): String = { ... }
```
Got any tough Markdown problems you need help solving? Got any tips or tricks for those new to the (plaintext formatting syntax) game? Let me know in the comments below!
* The Markdown Illuminati, not to be confused with the Marky Mark Illuminati
Posted on June 8, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.