🚀快速开始 -> 💌依赖插件 -> 📌基本配置 -> 🌈界面显示 -> 🦄特殊功能

# Welcome to Arachnid‘s blog!

本篇章用于测试 multi-markdown-it 渲染器语法。

关于本站的搭建记录可访问以下文章分类:

# 基础语法

以下语法为通用 Markdown 语法,适用于各大 Markdown 编辑器。


# 标题

以下是各级标题,最多支持 6 级标题:

# h1
## h2
### h3
#### h4
##### h5
###### h6

呈现效果:

一级标题
二级标题
三级标题
四级标题
五级标题
六级标题


# 字体

*斜体*
**粗体**
***斜体加粗***

呈现效果:

斜体

粗体

斜体加粗


# 引用

<!-- 单段落引用:在段落前添加一个 > 符号 -->
> 引用:我以为 “别人尊重我,是因为我很优秀”,后来才明白,“别人尊重我,是因为别人很优秀。
<!-- 多段落引用:段落之间的空白行添加一个 > 符号 -->
> 虽然心中、口头从未承认过,但是不知不觉中,我在小看自己的对手。
>
> 傲慢而不自知是自满的开始,不自知的同时又故作谦逊,这是自满的过程表现,继而更进一步错将故作谦逊当作十分谦虚,一步一步,如同围棋的序盘布局、中盘攻防,最终走向失败。
<!-- 嵌套引用:在要嵌套的段落前添加一个 >> 符号 -->
> "If today were the last day of my life, would I want to do what I am about to do today?"
>
>> And whenever the answer has been "No" for too many days in a row, I know I need to change something.

呈现效果:

引用:我以为 “别人尊重我,是因为我很优秀”,后来才明白,“别人尊重我,是因为别人很优秀。

虽然心中、口头从未承认过,但是不知不觉中,我在小看自己的对手。

傲慢而不自知是自满的开始,不自知的同时又故作谦逊,这是自满的过程表现,继而更进一步错将故作谦逊当作十分谦虚,一步一步,如同围棋的序盘布局、中盘攻防,最终走向失败。

"If today were the last day of my life, would I want to do what I am about to do today?"

And whenever the answer has been "No" for too many days in a row, I know I need to change something.


# 列表

# 有序列表

1. first
2. second
    1. indented
3. third

呈现效果:

  1. first
  2. second
    1. indented
  3. third

# 无序列表

- first
- second
    - indented
- third

呈现效果:

  • first
  • second
    • indented
  • third

# 排版

# 段落

使用空白行将一行或多行文本进行分隔:

I really like using Markdown.
I think I'll use it to format all of my documents from now on.

呈现效果:

I really like using Markdown.

I think I'll use it to format all of my documents from now on.

# 换行

在一行的末尾添加两个或多个空格,然后按回车键,即可创建一个换行 <br>

This is the first line.<br>And this is the second line.

呈现效果:

This is the first line.
And this is the second line.

# 分割

在单独一行上使用三个或多个破折号 --- (为了兼容性,请在分隔线的前后均添加空白行):

Try to put a blank line before...
---
...and after a horizontal rule.

呈现效果:

Try to put a blank line before...


...and after a horizontal rule.


# 图片

插入图片的方式的格式为:

![alt_name](path/to/img img_name)

其中的 alt_name 是图片无法显示的时候展示的文字内容, path/to/img 是图片资源的路径,可以是本地也可以是网络地址, img_name 则是显示在图片下方的图片名称。

# 本地

本地路径插入,跟正规的 Markdown 语法有点不一样,需要在路径前面加上 / ,即:

![alt_name](/images/xxx.jpg "img_name")
<!-- eg: ![本地插入](/images/avatar.webp "本地头像") -->

呈现效果:

本地插入

# 网络

网络图片插入,跟正规的 Markdown 语法一样:

