我需要使用Sphinx记录我的Python项目。但我不能用autodoc
。
当我配置我的项目时,我选择了“扩展autodoc”选项,但现在如果我使用
.. autoclass:: Class
我得到一个错误:
ERROR: Unknown directive type "autoclass"
我配置了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`
我需要那个人告诉我如何解决这个问题。
谢谢
发布于 2013-06-09 07:16:59
同样的事情也发生在我身上!要修复它,请转到conf.py中类似以下内容的行:
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode']
你的可能会看起来不一样。无论如何,将'sphinx.ext.autodoc'
添加到列表中。例如:
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']
如果是:
extensions = []
然后将其更改为:
extensions = ['sphinx.ext.autodoc']
资料来源:Sphinx documentation: ERROR: Unknown directive type "program-output"
https://stackoverflow.com/questions/13516404
复制相似问题