Formatting Test
用于测试关键的若干Markdown语法或Markdown标记是否被正确渲染为预期的html。
当前渲染工具:
- Hexo 框架
- 主题: Butterfly
- Markdown渲染器: pandoc
- 自定义pandoc过滤器,适用于markdown 到 markdown 的预处理
- 自定义pandoc过滤器,适用于markdown 到 html 的最终生成
- 未来减轻开发负担,不要求渲染器所有功能与本文的测试一一对应。
- 行文时,若遇到一些拿不准的特性,始终只以本文被渲染前后的结果为依据。
引用链接
超链接
语法:[Link Text](link-address)
效果:Links - Typora Support (typoraio.cn)
参考链接
语法:
1 | [Link Text][Ref2] |
效果(自动转为普通超链接):
自动链接和网址
语法:<http://typora.io>
语法:This is a link: http://typora.io
效果:This is a link: http://typora.io
本地资源链接
语法:参考Links - Typora Support (typoraio.cn)
不确保非站内资源可行。
不应该支持非站内资源,但是难以排除这些目的之外的资源。
1 | [404_page](../404.html) |
页内链接(链接到headings锚点和raw-HTML锚点)
当headings中含有大小写时,允许链接不区分大小写
A.1
Second_level
ErJi目lu
raw-HTML锚点与raw-HTML跳转
1
2
3<a id="anchor1"></a> Anchor
<a href="#anchor1">Link to Anchor</a>定义raw-HTML锚点anchor1
留白测试跳转
留白测试跳转
留白测试跳转
留白测试跳转
留白测试跳转
带有特殊字符时,简化并改变了一般的Markdown渲染html的规则
- 不遵从Typora的internal-links语法
- 直接将原内容复制到
[]()
的()
内即可 - 推荐使用上述方式,也只保证上述方式是可行的
- 其余方式可能会出现意外结果
带空格 和
特殊字符
链接 用于%%%%¥¥¥¥跳转测试 空格aAa-b cC
Dd
, a#%&xxx Zzz [xx] (yy)留白测试跳转
留白测试跳转
留白测试跳转
留白测试跳转
留白测试跳转
留白测试跳转
留白测试跳转
- 使用markdown语法的链接到headings锚点
- 使用raw-HTML链接到headings锚点
链接允许多重#号
一级目录
二级目录
三级目录
四级目录
五级目录
六级目录
锚点自动追加
-x
,x
为数字以区分。从-1
开始,重复时数字+1。链接可能带有-x
结尾,当存在与链接内容(包括-x
)完全一致的锚点时,跳转到该锚点,不存在这样的锚点时,跳转到与链接剔除-x
后的内容完全一致的第x
个锚点。即:- 优先全文匹配
- 其次按序号匹配
- 需要确保上述匹配过程,至少有一个锚点是存在的。若这样的锚点不存在,渲染器手动抛出异常提醒。
hello
二级目录 hello
hello
一级目录 hello
hello-2
一级目录 hello
hello
三级目录 hello
hello
五级目录 hello
hello
三级目录 hello
自定义锚点 hello
数学公式的基本概念
- 需要在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 | \begin{equation} |
\[ \begin{equation}\tag{1} e=mc^2\\ \end{equation} \]
公式块(行间公式)标注和引用
\[ \begin{equation}\label{eq1}\tag{2} e=mc^2 \end{equation} \]
对公式2的定义语法为:
1 | \begin{equation}\label{eq1} |
此处使用语法$公式\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 | # Python |
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
插入图片
位图

矢量图
Tags/Callouts
文字 或者 markdown
均可
链接 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
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 ↩︎
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 ↩︎
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 ↩︎
技术文档 技术文档 | Microsoft Learn ↩︎
《Sorting algorithm》, Wikipedia. 2024年3月19日. 见于: 2024年5月22日. [在线]. 载于: https://en.wikipedia.org/w/index.php?title=Sorting_algorithm&oldid=1214598553#Stability ↩︎
《Sorting algorithm》, Wikipedia. 2024年3月19日. 见于: 2024年5月22日. [在线]. 载于: https://en.wikipedia.org/w/index.php?title=Sorting_algorithm&oldid=1214598553#Stability ↩︎