我正在寻找一种在 python sphinx 中突出显示文本的方法。 我看过有关如何更改单个单词的字体颜色的文档,但我想更改单个单词的背景颜色。
最佳答案
Sphinx 已经支持突出显示的文本 s5defs.txt
standard definition file用于 inclusion (但缺少 CSS 文件):
创建/附加此文本到 rst_epilog
的值
sphinx 配置,在你的 docs/conf.py
文件中:
rst_epilog = """
.. include:: <s5defs.txt>
"""
关注Sphinx's instructions添加带有您喜欢的大纲的 CSS:
_static/css/s4defs-roles.css
;将其路径附加到 shtml_css_files
中狮身人面像配置:
html_css_files = [
'css/s4defs-roles.css',
]
然后您可以使用:
Some :outline:`outlined text` at last!
TIP: Read this SO if you also want the styling to appear in Latex output.
https://stackoverflow.com/questions/49210787/
相关文章:
java - 如何更改 azure-functions-maven-plugin 的日志记录级别?
python - 如何在 git post-receive hook 中指定 python 解释器?
">javascript - 在 Firefox 中隐藏 <input type ="date">
react-native - react 导航 : stack navigator with tab
tensorflow - 如何在 tensorflow playground 的第 4 个数据集上实