MkDocs template¶
约 196 个字 20 行代码 预计阅读时间 1 分钟
Mkdocs 模板。
Features:
- 已配置 GitHub Actions,可自动部署到 GitHub Pages
- LaTeX 公式渲染
效果图:
搭建¶
- 搭建 MkDocs 环境
# 方式 1
conda create -n mkdocs python=3.11
conda activate mkdocs
pip install -r requirements.txt
# 方式 2
./setup.sh
source venv/bin/activate
-
自定义修改
mkdocs.yml
配置文件相关内容 -
本地预览;手动部署到 GitHub Pages
使用¶
LaTeX 公式¶
内联公式:使用 $...$
,如 \(f(x) = x^2\) 。
行间公式:使用 $$...$$
,如
\[
F(x) = \int^a_b \frac{1}{2}x^4
\]
不同代码块的互相切换¶
mkdocs Admonitions¶
Abstract
这里是 abstract
Note
这里是 note
Tip
这里是 tip
Info
这里是 info
Success
这里是 success
Question
这里是 question
Warning
这里是 warning
Danger
这里是 danger
Failure
这里是 failure
Bug
这里是 bug
Example
这里是 example
Quote
这里是 quote
toggle admonitions
Note
这里是 toggle note
expanded toggle admonitions
Note
这里是 expanded toggle note
inline admonitions
这里是 inline note
Note
这里是 inline note