用于测试关键的若干Markdown语法或Markdown标记是否被正确渲染为预期的html。

当前渲染工具:

  • Hexo 框架
    • 主题: Butterfly
    • Markdown渲染器: pandoc
      • 自定义pandoc过滤器,适用于markdown 到 markdown 的预处理
      • 自定义pandoc过滤器,适用于markdown 到 html 的最终生成
      • 未来减轻开发负担,不要求渲染器所有功能与本文的测试一一对应。
      • 行文时,若遇到一些拿不准的特性,始终只以本文被渲染前后的结果为依据。

引用链接

超链接

语法:[Link Text](link-address)

效果:Links - Typora Support (typoraio.cn)

参考链接

语法:

1
2
3
[Link Text][Ref2] 

[Ref2]: https://support.typoraio.cn/Links/ "typora links"

效果(自动转为普通超链接):

Link Text

自动链接和网址

语法:<http://typora.io>

效果:http://typora.io

语法:This is a link: http://typora.io

效果:This is a link: http://typora.io

本地资源链接

语法:参考Links - Typora Support (typoraio.cn)

  • 不确保非站内资源可行。

  • 不应该支持非站内资源,但是难以排除这些目的之外的资源。

1
2
[404_page](../404.html)
[this_page](../posts/d36d5fbd.html)

404_page

this_page

页内链接(链接到headings锚点和raw-HTML锚点)

数学公式的基本概念

  • 需要在pandoc生成命令中,添加 –mathjax 才能启用公式
  • 公式中 \label\tag区别
    • \label 用于打上内部标签,配合引用\ref{标签}
    • \tag 用于显式地对公式编号。是一种外部展示。文本课件公式的编号,和引用时对公式的指代。
    • \ref{标签}引用的公式最终没有tag,一般会出现???的显示

行内公式

需要严格按照$xxxx$的形式,$符号的的最近邻不能有空格,否则会存在部分或全部元素丢失。

  • 正常情况:

    • $e=mc^2 \rightarrow$: \(e=mc^2 \rightarrow\)
  • $符号的的最近邻有空格:

  • $ \rightarrow$: $ $

  • $\inf $: $$

公式块(行间公式)和自动编号

NOTICE: 统一采用 AMS规则

\[ \begin{equation}\label{lalla}\tag{abcd} e=mc^2 \end{equation} \]

Use AMS Numbering Rule (where only certain environments produce numbered equations, as they would be in LaTeX).

即只对:equation框定的模块且标注的公式自动编号

1
2
3
\begin{equation}
e=mc^2
\end{equation}

\[ \begin{equation}\tag{1} e=mc^2\\ \end{equation} \]

公式块(行间公式)标注和引用

\[ \begin{equation}\label{eq1}\tag{2} e=mc^2 \end{equation} \]

对公式2的定义语法为:

1
2
3
\begin{equation}\label{eq1}
e=mc^2
\end{equation}

此处使用语法$公式\label{eq1}$进行引用,效果为:引用 \(公式\ref{eq1}\) 此处使用语法$公式\label{eq1}$进行引用,效果为:引用 \(公式\ref{lalla}\)

公式块(行间公式)换行

使用\displaylines{x+y\\y+z}语法换行

\[ \displaylines{x+y\\y+z} \]

使用\\换行

\[ x+y\\y+z \]

使用\\\\换行

\[ x+y\\\\y+z \]

使用\newline换行

\[ x+y\newline y+z \]

使用split 块换行

\[ \begin{split} &x+y \\ &y+z \\ \end{split} \]

公式块(行间公式)中遇到中文

\[ x+y\\y+z \\ 这是中文\\ \]

公式块中表示空集

  • \empty \[ \empty \]

  • \emptyset \[ \emptyset \]

mathbb 和 mathbf

\[ \begin{split} &\mathbb{Z^-}\\ &\mathbb{Z^+}\\ &\mathbb{R^+}\\ &\mathbb{N}\\ &\mathbf{Z^-}\\ &\mathbf{Z^+}\\ &\mathbf{R^+}\\ &\mathbf{N}\\ \end{split} \]

代码高亮

test

编程语言

1
2
3
4
5
6
7
8
9
# Python 
import os
import sys
def test():
print(os.name)
print(sys.platform)
print('Hello World!')
if __name__ == '__main__':
test()

Mermaid流程图

flowchart LR
A("Windows
    (System Level)") 
    -->|Run a|B("Windows Terminal
        (Terminal/Emulator Level)")
B -->|Start a|C("Console Host
    (Host Level)")
C -->|Host a|D("PowerShell
    (Shell Level)")
gantt
        dateFormat  YYYY-MM-DD
        title Adding GANTT diagram functionality to mermaid
        section A section
        Completed task            :done,    des1, 2014-01-06,2014-01-08
        Active task               :active,  des2, 2014-01-09, 3d
        Future task               :         des3, after des2, 5d
        Future task2               :         des4, after des3, 5d
        section Critical tasks
        Completed task in the critical line :crit, done, 2014-01-06,24h
        Implement parser and jison          :crit, done, after des1, 2d
        Create tests for parser             :crit, active, 3d
        Future task in critical line        :crit, 5d
        Create tests for renderer           :2d
        Add to mermaid                      :1d

插入图片

位图

自定义头像

矢量图

Level-of-concepts

Tags/Callouts

文字 或者 markdown 均可

header links

链接 typoraio.cn

链接 typoraio.cn

公式 \(E=mc^2\)

\[ \begin{equation}\tag{3} e=mc^2 \end{equation} \]

Tabs

This is Tab 1.

This is Tab 2.

This is Tab 3.

This is Tab 1.

This is Tab 2.

This is Tab 3.

This is Tab 1.

This is Tab 2.

This is Tab 3.

This is Tab 1.

This is Tab 2.

This is Tab 3.

脚注

合并脚注

which1.1

which2.2

which3.3

脚注中带有特殊格式

footnot.4

emphasis(italic).5

strong(bold).6


  1. Deep Learning with Intel® AVX-512 and Intel® DL Boost https://www.intel.cn/content/www/cn/zh/developer/articles/guide/deep-learning-with-avx512-and-dl-boost.html www.intel.com ↩︎

  2. Deep Learning with Intel® AVX-512 and Intel® DL Boost https://www.intel.cn/content/www/cn/zh/developer/articles/guide/deep-learning-with-avx512-and-dl-boost.html www.intel.com ↩︎

  3. Deep Learning with Intel® AVX-512 and Intel® DL Boost https://www.intel.cn/content/www/cn/zh/developer/articles/guide/deep-learning-with-avx512-and-dl-boost.html www.intel.com ↩︎

  4. 技术文档 技术文档 | Microsoft Learn ↩︎

  5. 《Sorting algorithm》, Wikipedia. 2024年3月19日. 见于: 2024年5月22日. [在线]. 载于: https://en.wikipedia.org/w/index.php?title=Sorting_algorithm&oldid=1214598553#Stability ↩︎

  6. 《Sorting algorithm》, Wikipedia. 2024年3月19日. 见于: 2024年5月22日. [在线]. 载于: https://en.wikipedia.org/w/index.php?title=Sorting_algorithm&oldid=1214598553#Stability ↩︎