Typora编辑快速查询表

作用 MarkDown语法 快捷键 备注
目录 [toc] 自动更新
标题 # 1级标题 ## 2级标题 ALT+1;ALT+2; 增大ALT+加号
减小ALT+减号
删除线 ~~删除内容~~ Alt+Shift+5
斜体 *斜体* Ctrl+I 字母i
加粗 **加粗** Ctrl+B
下划线 <u>下划线的内容</u> Ctrl+U
高亮 ==高亮== 需勾选扩展语法
注释 <!--注释内容--> 导出后不显示
下标 H~2~O 需勾选扩展语法
上标 面积 m^2^ 需勾选扩展语法
脚注 使用 [^footnote]创建脚注
使用[^footnote]:创建脚注内容
表情符号 :smile: 输入:后会跳出选择
表格 |表格第一列|表格第二列| Ctrl+T |分隔单元格,
-分隔表头
引用 >引用内容 >>嵌套引用
无序列表 - 列表* 列表+ 列表 shift+Tab键退回上层
有序列表 1. 列表 使用数字 + . + 空格 使用\.来转义
任务列表 - [ ] 任务一
- [x] 勾选任务
-空格[空格]空格文字 双回车退出
代码 通过``插入行内代码
通过```插入代码块
使用向下键盘跳出
分割线 多个----或***或——
外部跳转 [link text](link) Ctrl+左键访问
内部跳转 [跳转](#目的标题)
跳转点我
自动链接 使用 <> URL/邮箱
会自动转换为链接
ctrl + k
图片 ![自定义名](路径)
包括本地和网络
ctrl+shift+i 可直接拖拽
可定义图片自动保存
视频 <video src="xxx.mp4" />
流程图 代码块中语言graph
序列图 代码块中语言sequence diagram
饼图 代码块中语言Pie
甘特图 代码块中语言gantt
html风格 this text is red 可以使用 HTML 样式来写

其他功能快捷键

功能 快捷键
跳转到文章开头 ctrl+home
跳转到文章结尾 ctrl+end
选中一整行 ctrl+l
选中单词 ctrl+d
选中相同格式的文字 ctrl+e
搜索 ctrl+f
全局搜索(多文件) ctrl+shift+f
替换 ctrl+h
清楚格式 ctrl+\
切换显示源码 ctrl+/

Typora教程 - 图1快捷键参考链接

MarkDown基础视频

基础篇

点击查看【bilibili】

画图篇

点击查看【bilibili】

标题

  1. # 标题名字(井号的个数代表标题的级数)

文字

删除线

  1. 这就是 ~~删除线~~ (使用波浪号)

这就是 删除线 (使用波浪号)

快捷键:Alt+shift+5

斜体

  1. 这是用来 *斜体* _文本_

这是用来 斜体 的 文本

快捷键:Ctrl+i

加粗

  1. 这是用来 **加粗** __文本__

这是用来 加粗文本

快捷键:Ctrl+B

斜体+加粗

  1. 这是用来 ***斜体+加粗*** ___文本___ *DAD*

这是用来 斜体+加粗文本

下划线

下划线是HTML语法

下划线 下划线(快捷键command+u,视频中所有的快捷键都是针对Mac系统,其他系统可自行查找)

高亮(需勾选扩展语法)

  1. 这是用来 ==斜体+加粗== 的文本

这是用来 斜体+加粗 的文本

注释

  1. 这是用来注释内容<!--注释内容文字--> 注释后导出不显示。

下标(需勾选扩展语法)

  1. H~2~O
  2. 双氧水 H~2~O~2~

水 HO

双氧水 HO

上标(需勾选扩展语法)

  1. 面积 m^2^
  2. 体积 m^3^

面积 m
体积 m

脚注

  1. You can create footnotes like this[^1].

这是一个脚注示例。[1]

表情符号

Emoji 支持表情符号,你可以用系统默认的 Emoji 符号( Windows 用户不一定支持,自己试下~)。 也可以用图片的表情,输入 : 将会出现智能提示。

一些表情例子

  1. :smile: :laughing: :dizzy_face: :sob: :cold_sweat: :sweat_smile: :cry: :triumph: :heart_eyes: :relaxed: :sunglasses: :weary:
  2. :+1: :-1: :100: :clap: :bell: :gift: :question: :bomb: :heart: :coffee: :cyclone: :bow: :kiss: :pray: :sweat_drops: :hankey: :exclamation: :anger:

Typora教程 - 图2 Typora教程 - 图3 Typora教程 - 图4 Typora教程 - 图5 Typora教程 - 图6 Typora教程 - 图7 Typora教程 - 图8 Typora教程 - 图9 Typora教程 - 图10 Typora教程 - 图11 Typora教程 - 图12 Typora教程 - 图13 Typora教程 - 图14 Typora教程 - 图15 Typora教程 - 图16 Typora教程 - 图17 Typora教程 - 图18 Typora教程 - 图19 Typora教程 - 图20 Typora教程 - 图21 Typora教程 - 图22 Typora教程 - 图23 Typora教程 - 图24 Typora教程 - 图25 Typora教程 - 图26 Typora教程 - 图27 Typora教程 - 图28 Typora教程 - 图29 Typora教程 - 图30 Typora教程 - 图31

( Mac: control+command+space点选)

表格

使用 | 来分隔不同的单元格,使用 - 来分隔表头和其他行:

  1. name | price
  2. --- | ---
  3. fried chicken | 19
  4. cola|5

为了使 Markdown 更清晰,|- 两侧需要至少有一个空格(最左侧和最右侧的 | 外就不需要了)。

name price
fried chicken 19
cola 5

为了美观,可以使用空格对齐不同行的单元格,并在左右两侧都使用 | 来标记单元格边界,在表头下方的分隔线标记中加入 :,即可标记下方单元格内容的对齐方式:

  1. | name | price |
  2. | :------------ | :---: |
  3. | fried chicken | 19 |
  4. | cola | 32 |
name price
fried chicken 19
cola 32

使用快捷键command+opt+T更方便(段落→表格→插入表格,即可查看快捷键)

  • 使用ctrl+Enter新增行数
  • 使用shift+Enter在表格内换行

引用

  1. >“后悔创业”

“后悔创业”

  1. >也可以在引用中
  2. >>使用嵌套的引用

也可以在引用中

使用嵌套的引用

列表

无序列表—符号 空格

  1. * 可以使用 `*` 作为标记
  2. + 也可以使用 `+`
  3. - 或者 `-`

使用Backspace,shift+Tab键退回上层

  • 可以使用 * 作为标记

  • 也可以使用 +

  • 或者 -

有序列表—数字 . 空格

  1. 1. 有序列表以数字和 `.` 开始;
  2. 3. 数字的序列并不会影响生成的列表序列;
  3. 4. 但仍然推荐按照自然顺序(1.2.3...)编写。
  1. 有序列表以数字和 . 开始;
  2. 数字的序列并不会影响生成的列表序列;
  3. 但仍然推荐按照自然顺序(1.2.3…)编写。markdown 可以使用:数字\. 来取消显示为列表(用反斜杠进行转义)

任务列表

  1. 未勾选任务:-空格[空格]空格 文字
  2. 已勾选任务:-空格[空格]空格 文字
  • 这是一个任务列表
  • 这是一个勾选的任务列表

-[ ] dase

代码

代码块

  1. ```语言名称
  1. public static void main(String[] args) {
  2. }

