大多数 markdown 解析器忽略单行分隔符,为了上其他 markdown 解析器识别行分隔符,可以在末尾使用两个空格,或者插入
标题有6个等级,用 # 号表示
# 标题1
## 标题2
### 标题3
#### 标题4
##### 标题5
###### 标题6
使用 > 字符,表示引用
> This is a blockquote with two paragraphs. This is first paragraph.
>
> This is second pragraph.Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> This is another blockquote with one paragraph. There is three empty line to seperate two blockquote.
This is a blockquote with two paragraphs. This is first paragraph.
This is second pragraph.Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
This is another blockquote with one paragraph. There is three empty line to seperate two blockquote.
输入 * 将会创建一个无序列表,也可以使用 + 或者 -
* Red
* Green
* Blue
输入 1. 将会创建有序列表
1. Red
2. Green
3. Blue
用 [ ] 或者 [X] 未完成,完成)表示列表,通过点击复选框来更改状态(完成/未完成)
- [ ] a task list item
- [ ] list syntax required
- [ ] normal **formatting**, @mentions, #1234 refs
- [ ] incomplete
- [x] completed
使用 ```<语言> 按回车键,将会对代码进行高亮
```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
可以使用MathJax呈现LaTeX数学表达式。
$$
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\
\end{vmatrix}
$$
使用 | First Header | Second Header | 按回车键,将会创建2列的表格
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
还可以使用 : 号,来设置文字对齐方式
| Left-Aligned | Center Aligned | Right Aligned |
| :------------ |:---------------:| -----:|
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
Left-Aligned | Center Aligned | Right Aligned |
---|---|---|
col 3 is | some wordy text | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
使用 [^footnote] 创建脚注.
[^footnote]: Here is the *text* of the **footnote**.
然后,可以把鼠标停留在脚注中,查看内容
You can create footnotes like this[1].
生产环境,可以像这样使用
You can create footnotes like this[^1].
[^1]: Here is the *text* of the **footnote**.
You can create footnotes like this[2].
输入 *** 或者 — 后,按回车键
---
输入 [toc] ,按回车键
文字描述包含在 [] 内,链接地址包含在 () 内,() 要紧接着 [] 后面
This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.
This is an example inline link.
This link has no title attribute.
引用链接样式,使用两个 []
This is [an example][id] reference-style link.
Then, anywhere in the document, you define your link label like this, on a line by itself:
[id]: http://example.com/ "Optional Title Here"
This is an example reference-style link.
Then, anywhere in the document, you define your link label like this, on a line by itself:
Type 简化了使用方法,如下
[Bing][]
And then define the link:
[Bing]: http://bing.com/
Bing
And then define the link:
在链接格式前面添加 ! ,如下
![timg.jpg](https://upload-images.jianshu.io/upload_images/6226097-1613f3353bb9ec89.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
对应 HTML 的 标签
*single asterisks*
_single underscores_
single asterisks
single underscores
如果像使用 * 号,在 * 号前使用 \
\*this text is surrounded by literal asterisks\*
this text is surrounded by literal asterisks
**double asterisks**
__double underscores__
double asterisks
double underscores
在文章中现实代码,用 ` 号表示
Use the `printf()` function.
Use the printf()
function.
~~Mistaken text.~~
Mistaken text.
下划线由 HTML 提供
Underline
用两个 : 号包含单词,或者在 编辑 -> 表情与符号 中选择
:happy:
2.8Emoji.png
这个功能默认是关闭的,如果要打开这个功能(以 Mac 版本为例),选择 Typora -> 偏好设置 -> markdown 标签,勾选内联公式复选框
$\lim_{x \to \infty} \exp(-x) = 0$
下面是简书风格,typora 与之类似
[外链图片转存失败(img-ob3ypFvY-1566353506163)(https://math.jianshu.com/math?formula=%5Clim_%7Bx%20%5Cto%20%5Cinfty%7D%20%5Cexp(-x)]%20%3D%200)
这个功能默认是关闭的,如果要打开这个功能(以 Mac 版本为例),选择 Typora -> 偏好设置 -> markdown 标签,勾选下标复选框
H~2~O
H2O
这个功能默认是关闭的,如果要打开这个功能(以 Mac 版本为例),选择 Typora -> 偏好设置 -> markdown 标签,勾选上标复选框
X^2^
X2
这个功能默认是关闭的,如果要打开这个功能(以 Mac 版本为例),选择 Typora -> 偏好设置 -> markdown 标签,勾选高亮复选框
==highlight==
2.12高亮.png
可以使用 HTML 样式来写 Markdown,比如
this text is red
3.1嵌入内容.png
Typora 官方文档
简书 Markdown 语法