# 可表示1-6级标题
斜体 : *斜体*
粗体 : **粗体**
粗体加斜体 : ***粗体加斜体***
🐫 😊 😄 : :smil\e:(去掉斜线)
分割线(下面这条) : ---
上角标 : ^上角标^
下角标 : ~下角标~
删除线 : ~~删除线~~
下划线 : <u>下划线</u>
- 无序列表 : - 无序列表
- 有序列表 : 1. 有序列表
- 代办列表 : - [ ]代办列表
- 已完成 : - [x]已完成
区块 : > 区块
可以嵌套 : >> 可以嵌套
代码
: `代码`
代码段 : ```代码段 ```
链接 : [链接](网址)
图片 : ![描述](网址), 注意某些网址不适用, 比如csdn
其他html元素
Ctrl : <kbd>Ctrl</kbd>
\ : 转义
f ( x ) = a − b f(x)=a-b f(x)=a−b : $f(x)=a-b$
$\$f(x)=a+b$\$(删掉斜杠) 如下
f
(
x
)
=
a
+
b
f(x)=a+b
f(x)=a+b
高级公式和矩阵用到了自己去搜
还支持各种流程图
更换hexo默认md渲染器
hexo默认采用hexo-renderer-marked
渲染器, 不支持插件, 上述例子中部分不支持, 下面一个一个解决
-
更换渲染器
换成支持插件扩展的hexo-renderer-markdown-it
, 在hexo项目目录下执行以下命令npm un hexo-renderer-marked --save npm i hexo-renderer-markdown-it --save # 安装emoji插件 npm install markdown-it-emoji --save # 安装数学公式插件 npm install markdown-it-katex --save # 安装待办事项插件 npm install markdown-it-checkbox --save
-
编辑hexo项目配置文件
项目根目录下的_config.yml
, 添加以下内容# Markdown-it config ## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki markdown: render: html: true # 是否对HTML标签进行解析,false时HTML将按照原样输出 xhtmlOut: false # 是否需要满足严格的XHTML格式,换行为<br /> breaks: true linkify: true typographer: true quotes: '“”‘’' plugins: - markdown-it-abbr - markdown-it-footnote - markdown-it-ins - markdown-it-sub - markdown-it-sup - markdown-it-emoji # add emoji - markdown-it-katex - markdown-it-checkbox anchors: # Minimum level for ID creation. (Ex. h2 to h6) level: 2 # A suffix that is prepended to the number given if the ID is repeated. collisionSuffix: 'v' # If `true`, creates an anchor tag with a permalink besides the heading. permalink: false # Class used for the permalink anchor tag. permalinkClass: header-anchor # The symbol used to make the permalink permalinkSymbol: ¶
-
另外
安装数学公式插件, 需要在主题的模板文件中加一行代码, 路径大概在themes/next/layout/_partial/head.swig
加入
<link href="https://cdn.bootcss.com/KaTeX/0.7.1/katex.min.css" rel="stylesheet">