- Published on
Markdown 教程
介绍
通过“unified”以及其他 remark 和 rehype 包支持 Markdown 和 Mdx 解析。 “next-mdx-remote”允许我们以更灵活的方式解析“.mdx”和“.md”文件,而无需接触 webpack。
使用 GitHub 风味的 Markdown。 mdx-prism
提供代码块的语法突出显示功能。这是所有内容的演示。
以下 Markdown 备忘单改编自: https://guides.github.com/features/mastering-markdown/
什么是 Markdown?
Markdown是一种在网络上设置文本样式的方法。您可以控制文档的显示;将单词设置为粗体或斜体,添加图像和创建列表只是我们可以用Markdown做的一些事情。大多数情况下,Markdown只是普通文本加上一些非字母字符,比如“#”或“*”。
语法指导
这里有一个Markdown语法的概述,你可以在GitHub.com上的任何地方或你自己的文本文件中使用。
标题
# This is a h1 tag
## This is a h2 tag
#### This is a h4 tag
This is a h1 tag
This is a h2 tag
This is a h4 tag
强调文本
_This text will be italic_
**This text will be bold**
_You **can** combine them_
This text will be italic
This text will be bold
You can combine them
列表
无序
- Item 1
- Item 2
- Item 2a
- Item 2b
- Item 1
- Item 2
- Item 2a
- Item 2b
有序
1. Item 1
1. Item 2
1. Item 3
1. Item 3a
1. Item 3b
- Item 1
- Item 2
- Item 3
- Item 3a
- Item 3b
图片

Format: 
链接
http://github.com - automatic!
[GitHub](http://github.com)
http://github.com - automatic! GitHub
区块引用
As Kanye West said:
> We're living the future so
> the present is our past.
As Kanye West said:
We're living the future so the present is our past.
行内代码
I think you should use an
`<addr>` element here instead.
I think you should use an <addr>
element here instead.
语法高亮
下面是如何使用语法高亮显示的示例 GitHub Flavored Markdown:
```js:fancyAlert.js
function fancyAlert(arg) {
if (arg) {
$.facebox({ div: '#foo' })
}
}
```
这是它的样子——颜色很漂亮,带有风格的代码标题!
function fancyAlert(arg) {
if (arg) {
$.facebox({ div: '#foo' })
}
}
脚注
Here is a simple footnote[^1]. With some additional text after it.
[^1]: My reference.
这里有一个简单的脚注1. 后面还有一些附加的文本。.
任务列表
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete item
- list syntax required (any unordered or ordered list supported)
- this is a complete item
- this is an incomplete item
表格
您可以通过组合单词列表并使用连字符-(用于第一行)分隔它们,然后使用管道分隔每列来创建表 |
:
| First Header | Second Header |
| --------------------------- | ---------------------------- |
| Content from cell 1 | Content from cell 2 |
| Content in the first column | Content in the second column |
First Header | Second Header |
---|---|
Content from cell 1 | Content from cell 2 |
Content in the first column | Content in the second column |
删除线
Any word wrapped with two tildes (like ~~this~~
) will appear crossed out.
Footnotes
My reference. ↩