Sphinx错误:未知指令类型";自动模块&或";AutoClass"; [英] Sphinx error: Unknown directive type "automodule" or "autoclass"
本文介绍了Sphinx错误:未知指令类型";自动模块&或";AutoClass";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用Sphinx记录我的Python项目。但我无法使用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`
我需要那个人告诉我如何解决这个问题。
谢谢
推荐答案
同样的事情也发生在我身上!要修复它,请转到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"
这篇关于Sphinx错误:未知指令类型";自动模块&或";AutoClass";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文