Markdown cheatsheet
Ming Sun / October 17, 2022
13 min read • ––– views
Headers
# H1
## H2
### H3
#### H4
##### H5
###### H6
# H1
## H2
### H3
#### H4
##### H5
###### H6
Emphasis
Emphasis, aka italics, with asterisks or underscores.
Strong emphasis, aka bold, with asterisks or underscores.
Combined emphasis with asterisks and underscores.
Strikethrough uses two tildes. Scratch this.
Superscript1
Subscript1
Emphasis, aka italics, with *asterisks* or _underscores_.
Strong emphasis, aka bold, with **asterisks** or __underscores__.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
Superscript<sup>1</sup>
Subscript<sub>1</sub>
Lists
- Unordered list can use asterisks
- Or minuses
- Or pluses
* Unordered list can use asterisks
- Or minuses
+ Or pluses
Links
[I'm an inline-style link](https://www.google.com)
[I'm an inline-style link with title](https://www.google.com "Google")
[I'm a reference-style link][Arbitrary case-insensitive reference text]
[I'm a relative reference to a repository file](../blob/master/LICENSE)
[You can use numbers for reference-style link definitions][1]
Or leave it empty and use the [link text itself].
URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or <http://www.example.com> and sometimes
example.com (but not on Github, for example).
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://www.mozilla.org
[1]: http://slashdot.org
[link text itself]: http://www.reddit.com
I'm an inline-style link with title
I'm a relative reference to a repository file
You can use numbers for reference-style link definitions
Or leave it empty and use the link text itself.
URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or http://www.example.com and sometimes example.com (but not on Github, for example).
Some text to show that the reference links can follow later.
Images
Here's our logo (hover to see the title text):
Inline-style:
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")
Reference-style:
![alt text][logo]
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2"
Code and Syntax Highlighting
Inline code
has back-ticks around
it.
Inline `code` has `back-ticks around` it.
// Javascript
function add(num1, num2){
return num1+num2;
}
# Python
def add(num1, num2){
return num1+num2
}
Tables
Colons can be used to align columns.
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
There must be at least 3 dashes separating each header cell.
The outer pipes (|) are optional, and you don't need to make the
raw Markdown line up prettily. You can also use inline Markdown.
Markdown | Less | Pretty
--- | --- | ---
*Still* | `renders` | **nicely**
1 | 2 | 3
Colons can be used to align columns.
Tables | Are | Cool |
---|---|---|
col 3 is | right-aligned | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
Markdown | Less | Pretty |
---|---|---|
Still | renders | nicely |
1 | 2 | 3 |
Horizontal Rule
Three or more...
---
Hyphens
***
Asterisks
___
Three or more...
Hyphens
Asterisks
Blockquotes
> Blockquotes are very handy in email to emulate reply text.
> This line is part of the same quote.
Quote break.
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.
Quote break.
This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can put Markdown into a blockquote.
Inline HTML
// title with border bottom
<h2 className="border-b" style={{paddingBottom: `10px`}}><div>Inline HTML</div></h2>
JSX components
Pros card:
<ProsCard title={`Skills`} pros={["analog IC design", "power management", "mixed-signal"]} />
Images:
<MyImage
alt={`Voltage mode Buck`}
src={`/static/images/abcs-of-voltage-mode/voltage-mode-buck.png`}
width={600}
height={425}
fig={`Voltage-mode Buck block diagram`}
figRef={`4`}
figNum={`1`}
/>
Equations:
<MathEquation equ={`${"`V_2=D*V_g=D*V_1`"}`} eqNum={1}/>