写博文使用的语法

这是我这个博客的第一篇文章

第一次写博客就简单点吧分享一些makedown和标签语法

常用的makedown语法

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
#引用文本:
>text

#引用代码
`text`

#链接:
[text](link)

#加粗:
**[text]**__[text]__

#斜体
*[text]*_[text]_

#删除线
~~[text]~~

#粗体和嵌入的斜体
**[text]␣_[text]_**

#有序列表:
1.␣text
2.␣text
3.␣text

#无序列表:
+␣text
-␣text
*␣text

#任务列表:
+␣[x]␣吃饭
-␣[ ]␣睡觉
*␣[ ]␣打豆豆

#代码块:
[```]name
int main(){
return 0;
}
[```]
参数 解释
text 文字内容
空格
name 代码语言
  • c
  • c#
  • shell
  • python
  • 等等
[```] 由于是在代码块中使用加上了[]正确的写法如下:
name<br>int main(){<br>return 0;<br>}<br>

引用文本

引用代码``#000000

链接

加粗加粗

斜体斜体

删除线

粗体和_嵌入的斜体_字

  1. 有序列表1
  2. 有序列表2
  3. 有序列表3
  • 哆啦A梦
  • 工藤新一
  • 蜡笔小新

任务列表

  • 吃饭
  • 睡觉
  • 打豆豆

代码块

1
2
3
int main(){
return 0;
}
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
>引用文本

`#000000引用代码#000000`

[链接](https://docs.github.com/zh/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code)

**加粗**__加粗__

*斜体*_斜体_

~~删除线~~

**粗体和 _嵌入的斜体_字**

有序列表
1. 有序列表1
2. 有序列表2
3. 有序列表3

无序列表
+ 哆啦A梦
- 工藤新一
* 蜡笔小新

任务列表
+ [x] 吃饭
- [ ] 睡觉
* [ ] 打豆豆

[```]name
int main(){
return 0;
}
[```]

分栏

1
2
3
4
5
6
7
8
9
{% tabs Unique name, [index] %}

<!-- tab [Tab caption] [@icon] -->

Any content (support inline tags too).

<!-- endtab -->

{% endtabs %}
参数 解释
Unique name
  • 选项卡块标签的唯一名称,不带逗号。
  • 将在#id 中用作每个标签及其索引号的前缀。
  • 如果名称中包含空格,则对于生成#id,所有空格将由破折号代替。
  • 仅当前帖子/页面的 URL 必须是唯一的!
[index]:
  • 活动选项卡的索引号。
  • 如果未指定,将选择第一个标签(1)。
  • 如果index为-1,则不会选择任何选项卡。
  • 可选参数。
[Tab caption]:
  • 当前选项卡的标题。
  • 如果未指定标题,则带有制表符索引后缀的唯一名称将用作制表符的标题。
  • 如果未指定标题,但指定了图标,则标题将为空。
  • 可选参数。
[@icon]
  • FontAwesome 图标名称(全名,看起来像“ fas fa-font”)
  • 可以指定带空格或不带空格;
  • 例如’Tab caption @icon’ 和 ‘Tab caption@icon’。
  • 可选参数。

This is Tab 1.

This is Tab 2.

This is Tab 3.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{% tabs test1 %}

<!-- tab -->

**This is Tab 1.**

<!-- endtab -->

<!-- tab -->

**This is Tab 2.**

<!-- endtab -->

<!-- tab -->

**This is Tab 3.**

<!-- endtab -->

{% endtabs %}

label 标签

1
{% label text color %}
参数 解释
text 文字内容
color 背景颜色,默认为 default,default/blue/pink/red/purple/orange/green

臣亮言:先帝 创业未半,而中道崩殂 。今天下三分,益州疲敝 ,此诚危急存亡之秋 也!然侍衞之臣,不懈于内;忠志之士 ,忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气;不宜妄自菲薄,引喻失义,以塞忠谏之路也。
宫中、府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科 ,及为忠善者,宜付有司,论其刑赏,以昭陛下平明之治;不宜偏私,使内外异法也。

1
2
臣亮言:{% label 先帝 %}创业未半,而{% label 中道崩殂 blue %}。今天下三分,{% label 益州疲敝 pink %},此诚{% label 危急存亡之秋 red %}也!然侍衞之臣,不懈于内;{% label 忠志之士 purple %},忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气;不宜妄自菲薄,引喻失义,以塞忠谏之路也。
宫中、府中,俱为一体;陟罚臧否,不宜异同。若有{% label 作奸 orange %}、{% label 犯科 green %},及为忠善者,宜付有司,论其刑赏,以昭陛下平明之治;不宜偏私,使内外异法也。
1
2
3
{% flink %}
xxxxxx
{% endflink %}
参数 解释
class_name h2标题
flink_style 【可选】友链样式,默认为 flexcard,flexcard/anzhiyu
link_list 【可选】友链样式,默认为 flexcard,flexcard/anzhiyu
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

{% flink %}
- class_name: 推荐博客
flink_style: flexcard
link_list:
- name: KID1412
link: https://lyh.97204462.xyz
avatar: https://img.97204462.xyz/kid_logo1.png
descr: 得失坦然,宠辱不惊
siteshot: https://npm.elemecdn.com/anzhiyu-theme-static@1.1.6/img/blog.anheyu.com.jpg

- class_name: 网站
class_desc: 值得推荐的网站
flink_style: anzhiyu
link_list:
- name: Youtube
link: https://www.youtube.com/
avatar: https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png
descr: 视频网站
- name: Weibo
link: https://www.weibo.com/
avatar: https://i.loli.net/2020/05/14/TLJBum386vcnI1P.png
descr: 中国最大社交分享平台
- name: Twitter
link: https://twitter.com/
avatar: https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png
descr: 社交分享平台
{% endflink %}

折叠框 folding

1
2
3
{% folding 颜色 状态, 标题 %}
![](https://bu.dusays.com/2023/06/01/64788d71c832d.webp)
{% endfolding %}
参数 解释
颜色 blue, cyan, green, yellow, red
状态 状态填写 open 代表默认打开。
标题 标题
查看图片测试

查看默认打开的折叠框

这是一个默认打开的折叠框。

查看代码测试

假装这里有代码块(代码块没法嵌套代码块)

查看列表测试
  • haha
  • hehe
查看嵌套测试
查看嵌套测试2
查看嵌套测试3

hahaha

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
{% folding 查看图片测试 %}

![](https://bu.dusays.com/2023/06/01/64788d71c832d.webp)

{% endfolding %}

{% folding cyan open, 查看默认打开的折叠框 %}

这是一个默认打开的折叠框。

{% endfolding %}

{% folding green, 查看代码测试 %}
假装这里有代码块(代码块没法嵌套代码块)
{% endfolding %}

{% folding yellow, 查看列表测试 %}

- haha
- hehe

{% endfolding %}

{% folding red, 查看嵌套测试 %}

{% folding, 查看嵌套测试2 %}

{% folding 查看嵌套测试3 %}

hahaha <span><img src='https://bu.dusays.com/2023/06/01/64788cd5a356b.png' style='height:24px'></span>

{% endfolding %}

{% endfolding %}

{% endfolding %}

mermaid图

1
2
3
{% mermaid %}
内容
{% endmermaid %}

使用之前要在主题配置中打开mermaid功能

1
2
3
4
5
6
7
8
# mermaid
# see https://github.com/mermaid-js/mermaid
mermaid:
enable: true
# built-in themes: default/forest/dark/neutral
theme:
light: default
dark: dark

更多内容参照[mermaid文档]{https://mermaid.js.org/intro/}

  1. 圆饼图

  2. 流程图

  3. 序列图

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
1. 圆饼图
{% mermaid %}
pie
title 圆饼图
"Calcium" : 42.96
"Potassium" : 50.05
"Magnesium" : 10.01
"Iron" : 5
{% endmermaid %}

2. 流程图
{% mermaid %}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
{% endmermaid %}

3. 序列图
{% mermaid %}
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop HealthCheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
{% endmermaid %}

上标标签 tip

1
{% tip [参数,可选] %}文本内容{% endtip %}
参数 解释
样式 success,error,warning,bolt,ban,home,sync,cogs,key,bell
自定义图标 支持 fontawesome

default

info

success

error

warning

bolt

ban

home

sync

cogs

key

bell

自定义 font awesome 图标

1
2
3
4
5
6
7
8
9
10
11
12
13
{% tip %}default{% endtip %}
{% tip info %}info{% endtip %}
{% tip success %}success{% endtip %}
{% tip error %}error{% endtip %}
{% tip warning %}warning{% endtip %}
{% tip bolt %}bolt{% endtip %}
{% tip ban %}ban{% endtip %}
{% tip home %}home{% endtip %}
{% tip sync %}sync{% endtip %}
{% tip cogs %}cogs{% endtip %}
{% tip key %}key{% endtip %}
{% tip bell %}bell{% endtip %}
{% tip fa-atom %}自定义 font awesome 图标{% endtip %}

视频嵌入:

1
2
3
4
5
6
7
8
{% video 视频链接 %}

{% videos, 对齐方向, 列数 %}
{% video 视频链接 %}
{% video 视频链接 %}
{% video 视频链接 %}
{% video 视频链接 %}
{% endvideos %}
参数 解释
视频链接 填入视频链接
列数
  • 嵌入多个视频使用
  • 支持1-4列
对齐方向 left, center, right
  1. 100%宽度
  1. 50%宽度
  1. 25%宽度
  1. 100%宽度
1
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
  1. 50%宽度
1
2
3
4
5
6
{% videos, 2 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% endvideos %}
  1. 25%宽度
1
2
3
4
5
6
7
8
9
10
{% videos, 4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% video https://wp.97204462.xyz/raw/%E8%A7%86%E9%A2%91/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E9%9B%B6%E6%88%90%E6%9C%AC%E7%9A%84%E8%AF%84%E8%AE%BA%E5%8C%BA%EF%BC%8C%E9%AB%98%E6%95%88%E7%AE%80%E6%B4%81%E8%BD%BB%E9%87%8F.mp4 %}
{% endvideos %}

章节链接

可以直接链接到具有标题的任何章节。 若要查看呈现文件中自动生成的定位点,请将鼠标悬停在章节标题上方以显示 图标,然后单击图标以在浏览器中显示定位点。

如果需要确定要编辑的文件中标题的定位点,可使用以下基本规则:

  • 字母转换成小写形式。
  • 空格由连字符 (-) 代替。 任何其他空格或标点符号都将被删除。
  • 前导和尾随空格被删除。
  • 标记格式被删除,只保留内容(例如,italics 变为 italics)。
  • 如果标题的自动生成的定位点与同一文档中的早期定位点相同,那么通过追加连字符和自动递增整数来生成唯一标识符。

下面的代码块演示了用于从呈现内容中的标题生成定位点的基本规则。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Example headings 

## Sample Section

## This'll be a _Helpful_ Section About the Greek Letter Θ!
A heading containing characters not allowed in fragments, UTF-8 characters, two consecutive spaces between the first and second words, and formatting.

## This heading is not unique in the file

TEXT 1

## This heading is not unique in the file

TEXT 2

# Links to the example headings above

Link to the sample section: [Link Text](#sample-section).

Link to the helpful section: [Link Text](#thisll--be-a-helpful-section-about-the-greek-letter-Θ).

Link to the first non-unique section: [Link Text](#this-heading-is-not-unique-in-the-file).

Link to the second non-unique section: [Link Text](#this-heading-is-not-unique-in-the-file-1).

使用表情符号

你可以通过键入:EMOJICODE:(冒号后跟表情符号的名称)将表情符号添加到写作中。
@octocat :+1: This PR looks great - it’s ready to merge! :shipit:😜

键入:将显示建议的表情符号列表。 列表将在你键入时进行筛选,因此一旦找到所需表情符号,请按 Tab 或 Enter 键以填写突出显示的结果 。

有关可用表情符号和代码的完整列表,请参阅Emoji-Cheat-Sheet


更多写法请参考:
Butterfly 文檔(四) 標簽外挂
安知鱼主题标签 Tag Plugins
github markdown语法
8分钟让你快速掌握Markdown-哔哩哔哩

[up主专用,视频内嵌代码贴在这]