![alt_name](https://xxx.jpg "img_name")
<!-- eg: ![网络插入](https://avatars.githubusercontent.com/u/48347583?v=4 "网络头像") -->

呈现效果:

网络插入

# 大小

设置图片的大小:

![](/images/avatar.webp "定义图片大小 - 固定宽度和高度"){height="300px" width="500px"}
![](/images/avatar.webp "定义图片大小 - 固定宽度"){width="400px"}
![](/images/avatar.webp "定义图片大小 - 固定高度"){height="100px"}

呈现效果:


# 高级语法

以下语法功能大部分基于 hexo-renderer-multi-markdown-it 渲染器,尤其是代码块的显示,与默认渲染器不兼容。

在应用主题之前,必须至少安装 hexo-renderer-multi-markdown-it 渲染插件 和 hexo-autoprefixer

插件名称npm 地址功能依赖程度
hexo-renderer-multi-markdown-it链接md 文件渲染器,压缩 css/js/html必需
hexo-autoprefixer链接给生成的 css 文件们添加浏览器前缀必需

# 原始

在本主题中,如果需要按照原始方式显示内容,可以使用:

content

像一些 html 格式的无法解析的,可以尝试该语法包裹。


# 表格

本主题使用了表格插件 markdown-it-multimd-table ,在原来表格的基础上,扩展了表格的展示形式。详细内容可以点击插件名称查看。

# 基本格式

也可适用于通用 Markdown 语法。

| First Header         | Second Header |  Third Header |
| :------------------- | :-----------: | ------------: |
| Left-aligned         |    *Lean*     | Right-aligned |
| Cell                 |   **Bold**    |          Cell |
| With an escaped '\|' |   Centered    |               |

呈现效果:

First HeaderSecond HeaderThird Header
Left-alignedLeanRight-aligned
CellBoldCell
With an escaped '|'Centered

# 多行内容

多行内容可以在表格中的同个 cell 中显示,对于同一个 cell 中的多行内容,除最后一行外,通过结尾添加 \ 反斜杠,使得多行的内容能够合并到一个 cell 中。

|   Markdown   | Rendered HTML |
| ------------ | ------------- |
|    *Italic*  | *Italic*      | \
|              |               |
|    - Item 1  | - Item 1      | \
|    - Item 2  | - Item 2      |
|    ```python | ```python     | \
|    .1 + .2   | .1 + .2       | \
|    ```       | ```           |

呈现效果:

MarkdownRendered HTML
*Italic*

Italic

- Item 1
- Item 2
  • Item 1
  • Item 2
```python
.1 + .2
```
.1 + .2

# 单元合并

可以使得一个 cell 占据多行;使用 ^^ 表示当前行 cell 和上一行的 cell 合并,在管道 | 分隔之间不填充元素将把当前列 cell 合并右方列直至结束或带元素的列。

Feature contributed by pmccloghrylaing .

| Net ATP yields per hexose |||
| Stage | Direct Products | ATP Yields |
| ----: | --------------: | ---------: |
| Glycolysis | 2 ATP ||
| ^^ | 2 NADH | 3--5 ATP |
| Pyruvaye oxidation | 2 NADH | 5 ATP |
| Citric acid cycle | 2 ATP ||
| ^^ | 6 NADH | 15 ATP |
| ^^ | 2 FADH2 | 3 ATP |
|   |||
|   || **30--32** ATP |

呈现效果:

Net ATP yields per hexose
StageDirect ProductsATP Yields
Glycolysis2 ATP
2 NADH3--5 ATP
Pyruvaye oxidation2 NADH5 ATP
Citric acid cycle2 ATP
6 NADH15 ATP
2 FADH23 ATP
30--32 ATP

# 省略表头

|--|--|--|--|--|--|--|--|
||  |||||||
|  ||||  ||||
||  ||  |  |  |  |  |
|  ||  |  ||  |  |  |
|  |  |  |  ||  |  |  |
|  |  |  |  |  ||  |  |
|||||  ||||
||||||  |  ||

呈现效果:


# 代码

本主题使用了代码插件 markdown-it-prism 进行代码高亮,支持显示行号、行高亮 (mark) 、命令行提示符 (command) 、代码块标题;该插件放在了 themes/shoka/scripts/renderer/ 下。

需要注意的是,需要把 _config.yml 中的 highlightprismjsenable 选项都设置为 false ,以使其停用默认代码高亮功能,否则代码块的 mac 样式将不能正常显示,这是因为 Hexo 会进行预处理,导致后续 markdown-it 渲染时,代码块的内容会乱码,使得插件无法正常识别代码块,渲染失败。

基本格式: [language] [title] [url] [link text] [mark] [command]

选项描述默认值
language支持的语言戳此如果不需要代码高亮,但希望显示代码块样式,则设为 raw 留空或设为 info ,将不显示代码高亮和代码块样式null
title代码块的标题文字null
url代码块标题右侧显示的链接null
link text上述链接显示的标题link
mark行高亮显示,格式为 mark:行号,行号开始-行号结束,其他行号 。 例如 mark:1,4-7,10 ,将高亮显示第 1、4、5、6、7、10 行null
command命令行提示符,格式为 command:("提示内容":行号,行号||"提示内容":行号开始-行号结束) 例如 command:("[root@localhost] $":1,9-10||"[admin@remotehost] #":4-6)null

eg:

```java 行高亮 https://shoka.lostyu.me 参考链接 mark:1,5-6
import java.util.Scanner;
...
Scanner in = new Scanner (System.in);
// 输入 Scan 之后,按下键盘 Alt + “/” 键,Eclipse 下自动补全。
System.out.println (in.nextLine ());
System.out.println ("Hello" + "world.");
```
```bash 命令行提示符 command:("[root@localhost] $":1,9-10||"[admin@remotehost] #":4-6)
pwd
/usr/home/chris/bin
ls -la
total 2
drwxr-xr-x   2 chris  chris     11 Jan 10 16:48 .
drwxr--r-x  45 chris  chris     92 Feb 14 11:10 ..
-rwxr-xr-x   1 chris  chris    444 Aug 25  2013 backup
-rwxr-xr-x   1 chris  chris    642 Jan 17 14:42 deploy
git add -A
git commit -m "update"
git push
```

呈现效果:

行高亮参考链接
import java.util.Scanner;
...
Scanner in = new Scanner (System.in);
// 输入 Scan 之后,按下键盘 Alt + “/” 键,Eclipse 下自动补全。
System.out.println (in.nextLine ());
System.out.println ("Hello" + "world.");
命令行提示符
pwd
/usr/home/chris/bin
ls -la
total 2
drwxr-xr-x   2 chris  chris     11 Jan 10 16:48 .
drwxr--r-x  45 chris  chris     92 Feb 14 11:10 ..
-rwxr-xr-x   1 chris  chris    444 Aug 25  2013 backup
-rwxr-xr-x   1 chris  chris    642 Jan 17 14:42 deploy
git add -A
git commit -m "update"
git push

# 链接

链接块功能参考 NexT,基于 Hexo Tag 功能,以 {% links %}` 开头,以 `{% endlinks %} 结尾,使用格式为:

  1. 使用 links 标签块,包围 yml 语法书写的内容,字段包括:

    site站点名称必填
    owner管理员名字可选,默认为 site 的值
    url站点链接必填
    desc站点描述可选,默认为 url 的值
    image站点图片可选,默认为 images/404.png
    color方块颜色可选,默认为 #666

    具体格式如下:

    {% links %}
    - site: # 站点名称
      owner: # 管理员名字
      url: # 站点网址
      desc: # 简短描述
      image: # 一张图片
      color: # 颜色代码
    {% endlinks %}

    举个栗子:

    {% links %}
    - site: 優萌初華
      owner: 霜月琉璃
      url: https://shoka.lostyu.me
      desc: 琉璃的医学 & 编程笔记
      image: https://cdn.jsdelivr.net/gh/amehime/shoka@latest/images/avatar.jpg
      color: "#e9546b"
    - site: 優萌初華
      owner: 霜月琉璃
      url: https://shoka.lostyu.me
      image: images/avatar.jpg
    - site: 優萌初華
      url: https://shoka.lostyu.me
      desc: 琉璃的医学 & 编程笔记
      color: "#9d5b8b"
    {% endlinks %}

    呈现格式:

  2. 以上标签块里的内容,还可以保存到一个 yml 文件中,然后使用 linksfile 标签。
    其中, path 位于 <root>/source 目录下;格式如下:

    {% linksfile [path] %}

    举个栗子:

    {% linksfile friends/_data.yml %}

# 文字

# 特效

本功能基于 markdown-it-insmarkdown-it-bracketed-spansmarkdown-it-attrs

本主题风格颜色通用样式:default、primary、success、info、warning、danger

++下划线++
++波浪线++{.wavy}
++着重点++{.dot}
++紫色下划线++{.primary}
++绿色波浪线++{.wavy .success}
++黄色着重点++{.dot .warning}
~~删除线~~
~~红色删除线~~{.danger}
==荧光高亮==
[赤橙黄绿青蓝紫]{.rainbow}
[红色]{.red}
[粉色]{.pink}
[橙色]{.orange}
[红色]{.yellow}
[绿色]{.green}
[靛青]{.aqua}
[蓝色]{.blue}
[紫色]{.purple}
[灰色]{.grey}
快捷键 [Ctrl]{.kbd} + [C]{.kbd .red}
H~2~0
29^th^

因为 markdown-it-pangu 插件的缘故,会自动被 pangu.js 处理了一下,加入几个空格,所以某些代码中可能会被加入空格,这有可能导致一些解析错误,使用时需要注意。由于本在打字中基本上会手动添加空格,因此我把该插件的功能关闭了。如果要使用该插件的话,记得查看 ++下划线++ ~~删除线~~ ==荧光高亮== 这些代码中间是否有空格。

呈现效果:

下划线
波浪线
着重点
紫色下划线
绿色波浪线
黄色着重点
删除线
红色删除线
荧光高亮
赤橙黄绿青蓝紫
红色
粉色
橙色
红色
绿色
靛青
蓝色
紫色
灰色
快捷键 Ctrl + C
H20
29th

# 隐藏

本功能基于 markdown-it-spoilermarkdown-it-attrs

!!被你发现啦!! 鼠标放置时显示内容。
!!模模糊糊的!!{.bulr} 鼠标选中时显示内容

注意这里的感叹号均为英文半角,左边的感叹号不要和前面的正文连接到一起。

呈现效果:

被你发现啦 鼠标放置时显示内容。
模模糊糊的 鼠标选中时显示内容

# 注音

原本用于日语汉字假名注音,或者标示振假名(振り仮名),也就是常说的写作 “xx”,读作 “YY”,比如说紳士(へんたい),但理论上别的注音也可以。

作者为了兼容性,采用 markdown-it-ruby 的基本格式: {文字^注音} 的格式进行注音,并且为了兼容表格,将分隔符由 | 换成了 ^

注音分隔基于 furigana-markdown-it 显示说明看这里

语法格式显示效果
{取り返す^とりかえす}()(かえ)
{可愛い犬^か+わい・い・いぬ}可愛(かわい)(いぬ)
{可愛い犬^か・わい・いいぬ}()(わい)(いぬ)
{アクセラレータ^accelerator}アクセラレータ(accelerator)
{accelerator^アクセラレータ}accelerator(アクセラレータ)
{食べる^たべる}() べる
{食べる^=たべる}食べる(たべる)
{あいうえお^*}
{あいうえお^*❤}
{常用账号^contact}常用账号(contact)

# emoji

本功能基于 markdown-it-emoji ,所有标签参考戳此

:sweat_smile:
:rofl:
:raising_hand: 
:clown_face:
:wave:

呈现效果:

😅 🤣 🙋 🤡 👋


# 标签

#

本功能基于 markdown-it-bracketed-spansmarkdown-it-attrs

语法格式如下:

[:icon:text]{.style}

:icon 表示添加某个 icon 图标, text 为该标签的文本, .style 为该标签的样式,有以下颜色可选:

[default]{.label}
[primary]{.label .primary}
[info]{.label .info}
[:heavy_check_mark:success]{.label .success}
[warning]{.label .warning}
[:broken_heart:danger]{.label .danger}

呈现效果:

default
primary
info
✔️success
warning
💔danger

#

本功能基于 markdown-it-container

语法格式:

;;;[id] [text]
content
;;;

;;;[id] [text] 作为开始行, ;;; 为结束行; id 用于识别各个标签所属的卡片,有相同 id 的标签会被放在一张卡片中,读者可以点击卡片上的 text 切换对应的标签。 content 中可以编写符合 markdown 语法的内容。示例如下:

;;;id1 卡片 1
这里是卡片 1 的内容
**加粗**
[success]{.label .success}
;;;
;;;id1 卡片 2
这里是卡片 2 的内容
:::danger
危险危险
:::
- 第一行
- 第二行
;;;
;;;id2 Cpp
​```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
    for (int i = 0; i < n-1; i++) {
        for (int j = 0; j < n-i-1; j++) {
            if (arr[j] > arr[j+1]) {
                swap(arr[j], arr[j+1]);
            }
        }
    }
}
int main() {
    int arr[] = {64, 34, 25, 12, 22, 11, 90};
    int n = sizeof(arr)/sizeof(arr[0]);
    bubbleSort(arr, n);
    for (int i = 0; i < n; i++)
        cout << arr[i] << " ";
    return 0;
}
​```
;;;
;;;id2 Java
​```java
public class BubbleSort {
    public static void bubbleSort(int[] arr) {
        int n = arr.length;
        for (int i = 0; i < n-1; i++) {
            for (int j = 0; j < n-i-1; j++) {
                if (arr[j] > arr[j+1]) {
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
    }
    public static void main(String[] args) {
        int[] arr = {64, 34, 25, 12, 22, 11, 90};
        bubbleSort(arr);
        for (int num : arr) {
            System.out.print(num + " ");
        }
    }
}
​```
;;;

呈现效果:

这里是卡片 1 的内容

加粗

success

这里是卡片 2 的内容

危险危险

  • 第一行
  • 第二行
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
    for (int i = 0; i < n-1; i++) {
        for (int j = 0; j < n-i-1; j++) {
            if (arr[j] > arr[j+1]) {
                swap(arr[j], arr[j+1]);
            }
        }
    }
}
int main() {
    int arr[] = {64, 34, 25, 12, 22, 11, 90};
    int n = sizeof(arr)/sizeof(arr[0]);
    bubbleSort(arr, n);
    for (int i = 0; i < n; i++)
        cout << arr[i] << " ";
    return 0;
}
public class BubbleSort {
    public static void bubbleSort(int[] arr) {
        int n = arr.length;
        for (int i = 0; i < n-1; i++) {
            for (int j = 0; j < n-i-1; j++) {
                if (arr[j] > arr[j+1]) {
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
    }
    public static void main(String[] args) {
        int[] arr = {64, 34, 25, 12, 22, 11, 90};
        bubbleSort(arr);
        for (int num : arr) {
            System.out.print(num + " ");
        }
    }
}

# 提醒

本功能基于 markdown-it-container

语法格式:

::: type [no-icon]
content
:::

::: type [no-icon] 作为开始行, ::: 为结束行; type 表示使用的提醒块样式, no-icon 表示不显示 icon 图标,为可选项,示例如下:

:::default
默认默认
:::
:::primary
基本基本
:::
:::info
提示提示
:::
:::success
成功成功
:::
:::warning
警告警告
:::
:::danger
危险危险
:::
:::danger no-icon
没有图标
:::

呈现效果:

默认默认

基本基本

提示提示

成功成功

警告警告

危险危险

没有图标


# 折叠

本功能基于 markdown-it-container

语法格式:

+++[style] [title]
content
+++

+++[风格颜色] [标题文字] 作为开始行, +++ 为结束行; style 表示折叠块的样式,为空则使用默认样式。 title 为折叠块上的文本内容。 content 中可以编写符合 markdown 语法的内容。示例如下:

+++ 默认默认 这里是一段文字
++下划线++
+++
+++primary 紫色
:::info
参考信息
:::
- 第一行
- 第二行
+++
+++info  蓝色
;;;id3 卡片 1
这里是卡片 1 的内容
;;;
;;;id3 卡片 2
这里是卡片 2 的内容
;;;
+++
+++success 绿色
+++
+++warning 黄色
!!警告警告警告警告警告!!{.bulr}
[label]{.label .success}
+++
+++danger 红色
[danger]{.label .danger}
+++

呈现效果:

默认默认 这里是一段文字

下划线

紫色

参考信息

  • 第一行
  • 第二行
蓝色

这里是卡片 1 的内容

这里是卡片 2 的内容

绿色

黄色

警告警告警告警告警告
label

红色

danger


# 待办

本功能基于 markdown-it-task-checkbox 。可以利用 markdown-it-attrs 添加风格颜色,只可以给 ul 标签添加,需要新建两行。

语法格式:

- [mark]  text
- [mark]  text 
{.style}

mark 为可选项,使用 x 填充,表示该项完成, style 表示显示的样式,为空则使用默认样式。注意 {.style} 和上一个选项之间需要插入一个空行。 示例如下:

- [ ] 这是一个小叉叉
- [x] 这是一个红色勾勾 
{.danger}
- [ ] 未完成
- [x] 完成 
{.primary}
- [ ] 未完成
- [x] 默认颜色

呈现效果:


# 选择

这个功能用于显示练习题。需要在 Front Matter 中添加 quiz: true ,以正确显示题型标签。

本功能基于 markdown-it-bracketed-spansmarkdown-it-attrs 插件,以下是一些标签及其对应含义:

标签含义
{.quiz}选择题
{.quiz .true}正确的判断题
{.quiz .false}错误的判断题
{.quiz .fill}填空题
[]{.gap}空白下划线
[答案内容]{.gap}答案内容带下划线
{.options}ABCDE 选项
{.correct}选择题的正确选项
>答案解析
[备注内容]{.mistake}错题备注

演示示例:

---
title: 练习题与答案
quiz: true
---
1. 编译时多态主要指运算符重载与函数重载,而运行时多态主要指虚函数。 {.quiz .true}
2. 有基类 `SHAPE`,派生类 `CIRCLE`,声明如下变量:  {.quiz .multi}
    ```cpp
    SHAPE shape1,*p1;
    CIRCLE circle1,*q1;
    ```
    下列哪些项是 “派生类对象替换基类对象”。
    - `p1=&circle1;` {.correct}
    - `q1=&shape1;`
    - `shape1=circle1;` {.correct}
    - `circle1=shape1;`
{.options}
    > - :heavy_check_mark: 令基类对象的指针指向派生类对象
    > - :x: 派生类指针指向基类的引用
    > - :heavy_check_mark: 派生类对象给基类对象赋值
    > - :x: 基类对象给派生类对象赋值
    > {.options}
3. 下列叙述正确的是 []{.gap}{.quiz}
    - 虚函数只能定义成无参函数
    - 虚函数不能有返回值
    - 能定义虚构造函数
    - A、B、C 都不对 {.correct}
{.options}
10. 如果定义 `int e=8; double f=6.4, g=8.9;`,则表达式 `f+int (e/3*int (f+g)/2)%4` 的值为 [9.4]{.gap}{.quiz .fill}
    > 注意运算顺序和数据类型
    > [8.4]{.mistake}

呈现效果:

点击选项可以显示答案,以及答案解析。

  1. 编译时多态主要指运算符重载与函数重载,而运行时多态主要指虚函数。

  2. 有基类 SHAPE ,派生类 CIRCLE ,声明如下变量:

    SHAPE shape1,*p1;
    CIRCLE circle1,*q1;

    下列哪些项是 “派生类对象替换基类对象”。

    • p1=&circle1;
    • q1=&shape1;
    • shape1=circle1;
    • circle1=shape1;
    • ✔️ 令基类对象的指针指向派生类对象
    • ❌ 派生类指针指向基类的引用
    • ✔️ 派生类对象给基类对象赋值
    • ❌ 基类对象给派生类对象赋值
  3. 下列叙述正确的是

    • 虚函数只能定义成无参函数
    • 虚函数不能有返回值
    • 能定义虚构造函数
    • A、B、C 都不对
  4. 如果定义 int e=8; double f=6.4, g=8.9; ,则表达式 f+int (e/3*int (f+g)/2)%4 的值为 9.4

    注意运算顺序和数据类型
    8.4


# 媒体

本功能基于 Hexo Tag 功能,使用 media 标签,目前可选择两种类型,即 audiovideo

格式如下:

{% media audio %}
... 音频列表
{% endmedia %}
{% media video %}
... 视频列表
{% endmedia %}

标签包绕一段 yml 格式的内容,格式与背景音乐的配置类似。

亦可以直接使用网易云、虾米、QQ 音乐的播放列表、单曲。

举个栗子
{% media audio %}
- title: 列表 1
  list:
    - https://music.163.com/#/playlist?id=2943811283
    - https://music.163.com/#/playlist?id=2297706586
- title: 列表 2
  list:
    - https://music.163.com/#/playlist?id=2031842656
{% endmedia %}
{% media audio %}
- name: "测试 1"
  url: https://cdn.kastatic.org/ka-youtube-converted/O_nY1TM2RZM.mp4/O_nY1TM2RZM.mp4#t=0
- name: "测试 2"
  url: https://cdn.kastatic.org/ka-youtube-converted/O_nY1TM2RZM.mp4/O_nY1TM2RZM.mp4#t=0
{% endmedia %}

呈现效果:

一般来说,对于视频链接引用本人喜欢直接使用视频的 url 来获取,因此常用 html 的嵌入代码来显示平台提供的视频播放,例如:

<iframe width="800" height="450" src="//player.bilibili.com/player.html?isOutside=true&aid=1250357&bvid=BV1Sx411T7QQ&cid=5337009&p=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>

呈现效果:

# 脚注

脚注功能基于 markdown-it-footnote 插件。使用格式为 [^note] ,然后在末尾添加对应的 [^note]: note content ,注意这里的冒号 : 不可省略,否则脚注不能正常解析。

Here is a footnote reference,[^1] and another.[^longnote]
[^1]: Here is the footnote.
[^longnote]: Here's one with multiple blocks.

呈现效果:

Here is a footnote reference,[1] and another.[2]


# Mermaid

本功能基于 markdown-it-mermaid ,在 Front Matter 中添加 mermaid: true 以支持 Mermaid

如果是基于 markdown-it-mermaid modules 处理,代码格式使用 mermaid 是无法正常呈现出来的,需要修改 node_modules\hexo-renderer-multi-markdown-it\lib\renderer\markdown-it-mermaid 文件的第 61 行附近的判断 if (token.info === 'Mermaid') { 这样在代码块格式编辑的时候也注意要第一个字母大写 Mermaid ,这样才勉强的解决方案。

# 时序

示例:

Mermaid
sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    Note right of Bob: Bob thinks
    Bob-->Alice: I am good thanks!

呈现效果:

AliceBobHello Bob, how are you?Bob thinksI am good thanks!AliceBob

# 流程

示例:

Mermaid
graph TB
    A[Hard] -->|Text| B(Round)
    B --> C{Decision}
    C -->|One| D[Result 1]
    C -->|Two| E[Result 2]

呈现效果:

TextOneTwoHardRoundDecisionResult 1Result 2

提示: 更多关于时序图与流程图的语法请参考:Mermaid

修复参考:

https://blog.liq2.com/article/ff29002e.html

https://medium.com/ 一個小小工程師的隨手筆記 /hex - 解決 - mermaid - 無法正確在 - shoka - 主題顯示的問題 - 989188950919


# KaTex

本功能基于 markdown-it-katex

Front Matter 中添加 math: true 以支持 KaTex

  1. $ 表示行内公式:

    质能守恒方程可以用一个很简洁的方程式 E=mc2E=mc^2 ( $E=mc^2$ ) 来表达。

  2. $$ 表示整行公式:

    格式公式
    $$\sum_{i=1}^n a_i=0$$i=1nai=0\sum_{i=1}^n a_i=0
    $$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2$$f(x1,xx,,xn)=x12+x22++xn2f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2
    $$\sum^{j-1}_{k=0}{\widehat{\gamma}_{kj}z_k}$$k=0j1γ^kjzk\sum^{j-1}_{k=0}{\widehat{\gamma}_{kj}z_k}

    更复杂的公式:

    $$\begin{eqnarray}\vec\nabla \times (\vec\nabla f) & = & 0  \cdots\cdots梯度场必是无旋场\\
    \vec\nabla \cdot(\vec\nabla \times \vec F) & = & 0\cdots\cdots旋度场必是无散场\\
    \vec\nabla \cdot (\vec\nabla f) & = & {\vec\nabla}^2f\\
    \vec\nabla \times(\vec\nabla \times \vec F) & = & \vec\nabla(\vec\nabla \cdot \vec F) - {\vec\nabla}^2 \vec F\\\end{eqnarray}$$

    显示效果:

    \begin{eqnarray}\vec\nabla \times (\vec\nabla f) & = & 0 \cdots\cdots梯度场必是无旋场\\ \vec\nabla \cdot(\vec\nabla \times \vec F) & = & 0\cdots\cdots旋度场必是无散场\\ \vec\nabla \cdot (\vec\nabla f) & = & {\vec\nabla}^2f\\ \vec\nabla \times(\vec\nabla \times \vec F) & = & \vec\nabla(\vec\nabla \cdot \vec F) - {\vec\nabla}^2 \vec F\\\end{eqnarray}

访问 KaTex 参考更多使用方法。


  1. Here is the footnote. ↩︎

  2. Here's one with multiple blocks. ↩︎

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

夏沫の浅雨 微信支付

微信支付

夏沫の浅雨 支付宝

支付宝