我尝试了我找到的所有解决方案,但没有一个有效。可能是 Python 2 或 3 和/或旧 Sphinx 版本的差异的原因。这就是我所拥有的:
- 具有独立构建和源目录的 Sphinx 项目
- 我将一个名为 custom.css 的文件放在 source/_static 中。内容:
.blue {
parent: bodytext;
textColor: blue;
}
我编辑了我的 conf.py 并在
html_css_files = ['custom.css']下面添加html_static_path = ['_static']我已
.. role:: blue在 *.rst 文档的顶部添加。我已经编辑了文件本身并写道:这是一个带有蓝色单词的句子。
当我渲染我的项目时,html 源代码包含This is a sentence with a <span class="blue">blue</span>:
一切都很好,除了这个词根本不是蓝色的。它与其他颜色相同。
我错过了什么?