Pythonコードのドキュメントをクリーンアップしようとしていますが、見栄えが良いのでsphinx-docを使用することにしました。次のようなタグを使用して他のクラスやメソッドを参照する方法が気に入っています。
:class:`mymodule.MyClass` About my class.
:meth:`mymodule.MyClass.myfunction` And my cool function
関数内のパラメーター名を文書化する方法を理解しようとしているので、次のような関数がある場合は次のようになります。
def do_this(parameter1, parameter2):
"""
I can describe do_this.
:something?:`parameter1` And then describe the parameter.
"""
これのベストプラクティスは何ですか?
アップデート:
正しい構文は次のとおりです。
def do_this(parameter1, parameter2):
"""
I can describe do_this.
:something parameter1: And then describe the variable
"""