クラスのない関数 (lib.py) を含む python ファイルがあります。各関数には次のスタイルがあります。
def fnc1(a,b,c):
'''
This fonction does something.
:param a: lalala
:type a: str
:param b: hahaha
:type b: int
:param c: hohoho
:type c: int
:rtype: int
'''
print a
d = b + c
return d
Sphinx を使用して各関数 (入力と出力) を文書化したいだけです。
sphinx-quickstartを実行した後、 lib.pyを使用して conf.pyにパスを定義しました。しかし、出力 HTML ファイル (ようこそページ) は空です。
index.rstに自分自身を書いた場合:
.. function:: func1(a,b,c)
This fonction does something.
:param a: lalala
:type a: str
:param b: hahaha
:type b: int
:param c: hohoho
:type c: int
:rtype: int
html ファイルに入力と出力が表示されます。しかし、それを自動的に行う方法は?
通常、 sphinx-apidoc -oを実行した後にlib.rstで実行する必要があると思いますが、lib.rstには次のようなものしかありません。
lib module
==================
.. automodule:: lib
:members:
:undoc-members:
:show-inheritance:
誰かが私が正確に何をしなければならないかを段階的に説明できますか?