Markdown使用
Markdown
正文内容
标题
语法: # (一级标题) ## (二级标题) ### (三级标题) ......
代码:
# (一级标题)
## (二级标题)
### (三级标题)
注意:#号键和文字之间有一个空格,否则无法生效。
快捷键:
Ctrl+数字1-6可以快速将选中的文本调整为对应级别的标题(数字为键盘上的横排数字)
Ctrl+0可以快速将选中的文本调整为普通文本
Ctrl+加号/减号可以对标题级别进行加减
段落
换行
语法:
大换行:使用回车键
小换行:使用Shift+回车键
区别:大换行实际上插入了两个换行符,其两行之间有一个空白行。小换行则表现为两行紧挨着,实际上只插入了一个换行符。
分割线
语法:三个减号或三个星号,然后按下回车键即可生成分割线
---
或者
***
效果:
文字
字体
语法:
粗体:用一对双星号包裹
删除线:用一对双波浪线包裹
下划线:用一对u标签包裹
斜体:用一对单星号包裹
高亮:用一对双等号包裹
代码
**这是粗体**
~~这是删除线~~
<u>这是下划线</u>
*这是斜体*
==这是高亮==
效果:
这是粗体
这是删除线
<u>这是下划线</u>
这是斜体
这是高亮
快捷键:
加粗:Ctrl+B
删除线:Shift+Alt+5
下划线:Ctrl+U
斜体:Ctrl+L
注意:这些符号可以随意组合形成多种样式。若需要输入这些符号则需要转义符:\,如*5*
上下标
语法:
x^2^
H~2~O
效果:
x2 H2O
注意:此上下标存在局限性,公式中的上下标有特定的写法
颜色
语法:
#字体显示为蓝色
<font color="blue">test</font>
#字体显示为蓝色
<font color="#0000FF">test</font>
#背景显示为红色
<font style="background:red">test</font>
#背景显示为红色
<font style="background:#FF0000">test</font>
#背景显示为红色
<span style="background:#FF0000">test</span>
#背景显示为红色
<span style="background:#FF0000">test</span>
如:
<font color="blue">test</font>
<font color="#0000FF">test</font>
<font style="background:red">test</font>
<font style="background:#FF0000">test</font>
<span style="background:#FF0000">test</span>
列表
无序列表
代码:
*或-或+ 加 空格
使用Tab键可以提升级数
使用Shift+Tab降低级数
连续降低级数可以使其变为普通文本
效果:
- 这是一级标题
- 这是二级标题
- 这是三级分类
- 这是二级标题
快捷键:Ctrl+Shift+]
有序列表
代码:
数字 加 . 加 空格
使用Tab键可以提升级数
使用Shift+Tab降低级数
连续降低级数可以使其变为普通文本
效果:
内容一
内容二
快捷键:Ctrl+Shift+[
任务列表
代码:
- [ ] 吃早餐
- [x] 背单词
Shift+Tab可以降低为普通文本
效果:
- 吃早餐
- 背单词
区块显示
代码:
>加 空格
Shift+Tab可以降低为普通文本
效果:
> 这是最外层区块
>> 这是第二层区块
>>> 这是最里层区块
代码显示
行内代码
代码:
`int a=0;`
`号键在数字1键的旁边,ESC键的下方(英文格式下)
效果:
int a=0;
快捷键:Ctrl+Shift+`
代码块
代码:
```js/java/C#/text 加 回车
其中js/java/C#/text这些可写可不写
当写了代码类型时,编辑器可为其语言使用特定的颜色
如果要跳出代码块另起一行需使用 Ctrl+回车键
如:
using test;
namespace testNamespace
{
class testClass
{
private static Test()
{
int i=10;
return;
}
}
}
快捷键:Ctrl+Shift+K
链接
代码:
www.baidu.com
显示为链接
[百度一下](https://www.baidu.com)
显示为文字链接
[百度一下](https://www.baidu.com "跳转https://www.baidu.com")
当鼠标置于文字上出现提示
[标题一](#一、标题)
注意:使用页内标题跳转时注意书写格式,#和文字之间不能有空格
使用Ctrl+鼠标左键点击链接可以直接跳转
效果:
www.baidu.com 百度一下 [百度一下](https://www.baidu.com "跳转https://www.baidu.com")
快捷键:Ctrl+K
脚注
作用:对文本进行解释说明。
代码:
文本[^1]
[^1]:解释说明
当鼠标置于标注上会显示解释说明文本
使用Ctrl+鼠标左键点击可以在标注和解释之间跳转
若要将脚注解释说明文本换行,可以在换行处插入<br>标签
是否显性的显示<br>标签可以在设置里面更改
效果:
> 文本[^1] > > [^1]: 解释说明
> 文本[^点击跳转] > > [^点击跳转]: 这是一行很长的说明<br> 这是第二行
#图片插入 代码:

效果:

插入视频
<--!我们只需要把src的值改成文件的位置即可-->
<video id="video" controls="" src="文件位置" preload="none">
这里要提醒一下mac用户,mac的根目录位置为/Users/用户名,并不是我们命令行中用的~
表格
使用快捷键:Ctrl+T(表格代码很复杂,很难直接输入(可以在源代码中查看表格语法))
输入行数和列数后会生成一个表格
此时可以在表格中填写内容。
在表格中换行可以使用 Shift+回车键 来进行换行
表情
代码:
:happy:、:cry:、:man:
效果:
:happy:、:cry:、:man:
#自动生成大纲序号以及标题序号
在文件夹中创建base.user.css文件,在文件中输入如下代码即可:
/*文章标题自动编号*/
/** initialize css counter */
#write {
counter-reset: h1
}
h1 {
counter-reset: h2
}
h2 {
counter-reset: h3
}
h3 {
counter-reset: h4
}
h4 {
counter-reset: h5
}
h5 {
counter-reset: h6
}
/** put counter result into headings */
#write h1:before {
counter-increment: h1;
content: counter(h1) ". "
}
#write h2:before {
counter-increment: h2;
content: counter(h1) "." counter(h2) " "
}
#write h3:before,
h3.md-focus.md-heading:before /** override the default style for focused headings */ {
counter-increment: h3;
content: counter(h1) "." counter(h2) "." counter(h3) " "
}
#write h4:before,
h4.md-focus.md-heading:before {
counter-increment: h4;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " "
}
#write h5:before,
h5.md-focus.md-heading:before {
counter-increment: h5;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "
}
#write h6:before,
h6.md-focus.md-heading:before {
counter-increment: h6;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " "
}
/** override the default style for focused headings */
#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 {
color: inherit;
border: inherit;
border-radius: inherit;
position: inherit;
left:initial;
float: none;
top:initial;
font-size: inherit;
padding-left: inherit;
padding-right: inherit;
vertical-align: inherit;
font-weight: inherit;
line-height: inherit;
}
/*文章大纲自动编号*/
.sidebar-content {
counter-reset: h1
}
.outline-h1 {
counter-reset: h2
}
.outline-h2 {
counter-reset: h3
}
.outline-h3 {
counter-reset: h4
}
.outline-h4 {
counter-reset: h5
}
.outline-h5 {
counter-reset: h6
}
.outline-h1>.outline-item>.outline-label:before {
counter-increment: h1;
content: counter(h1) " "
}
.outline-h2>.outline-item>.outline-label:before {
counter-increment: h2;
content: counter(h1) "." counter(h2) " "
}
.outline-h3>.outline-item>.outline-label:before {
counter-increment: h3;
content: counter(h1) "." counter(h2) "." counter(h3) " "
}
.outline-h4>.outline-item>.outline-label:before {
counter-increment: h4;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " "
}
.outline-h5>.outline-item>.outline-label:before {
counter-increment: h5;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "
}
.outline-h6>.outline-item>.outline-label:before {
counter-increment: h6;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " "
}
正文内容已启用复制保护,代码块仍支持复制。
评论区
0 条已展示评论发表评论
提交后将进入人工审核,审核通过后才会展示。
读者留言
以下仅展示已通过审核的评论内容。
请先修正以下问题后再提交: