是否可以在重组文本中查看文本?
例如,<strike>在转换为HTML时呈现为标记的内容,例如:
ReSTructuredText
我如何添加自定义css文件?以下配置对我不起作用:
# conf.py
html_static_path = ['_static']
html_theme = 'default'
html_theme_options = {
'cssfiles': ['_static/style.css']
}
Run Code Online (Sandbox Code Playgroud)
结果:
C:\temp\test-docs\docs>make html
Running Sphinx v1.2.2
loading pickled environment... not yet created
building [html]: targets for 2 source files that are out of date
updating environment: 2 added, 0 changed, 0 removed
reading sources... [ 50%] help
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents...
Theme error:
unsupported theme option 'cssfiles' given
Run Code Online (Sandbox Code Playgroud) 这是"ReST Strikethrough" ReST删除的后续行动,但是在Sphinx而不是ReST背景下.我的问题是,在sphinx中是否有一个中心位置放置一个"角色"指令,或者这个指令是否真的必须在sphinx docmentation中的每个第一个文件中重复.
更详细:
使用角色指令很容易为内联文本定义自定义CSS样式(请参阅ReST Strikethrough作为示例):
.. role:: custom
:class: custom
This is an :custom:`inline text`.
Run Code Online (Sandbox Code Playgroud)
转换为html渲染
.. This is an <span class="custom">inline text</span>. ..
Run Code Online (Sandbox Code Playgroud)
此外,可以轻松地将自定义样式表添加到sphinx(请参阅http://www.tinkerer.me/doc/theming.html),在其中添加CSS类选择器以控制"自定义"文本的呈现方式(颜色,删除线,字体大小...)
令我不安的是,在我的实验中,我不得不在每个使用自定义角色的ReST文件中重复角色指令.是否有一个"中心"的地方,我可以为整个网站定义一次?