作为make html
命令的结果,Sphinx只为一些模块生成文档。其他模块仍然没有记录在案。你知道吗
项目结构:
|- my-project
|--| my_project
|--| docs
|----| _build
|------| ...
|----| _static
|------| ...
|----| _templates
|------| ...
|---- conf.py
|---- index.rst
|---- Makefile
|---- source
|-----| modules.rst
|-----| ...
conf.py
:
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
autosummary_generate=True
source_suffix = '.rst'
index.rst
:
.. toctree::
:maxdepth: 2
:caption: Contents:
./source/modules
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
source/modules.rst
:
my_project
==========
.. toctree::
:maxdepth: 4
my_project
请考虑查看github上的源代码:https://github.com/mxmaslin/Test-tasks/tree/removeme/tests_python/my-project
问题出在不正确的进口上。感谢@mzjn指出这一点
相关问题 更多 >
编程相关推荐