90

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`

問題を解決する方法を教えてくれる人が必要です。

ありがとうございました

4

1 に答える 1

150

同じことが私にも起こりました!これを修正するには、次のような 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 のドキュメント: エラー: 不明なディレクティブ タイプ "program-output"

于 2013-06-08T23:16:59.413 に答える