snippets

快捷输入汇总

  • >hint
  • >ques
  • >def
  • >thm
  • >lem
  • >example
  • >label
  • >ref
  • >cite
  • >bubble
  • >otherproof

例如, 当在 VSCode 编辑器中输入 >hint 时, 会直接展开为如下的代码环境:

1
2
3
{% hideToggle 提示,purple,white %}
这里编辑需要"提示"的内容.
{% endhideToggle %}

直接编辑环境内的内容即可, 方便又快捷, 用于提高编辑 blog 内容的代码片段. 这个代码片段在网页中的展示效果如下:

提示

这里编辑需要”提示”的内容.

Markdown 源代码

以下是上述快捷输入的全部代码, 将其放在 VSCode 项目根目录 .vscode/snippets.code-snippets 文件中即可.

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
// Place your blog 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
"Hint": {
"scope": "markdown",
"prefix": ">hint",
"body": [
"{% hideToggle 提示,purple,white %}",
"$1",
"{% endhideToggle %}"
],
"description": "提示"
},
"Question": {
"scope": "markdown",
"prefix": ">ques",
"body": [
"{% note primary no-icon %}",
"**问题:** $1",
"{% endnote %}"
],
"description": "问题"
},
"Definition": {
"scope": "markdown",
"prefix": ">def",
"body": [
"{% note primary no-icon modern %}",
"**定义**: $1",
"{% endnote %}"
],
"description": "定义"
},
"Theorem": {
"scope": "markdown",
"prefix": ">thm",
"body": [
"{% note primary no-icon modern %}",
"**定理**: $1",
"{% endnote %}"
],
"description": "定理"
},
"Lemma": {
"scope": "markdown",
"prefix": ">lem",
"body": [
"{% note primary no-icon modern %}",
"**引理**: $1",
"{% endnote %}"
],
"description": "引理"
},
"Example": {
"scope": "markdown",
"prefix": ">example",
"body": [
"{% note primary no-icon modern %}",
"**例**: $1",
"{% endnote %}"
],
"description": "例子"
},
"Label": {
"scope": "markdown",
"prefix": ">label",
"body": [
"<span id = \"$1\"></span>"
],
"description": "标签"
},
"Reference": {
"scope": "markdown",
"prefix": ">ref",
"body": [
"[这里](#$1)"
],
"description": "引用"
},
"Cite": {
"scope": "markdown",
"prefix": ">cite",
"body": [
"{% post_link 文件名$1 %}"
],
"description": "引用"
},
"Bubble": {
"scope": "markdown",
"prefix": ">bubble",
"body": [
"{% bubble 内容$1,淡出信息 %}"
],
"description": "气泡信息"
},
"OtherProof": {
"scope": "markdown",
"prefix": ">otherproof",
"body": [
"{% tabs test2, 3 %}",
"<!-- tab -->",
"**This is Tab 1.**",
"<!-- endtab -->",
"",
"<!-- tab -->",
"**This is Tab 2.**",
"<!-- endtab -->",
"",
"<!-- tab -->",
"**This is Tab 3.**",
"<!-- endtab -->",
"{% endtabs %}"
],
"description": "其他证明以 tab 页展示"
}
}