Github Flavoured Markdown CheatSheet

2022年03月03日3 分钟
0 浏览

Introduction

The following markdown cheatsheet is adapted from: https://guides.github.com/features/mastering-markdown/

条件

Adapted from: https://guides.github.com/features/mastering-markdown/

What is Markdown?

Markdown is a way to style text on the web. You control the display of the document; formatting words as bold or italic, adding images, and creating lists are just a few of the things we can do with Markdown. Mostly, Markdown is just regular text with a few non-alphabetic characters thrown in, like # or *.

Syntax guide

Here’s an overview of Markdown syntax that you can use anywhere on GitHub.com or in your own text files.

Headers

1
# This is a h1 tag
2
3
## This is a h2 tag
4
5
#### This is a h4 tag

This is a h1 tag

This is a h2 tag

This is a h4 tag

Emphasis

1
_This text will be italic_
2
3
**This text will be bold**
4
5
_You **can** combine them_

This text will be italic

This text will be bold

You can combine them

Lists

Unordered

1
- Item 1
2
- Item 2
3
- Item 2a
4
- Item 2b
  • Item 1
  • Item 2
    • Item 2a
    • Item 2b

Ordered

1
1. Item 1
2
1. Item 2
3
1. Item 3
4
1. Item 3a
5
1. Item 3b
  1. Item 1
  2. Item 2
  3. Item 3
    1. Item 3a
    2. Item 3b

Images

Code

1
http://github.com - automatic!
2
[GitHub](http://github.com)

http://github.com - automatic! GitHub

Blockquotes

1
As Kanye West said:
2
3
> We're living the future so
4
> the present is our past.

As Kanye West said:

We're living the future so the present is our past.

Inline code

1
I think you should use an
2
`<addr>` element here instead.

I think you should use an <addr> element here instead.

Syntax highlighting

Here’s an example of how you can use syntax highlighting with GitHub Flavored Markdown:

'fancyAlert.js'

1
function fancyAlert(arg) {
2
if (arg) {
3
$.facebox({ div: '#foo' })
4
}
5
}

And here's how it looks - nicely colored with styled code titles!

Footnotes

Here is a simple footnote[^1]. With some additional text after it.

[^1]: My reference.

Here is a simple footnote1. With some additional text after it.

Task Lists

1
- [x] list syntax required (any unordered or ordered list supported)
2
- [x] this is a complete item
3
- [ ] this is an incomplete item
  • list syntax required (any unordered or ordered list supported)
  • this is a complete item
  • this is an incomplete item

Tables

You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe |:

| First Header                | Second Header                |
| --------------------------- | ---------------------------- |
| Content from cell 1         | Content from cell 2          |
| Content in the first column | Content in the second column |
First HeaderSecond Header
Content from cell 1Content from cell 2
Content in the first columnContent in the second column

Strikethrough

Any word wrapped with two tildes (like ~~this~~) will appear crossed out.

  1. My reference.

Made By Yvan