edg*_*ora 42 python-sphinx autodoc
我需要使用Sphinx记录我的Python项目.但我不能用autodoc.
当我配置我的项目时,我选择"扩展autodoc"选项,但现在如果我使用
.. autoclass:: Class
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
ERROR: Unknown directive type "autoclass"
Run Code Online (Sandbox Code Playgroud)
我配置了PYTHONPATH,现在它很好.但我已经有了这个问题.
我的索引文件是:
.. ATOM documentation master file, created by
sphinx-quickstart on Thu Nov 22 15:24:42 2012.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to ATOM's documentation!
================================
Contents:
.. toctree::
:maxdepth: 2
.. automodule:: atom
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Run Code Online (Sandbox Code Playgroud)
我需要有人告诉我如何解决问题.
谢谢
kir*_*sos 66
这样的事情我也经历过!要修复它,请转到conf.py中的行,其中包含以下内容:
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode']
Run Code Online (Sandbox Code Playgroud)
你的看起来可能会有所不同.无论如何,添加'sphinx.ext.autodoc'到列表中.例如
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']
Run Code Online (Sandbox Code Playgroud)
如果它是:
extensions = []
Run Code Online (Sandbox Code Playgroud)
然后你将它改为:
extensions = ['sphinx.ext.autodoc']
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15396 次 |
| 最近记录: |