首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Sphinx错误:未知指令类型"automodule“或"autoclass”

Sphinx错误:未知指令类型"automodule“或"autoclass”
EN

Stack Overflow用户
提问于 2012-11-23 00:02:53
回答 1查看 34K关注 0票数 86

我需要使用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`

我需要那个人告诉我如何解决这个问题。

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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"

票数 146
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13516404

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档