reStructuredText 学习笔记

官方网站

入门教程

环境搭建

安装依赖:

1
2
3
4
5
6
Sphinx
sphinx-autobuild
sphinx-rtd-theme
recommonmark
sphinxext-remoteliteralinclude
sphinx-copybutton

执行命令:

1
2
sphinx-quickstart
make html

双击 build 目录下的 index.html 即可以在浏览器中查看效果。

也可以在 VSCode 中实时预览 .rst 文件,需要添加以下配置:

1
2
3
4
{
"esbonio.sphinx.confDir": "conf.py文件所在的文件夹",
"restructuredtext.linter.run": "off"
}

[!NOTE]
需要安装 esbonio 服务器(官方说明:Starting from version 190.1.17, this feature is removed. You will be recommended to install Esbonio extension instead. To learn more about how to configure Esbonio, you can visit this site.)。

参考资料:reStructuredText VSCode 官方文档