行内代码

  1. 也可以通过 ``,插入行内代码(` 是 `Tab` 键上边、数字 `1` 键左侧的那个按键):
  2. 例如 `Markdown`

Markdown

转换规则

代码块中的文本(包括 Markdown 语法)都会显示为原始内容

分隔线

可以在一行中使用三个或更多的 *-_ 来添加分隔线(``):

  1. ***
  2. ------
  3. ___



跳转

外部跳转—超链接

格式为 [link text](link)

  1. [帮助文档](https://support.typora.io/Links/#faq)

帮助文档

内部跳转—本文件内跳(Typora支持)

格式为 [link text](#要去的目的地--标题)

  1. [我想跳转](#饼图(Pie))

Open Links in Typora You can use command+click (macOS), or ctrl+click (Linux/Windows) on links in Typora to jump to target headings, or open them in Typora, or open in related apps.

我想跳转

自动链接

使用 <> 包括的 URL 或邮箱地址会被自动转换为超链接:

  1. <https://www.baidu.com>
  2. <123@email.com>

https://www.baidu.com

123@email.com

图片

  1. ![自己起的图片名字](图片地址或者图片本地存储的路径)

网上的图片

  1. ![friedChicken](https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1580814517&di=2630beac440e5dab0e44c7286a3b2b61&src=http://imgsrc.baidu.com/forum/w=580/sign=12c730c4ff03738dde4a0c2a831ab073/9497794f9258d1091818e6d6d858ccbf6d814d1b.jpg)

Typora教程 - 图32

本地图片

  1. ![friedChicken](friedChicken.jpg)
  2. 在同一个文件夹里(用相对路径)
  3. 或者直接拷贝

Typora教程 - 图33

Typora教程 - 图34

视频

可以像嵌入图片一样嵌入视频URL

  1. <video src="xxx.mp4" />

利用Markdown画图(需勾选扩展语法)

Typora教程 - 图35

markdown画图也是轻量级的,功能并不全。

Mermaid 是一个用于画流程图、状态图、时序图、甘特图的库,使用 JS 进行本地渲染,广泛集成于许多 Markdown 编辑器中。Mermaid 作为一个使用 JS 渲染的库,生成的不是一个“图片”,而是一段 HTML 代码。

(不同的编辑器渲染的可能不一样)

流程图(graph)

概述

  1. graph 方向描述
  2. 图表中的其他语句...

关键字graph表示一个流程图的开始,同时需要指定该图的方向。

其中“方向描述”为:

用词 含义
TB 从上到下
BT 从下到上
RL 从右到左
LR 从左到右

T = TOP,B = BOTTOM,L = LEFT,R = RIGHT,D = DOWN

最常用的布局方向是TB、LR。

  1. graph TB;
  2. A-->B
  3. B-->C
  4. C-->A

Typora教程 - 图36

  1. graph LR;
  2. A-->B
  3. B-->C
  4. C-->A

Typora教程 - 图37

流程图常用符号及含义

节点形状

表述 说明 含义
id[文字] 矩形节点 表示过程,也就是整个流程中的一个环节
id(文字) 圆角矩形节点 表示开始和结束
id((文字)) 圆形节点 表示连接。为避免流程过长或有交叉,可将流程切开。成对
id{文字} 菱形节点 表示判断、决策
id>文字] 右向旗帜状节点

单向箭头线段:表示流程进行方向

id即为节点的唯一标识,A~F 是当前节点名字,类似于变量名,画图时便于引用 括号内是节点中要显示的文字,默认节点的名字和显示的文字都为A

  1. graph TB
  2. A
  3. B(圆角矩形节点)
  4. C[矩形节点]
  5. D((圆形节点))
  6. E{菱形节点}
  7. F>右向旗帜状节点]

Typora教程 - 图38

  1. graph TB
  2. begin(出门)--> buy[买炸鸡]
  3. buy --> IsRemaining{"还有没有炸鸡?"}
  4. IsRemaining -->|有|happy[买完炸鸡开心]--> goBack(回家)
  5. IsRemaining --没有--> sad["伤心"]--> goBack

Typora教程 - 图39

连线

  1. graph TB
  2. A1-->B1
  3. A2---B2
  4. A3--text---B3
  5. A4--text-->B4
  6. A5-.-B5
  7. A6-.->B6
  8. A7-.text.-B7
  9. A8-.text.->B8
  10. A9===B9
  11. A10==>B10
  12. A11==text===B11
  13. A12==text==>B12

Typora教程 - 图40 Typora教程 - 图41

子图表

使用以下语法添加子图表

  1. subgraph 子图表名称
  2. 子图表中的描述语句...
  3. end
  1. graph TB
  2. subgraph 买炸鸡前
  3. begin(出门)--> buy[出门买炸鸡]
  4. end
  5. buy --> IsRemaining{"还有没有炸鸡?"}
  6. IsRemaining --没有--> sad["伤心"]--> goBack(回家)
  7. IsRemaining -->|有|happy[买完炸鸡开心]--> goBack

Typora教程 - 图42

序列图(sequence diagram)

概述

  1. sequenceDiagram
  2. [参与者1][消息线][参与者2]:消息体
  3. ...

sequenceDiagram 为每幅时序图的固定开头

  1. sequenceDiagram
  2. Title: 买炸鸡
  3. 救救->>炸鸡店小哥: 还有炸鸡吗?
  4. 炸鸡店小哥-->>救救: 没有,要现炸

Typora教程 - 图43

参与者(participant)

传统时序图概念中参与者有角色和类对象之分,但这里我们不做此区分,用参与者表示一切参与交互的事物,可以是人、类对象、系统等形式。中间竖直的线段从上至下表示时间的流逝。

  1. sequenceDiagram
  2. participant 参与者 1
  3. participant 参与者 2
  4. ...
  5. participant 简称 as 参与者 3 #该语法可以在接下来的描述中使用简称来代替参与者 3

participant <参与者名称> 声明参与者,语句次序即为参与者横向排列次序。

消息线

类型 描述
-> 无箭头的实线
—> 无箭头的虚线
->> 有箭头的实线(主动发出消息)
–->> 有箭头的虚线(响应)
-x 末端为叉的实线(表示异步)
—x 末端为叉的虚线(表示异步)

处理中-激活框

从消息接收方的时间线上标记一小段时间,表示对消息进行处理的时间间隔。

在消息线末尾增加 + ,则消息接收者进入当前消息的“处理中”状态;
在消息线末尾增加 - ,则消息接收者离开当前消息的“处理中”状态。

  1. sequenceDiagram
  2. participant 99 as 救救
  3. participant seller as 炸鸡店小哥
  4. 99 ->> seller: 还有炸鸡吗?
  5. seller -->> 99: 没有,要现炸。
  6. 99 -x +seller:给我炸!
  7. seller -->> -99: 您的炸鸡好了!

Typora教程 - 图44

注解(note)

语法如下

  1. Note 位置表述 参与者: 标注文字

其中位置表述可以为

表述 含义
right of 右侧
left of 左侧
over 在当中,可以横跨多个参与者
  1. sequenceDiagram
  2. participant 99 as 救救
  3. participant seller as 炸鸡店小哥
  4. Note over 99,seller : 热爱炸鸡
  5. Note left of 99 :
  6. Note right of seller :
  7. 99 ->> seller: 还有炸鸡吗?
  8. seller -->> 99: 没有,要现炸。
  9. 99 -x +seller : 给我炸!
  10. seller -->> -99: 您的炸鸡好了!

Typora教程 - 图45

循环(loop)

在条件满足时,重复发出消息序列。(相当于编程语言中的 while 语句。)

  1. sequenceDiagram
  2. participant 99 as 救救
  3. participant seller as 炸鸡店小哥
  4. 99 ->> seller: 还有炸鸡吗?
  5. seller -->> 99: 没有,要现炸。
  6. 99 ->> +seller:给我炸!
  7. loop 三分钟一次
  8. 99 ->> seller : 我的炸鸡好了吗?
  9. seller -->> 99 : 正在炸
  10. end
  11. seller -->> -99: 您的炸鸡好了!

Typora教程 - 图46

选择(alt)

在多个条件中作出判断,每个条件将对应不同的消息序列。(相当于 if 及 else if 语句。)

  1. sequenceDiagram
  2. participant 99 as 救救
  3. participant seller as 炸鸡店小哥
  4. 99 ->> seller : 现在就多少只炸好的炸鸡?
  5. seller -->> 99 : 可卖的炸鸡数
  6. alt 可卖的炸鸡数 > 3
  7. 99 ->> seller : 买三只!
  8. else 1 < 可卖的炸鸡数 < 3
  9. 99 ->> seller : 有多少买多少
  10. else 可卖的炸鸡数 < 1
  11. 99 ->> seller : 那我明天再来
  12. end
  13. seller -->> 99 : 欢迎下次光临

Typora教程 - 图47

可选(opt)

在某条件满足时执行消息序列,否则不执行。相当于单个分支的 if 语句。

  1. sequenceDiagram
  2. participant 99 as 救救
  3. participant seller as 炸鸡店小哥
  4. 99 ->> seller : 买炸鸡
  5. opt 全都卖完了
  6. seller -->> 99 : 下次再来
  7. end

Typora教程 - 图48

并行(Par)

将消息序列分成多个片段,这些片段并行执行。

  1. sequenceDiagram
  2. participant 99 as 救救
  3. participant seller as 炸鸡店小哥
  4. 99 ->> seller : 一个炸鸡,一杯可乐!
  5. par 并行执行
  6. seller ->> seller : 装可乐
  7. and
  8. seller ->> seller : 炸炸鸡
  9. end
  10. seller -->> 99 : 您的炸鸡好了!

Typora教程 - 图49

饼图(Pie)

  1. pie
  2. title Pie Chart
  3. "Dogs" : 386
  4. "Cats" : 85
  5. "Rats" : 150

Typora教程 - 图50

Typora支持mermaid的官方链接

甘特图(gantt)

  1. title 标题
  2. dateFormat 日期格式
  3. section 部分名
  4. 任务名:参数一, 参数二, 参数三, 参数四,参数五
  5. //参数一:crit(是否重要,红框框) 或者 不填
  6. //参数二:done(已完成)、active(正在进行) 或者 不填(表示为待完成状态)
  7. //参数三:取小名 或者 不填
  8. //参数四:任务开始时间
  9. //参数五:任务结束时间

官方教程

  1. gantt
  2. dateFormat YYYY-MM-DD
  3. title Adding GANTT diagram functionality to mermaid
  4. section A section
  5. Completed task :done, des1, 2014-01-06,2014-01-08
  6. Active task :active, des2, 2014-01-09, 3d
  7. Future task : des3, after des2, 5d
  8. Future task2 : des4, after des3, 5d
  9. section Critical tasks
  10. Completed task in the critical line :crit, done, 2014-01-06,24h
  11. Implement parser and jison :crit, done, after des1, 2d
  12. Create tests for parser :crit, active, 3d
  13. Future task in critical line :crit, 5d
  14. Create tests for renderer :2d
  15. Add to mermaid :1d
  16. section Documentation
  17. Describe gantt syntax :active, a1, after des1, 3d
  18. Add gantt diagram to demo page :after a1 , 20h
  19. Add another diagram to demo page :doc1, after a1 , 48h
  20. section Last section
  21. Describe gantt syntax :after doc1, 3d
  22. Add gantt diagram to demo page :20h
  23. Add another diagram to demo page :48h

Typora教程 - 图51

html风格

可以使用 HTML 样式来写 Markdown,比如

  1. <span style="color:red">this text is red</span>

this text is red

主题

官方主题链接

汉字排版主题

自动编号

标题自动编号

Typora教程 - 图52标题自动编号参考链接

将下面代码复制到:偏好设置-主题文件夹-创建新文件base.user.css

  1. /** initialize css counter */
  2. #write {
  3. counter-reset: h1
  4. }
  5. h1 {
  6. counter-reset: h2
  7. }
  8. h2 {
  9. counter-reset: h3
  10. }
  11. h3 {
  12. counter-reset: h4
  13. }
  14. h4 {
  15. counter-reset: h5
  16. }
  17. h5 {
  18. counter-reset: h6
  19. }
  20. /** put counter result into headings */
  21. #write h1:before {
  22. counter-increment: h1;
  23. content: counter(h1) ". "
  24. }
  25. #write h2:before {
  26. counter-increment: h2;
  27. content: counter(h1) "." counter(h2) ". "
  28. }
  29. #write h3:before,
  30. h3.md-focus.md-heading:before /** override the default style for focused headings */ {
  31. counter-increment: h3;
  32. content: counter(h1) "." counter(h2) "." counter(h3) ". "
  33. }
  34. #write h4:before,
  35. h4.md-focus.md-heading:before {
  36. counter-increment: h4;
  37. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "
  38. }
  39. #write h5:before,
  40. h5.md-focus.md-heading:before {
  41. counter-increment: h5;
  42. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "
  43. }
  44. #write h6:before,
  45. h6.md-focus.md-heading:before {
  46. counter-increment: h6;
  47. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "
  48. }
  49. /** override the default style for focused headings */
  50. #write>h3.md-focus:before,
  51. #write>h4.md-focus:before,
  52. #write>h5.md-focus:before,
  53. #write>h6.md-focus:before,
  54. h3.md-focus:before,
  55. h4.md-focus:before,
  56. h5.md-focus:before,
  57. h6.md-focus:before {
  58. color: inherit;
  59. border: inherit;
  60. border-radius: inherit;
  61. position: inherit;
  62. left:initial;
  63. float: none;
  64. top:initial;
  65. font-size: inherit;
  66. padding-left: inherit;
  67. padding-right: inherit;
  68. vertical-align: inherit;
  69. font-weight: inherit;
  70. line-height: inherit;
  71. }

大纲自动编号

Typora教程 - 图53大纲自动编号参考链接

将下面代码复制到:偏好设置-主题文件夹-创建新文件base.user.css

  1. .sidebar-content {
  2. counter-reset: h1
  3. }
  4. .outline-h1 {
  5. counter-reset: h2
  6. }
  7. .outline-h2 {
  8. counter-reset: h3
  9. }
  10. .outline-h3 {
  11. counter-reset: h4
  12. }
  13. .outline-h4 {
  14. counter-reset: h5
  15. }
  16. .outline-h5 {
  17. counter-reset: h6
  18. }
  19. .outline-h1>.outline-item>.outline-label:before {
  20. counter-increment: h1;
  21. content: counter(h1) ". "
  22. }
  23. .outline-h2>.outline-item>.outline-label:before {
  24. counter-increment: h2;
  25. content: counter(h1) "." counter(h2) ". "
  26. }
  27. .outline-h3>.outline-item>.outline-label:before {
  28. counter-increment: h3;
  29. content: counter(h1) "." counter(h2) "." counter(h3) ". "
  30. }
  31. .outline-h4>.outline-item>.outline-label:before {
  32. counter-increment: h4;
  33. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "
  34. }
  35. .outline-h5>.outline-item>.outline-label:before {
  36. counter-increment: h5;
  37. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "
  38. }
  39. .outline-h6>.outline-item>.outline-label:before {
  40. counter-increment: h6;
  41. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "
  42. }

TOC目录自动编号

Typora教程 - 图54目录自动编号参考链接

将下面代码复制到:偏好设置-主题文件夹-创建新文件base.user.css

  1. /**************************************
  2. * Header Counters in TOC
  3. **************************************/
  4. /* No link underlines in TOC */
  5. .md-toc-inner {
  6. text-decoration: none;
  7. }
  8. .md-toc-content {
  9. counter-reset: h1toc
  10. }
  11. .md-toc-h1 {
  12. margin-left: 0;
  13. font-size: 1.5rem;
  14. counter-reset: h2toc
  15. }
  16. .md-toc-h2 {
  17. font-size: 1.1rem;
  18. margin-left: 2rem;
  19. counter-reset: h3toc
  20. }
  21. .md-toc-h3 {
  22. margin-left: 3rem;
  23. font-size: .9rem;
  24. counter-reset: h4toc
  25. }
  26. .md-toc-h4 {
  27. margin-left: 4rem;
  28. font-size: .85rem;
  29. counter-reset: h5toc
  30. }
  31. .md-toc-h5 {
  32. margin-left: 5rem;
  33. font-size: .8rem;
  34. counter-reset: h6toc
  35. }
  36. .md-toc-h6 {
  37. margin-left: 6rem;
  38. font-size: .75rem;
  39. }
  40. .md-toc-h1:before {
  41. color: black;
  42. counter-increment: h1toc;
  43. content: counter(h1toc) ". "
  44. }
  45. .md-toc-h1 .md-toc-inner {
  46. margin-left: 0;
  47. }
  48. .md-toc-h2:before {
  49. color: black;
  50. counter-increment: h2toc;
  51. content: counter(h1toc) ". " counter(h2toc) ". "
  52. }
  53. .md-toc-h2 .md-toc-inner {
  54. margin-left: 0;
  55. }
  56. .md-toc-h3:before {
  57. color: black;
  58. counter-increment: h3toc;
  59. content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". "
  60. }
  61. .md-toc-h3 .md-toc-inner {
  62. margin-left: 0;
  63. }
  64. .md-toc-h4:before {
  65. color: black;
  66. counter-increment: h4toc;
  67. content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". "
  68. }
  69. .md-toc-h4 .md-toc-inner {
  70. margin-left: 0;
  71. }
  72. .md-toc-h5:before {
  73. color: black;
  74. counter-increment: h5toc;
  75. content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". " counter(h5toc) ". "
  76. }
  77. .md-toc-h5 .md-toc-inner {
  78. margin-left: 0;
  79. }
  80. .md-toc-h6:before {
  81. color: black;
  82. counter-increment: h6toc;
  83. content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". " counter(h5toc) ". " counter(h6toc) ". "
  84. }
  85. .md-toc-h6 .md-toc-inner {
  86. margin-left: 0;
  87. }
  88. /**************************************
  89. * Header Counters in Content
  90. **************************************/
  91. /** initialize css counter */
  92. #write {
  93. counter-reset: h1
  94. }
  95. h1 {
  96. counter-reset: h2
  97. }
  98. h2 {
  99. counter-reset: h3
  100. }
  101. h3 {
  102. counter-reset: h4
  103. }
  104. h4 {
  105. counter-reset: h5
  106. }
  107. h5 {
  108. counter-reset: h6
  109. }
  110. /** put counter result into headings */
  111. #write h1:before {
  112. counter-increment: h1;
  113. content: counter(h1) ". "
  114. }
  115. #write h2:before {
  116. counter-increment: h2;
  117. content: counter(h1) "." counter(h2) ". "
  118. }
  119. #write h3:before, h3.md-focus.md-heading:before { /*override the default style for focused headings */
  120. counter-increment: h3;
  121. content: counter(h1) "." counter(h2) "." counter(h3) ". "
  122. }
  123. #write h4:before, h4.md-focus.md-heading:before {
  124. counter-increment: h4;
  125. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "
  126. }
  127. #write h5:before, h5.md-focus.md-heading:before {
  128. counter-increment: h5;
  129. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "
  130. }
  131. #write h6:before, h6.md-focus.md-heading:before {
  132. counter-increment: h6;
  133. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "
  134. }
  135. /** override the default style for focused headings */
  136. #write>h3.md-focus:before, #write>h4.md-focus:before, #write>h5.md-focus:before, #write>h6.md-focus:before, h3.md-focus:before, h4.md-focus:before, h5.md-focus:before, h6.md-focus:before {
  137. color: inherit;
  138. border: inherit;
  139. border-radius: inherit;
  140. position: inherit;
  141. left: initial;
  142. float: none;
  143. top: initial;
  144. font-size: inherit;
  145. padding-left: inherit;
  146. padding-right: inherit;
  147. vertical-align: inherit;
  148. font-weight: inherit;
  149. line-height: inherit;
  150. }

参考文档

文章参考官网文档Typora教程 - 图55网址 文章参考引用bilibili UP主 Typora教程 - 图56救救-99


  1. 这是脚注解释。 ↩︎