我只想在我的狮身人面像文档中添加ReST删除线。这是我的做法:
$ cd my-sphinx-dir$ mkdir -p theme/static$ touch theme/theme.conf$ touch theme/static/style.css
在
theme/theme.conf:
[theme]inherit = defaultstylesheet = style.csspygments_style = pygments.css
(这使其看起来像默认主题(图2))
在
theme/static/style.css:
@import url("default.css"); .strike { text-decoration: line-through;}
然后,在您的conf.py中:
html_theme = 'theme' # use the theme in subdir 'theme'html_theme_path = ['.'] # make sphinx search for themes in current dir
此处更多信息:https :
//sphinx.readthedocs.io/en/master/theming.html。
(可选)在global.rst中:
.. role:: strike :class: strike
并在example.rst中:
.. include:: global.rst:strike:`This looks like it is outdated.`
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)