相关疑难解决方法(0)

如何将自定义css文件添加到Sphinx?

我如何添加自定义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)

python python-sphinx

34
推荐指数
4
解决办法
1万
查看次数

修改Sphinx主题"阅读文档"的内容宽度

我正在使用"阅读文档"Sphinx主题作为我的文档.在原始主题中,给出如下

http://read-the-docs.readthedocs.org/en/latest/theme.html

内容或主要布局宽度设计为移动友好.但是,对于我的项目,我希望这会更广泛.我不知道HTML,因此如果任何人可以给我一些线索来增加内容(布局)宽度,我将不胜感激.

html themes width python-sphinx

32
推荐指数
8
解决办法
2万
查看次数

模块中的Python Sphinx autodoc函数

我刚刚开始使用狮身人面像,并愿意学习.

我想将我的各种函数分解到index.rst文件中的不同部分.所以每个函数都有自己的头.

因此,例如,如果我有一个名为test.py的python文件,并且在该文件中我有2个函数

def foo():
    """This prints bar"""
    print("bar")

def bar():
    """This prints foo"""
    print("foo")
Run Code Online (Sandbox Code Playgroud)

我怎么能在index.rst中将test.py文件中的2个函数分开.

:mod:`test` -- foo
.. automodule:: test.foo
   :members:
   :undoc-members:
   :show-inheritance: 
:mod:`test` -- bar
.. automodule:: test.bar
   :members:
   :undoc-members:
   :show-inheritance: 
Run Code Online (Sandbox Code Playgroud)

如果我能弄清楚如何分离这些函数,那么它在index.html中看起来更干净,那将是非常棒的!因为现在输出不是很干净,如果我只是运行以下:

:mod:`test` -- these are my functions
--------------------------------------------
.. automodule:: test
   :members:
   :undoc-members:
   :show-inheritance:
Run Code Online (Sandbox Code Playgroud)

python documentation docstring python-sphinx

5
推荐指数
1
解决办法
4359
查看次数

标签 统计

python-sphinx ×3

python ×2

docstring ×1

documentation ×1

html ×1

themes ×1

width ×1