0%

Mardown

Markdown语法

数学表达式

要启用这个功能,首先到Preference->Editor中启用。然后使用将产生如下的数学表达式:

$\lim_{x \to \infty} \exp(-x)=0$

下标

下标使用~包裹,例如:H~2~O将产生H~2~O, 即水的分子式。

上标

上标使用^包裹,例如:y^2^=4将产生表达式y^2^ = 4

插入表情:happy:

使用:happy:输入表情:happy:,使用:sad:输入表情:sad:,使用:cry:输入表情😢等。以此类推!

下划线

用HTML的语法<u>Underline</u>将产生下划线Underline.

删除线

GFM添加了删除文本的语法,这是标准的Markdown语法木有的。使用~~包裹的文本将会具有删除的样式,例如~删除文本~将产生删除文本的样式。

代码

  • 使用`包裹的内容将会以代码样式显示,例如
1
使用`printf()`

则会产生printf()样式。

  • 输入``或者然后回车,可以输入代码块,并且可以选择代码的语言。例如:
1
2
3
public Class HelloWorld{
System.out.println("Hello World!");
}

将会产生

1
2
3
public Class HelloWorld{
System.out.println("Hello World!");
}

强调

使用两个*号或者两个_包裹的内容将会被强调。例如

1
2
**使用两个*号强调内容**
__使用两个下划线强调内容__

将会输出

使用两个*号强调内容
使用两个下划线强调内容
Typroa 推荐使用两个*号。

斜体

在标准的Markdown语法中,*和_包裹的内容会是斜体显示,但是GFM下划线一般用来分隔人名和代码变量名,因此我们推荐是用星号来包裹斜体内容。如果要显示星号,则使用转义:

1
\*

插入URL连接

使用尖括号包裹的url将产生一个连接,例如:<www.baidu.com>将产生连接:.

如果是标准的url,则会自动产生连接,例如:www.google.com

目录列表Table of Contents(TOC)

输入[toc]然后回车,将会产生一个目录,这个目录抽取了文章的所有标题,自动更新内容。

水平分割线

使用***或者---,然后回车,来产生水平分割线。


标注

我们可以对某一个词语进行标注。例如

1
2
某些人用过了才知道[^注释]
[^注释]:Somebody that I used to know.

将产生:

某些人用过了才知道注释
注释: Somebody that I used to know.

把鼠标放在注释上,将会有提示内容。

表格

1
2
3
4
5
|姓名|性别|毕业学校|工资|
|:---|:---:|:---:|---:|
|杨洋|男|重庆交通大学|3200|
|峰哥|男|贵州大学|5000|
|小阳|女|北京大学|2000|

将产生:

姓名 性别 毕业学校 工资
杨洋 重庆交通大学 3200
峰哥 贵州大学 5000
小阳 北京大学 2000

其中代码的第二行指定对齐的方式,第一个是左对齐,第二个和第三个是居中,最后一个是右对齐。

数学表达式块

输入两个美元符号,然后回车,就可以输入数学表达式块了。例如:

1
$$\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}$$

将会产生:

任务列表

使用如下的代码创建任务列表,在[]中输入x表示完成,也可以通过点击选择完成或者没完成。

1
2
3
- [ ] 吃饭
- [ ] 逛街
- [ ] 看电影
  • [x] 吃饭

  • [x] 逛街

  • [x] 看电影

  • [x]

列表

输入+, -, *,创建无序的列表,使用任意数字开头,创建有序列表,例如:

1
2
3
4
**无序的列表**
* tfboys
* 杨洋
* Mr.Smith

无序的列表

  • tfboys
  • 杨洋
  • Mr.Smith
1
2
3
4
**有序的列表**
1. 苹果
6. 香蕉
10. 我都不喜欢

有序的列表

  1. 苹果
  2. 香蕉
  3. 我都不喜欢

块引用

使用>来插入块引用。例如:

1
>这是一个块引用!

将产生:

这是一个块引用!

标题

使用#表示一级标题,##表示二级标题,以此类推,有6个标题。

Markdown插件

画图

Sequence Diagrams

1
2
3
4
Andrew->China: Says Hello
Note right of China: China thinks\nabout it
China-->Andrew: How are you?
Andrew->>China: I am good thanks!
1
2
3
4
Andrew->China: Says Hello
Note right of China: China thinks\nabout it
China-->Andrew: How are you?
Andrew->>China: I am good thanks!

Flowcharts

1
2
3
4
5
6
7
8
st=>start: Start
op=>operation: Your Operation
cond=>condition: Yes or No?
e=>end

st->op->cond
cond(yes)->e
cond(no)->op

Mermaid

  • 官网链接:支持时序图、流程图、甘特图、 类图、 状态图、派图
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%% Example with selection of syntaxes
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid

section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d

section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d

section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h

section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
%% Example with selection of syntaxes
gantt
dateFormat  YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid

section A section
Completed task            :done,    des1, 2014-01-06,2014-01-08
Active task               :active,  des2, 2014-01-09, 3d
Future task               :         des3, after des2, 5d
Future task2               :         des4, after des3, 5d

section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison          :crit, done, after des1, 2d
Create tests for parser             :crit, active, 3d
Future task in critical line        :crit, 5d
Create tests for renderer           :2d
Add to mermaid                      :1d

section Documentation
Describe gantt syntax               :active, a1, after des1, 3d
Add gantt diagram to demo page      :after a1  , 20h
Add another diagram to demo page    :doc1, after a1  , 48h

section Last section
Describe gantt syntax               :after doc1, 3d
Add gantt diagram to demo page      : 20h
Add another diagram to demo page    : 48h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
classDiagram
      Animal <|-- Duck
      Animal <|-- Fish
      Animal <|-- Zebra
      Animal : +int age
      Animal : +String gender
      Animal: +isMammal()
      Animal: +mate()
      class Duck{
          +String beakColor
          +swim()
          +quack()
      }
      class Fish{
          -int sizeInFeet
          -canEat()
      }
      class Zebra{
          +bool is_wild
          +run()
      }
1
2
3
4
5
pie
title Pie Chart
"Dogs" : 386
"Cats" : 85
"Rats" : 150
pie
    title Pie Chart
    "Dogs" : 386
    "Cats" : 85
    "Rats" : 150