これは私のファイル階層です:
インフォレスキュー
|
|_ src
|
|_ _ _ には
|が含まれます。
|_ _ _ _ _ i1.py
|_ _ _ _ _ i2.py
| _ _ _ _ _ init.py
|
|_ _ _ ユーティリティ
|
|_ _ _ _ _ u1.py
|_ _ _ _ _ u2.py
|_ _ _ _ _ init .py
|
|_ _ _ ドキュメント
|
|_ _ _ _ _ index.rst
|_ _ _ _ _ project.rst
|_ _ _ _ _ contact.rst |_
_ _ _ _ api
|
|_ _ _ _ _ _ api.rst
|_ _ _ _ _ _ includes.rst
|_ _ _ _ _ _ utils.rst
ドキュメントの生成には Sphinx を使用しています。sphinx に関連するものはすべてdoc
ディレクトリにあります。
私のindex.rst:
.. InfoRescue documentation master file, created by
sphinx-quickstart on Sun Sep 15 13:52:12 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to InfoRescue's documentation!
======================================
Contents:
========
.. toctree::
:maxdepth: 2
project
api/api
contact
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
api.rst :
InfoRescue API
**********
.. toctree::
:glob:
:maxdepth: 1
**
現在、utils 内には .py ファイルがあります。これらのファイルにはどちらもクラスと直接コードは含まれておらず、関数のみが含まれています。私が使用できる関数を文書化するには.. autofunction:: utils.u1.functionName
. これは正しく機能していますが、関数ごとにこのように書く必要があります。すべての機能を単純に含める簡単な方法はありますか?
includesディレクトリ内の両方のファイルにクラスが含まれておらず、一部の(直接)コードのみが機能するとします。そのためのドキュメントを生成する方法、つまりどの自動ディレクティブを使用するか?
また、utils および includes ディレクトリ内のinit .py ファイルは両方とも空です。.rst ファイルからこれらのディレクトリ内のファイルにアクセスできるように、これら 2 つを作成しました。_ init _.py ファイルを作成する必要がないように、他のアプローチはありますか?