自定义sphinxdoc主题

自定义sphinxdoc主题,第1张

自定义sphinxdoc主题

我只想在我的狮身人面像文档中添加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.`


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5639592.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存