ここでは少し混乱しているように見えます。Sphinxは実際には構文アナライザーではありません。Sphinxがdocstringをキャッチできるようにするには、Pythonコードを実行可能にする必要があります。そのため、拡張子ファイルの名前を「.py」に変更しても効果はありません。
さて、私は最近SphinxとCythonと協力していて、私の経験を共有したいと思います...docstringsから特定のコンパイル済みCython拡張機能のhtmlドキュメントの自動生成を取得するための完全な詳細な手順は次のとおりです。
[注:Sphinx1.1.3とCython0.17.4を使用しました]
まず、CythonコードでPythonの「docstrings」を使用します(すべての制限があります。たとえば、コンストラクターを記述できません。docstringsの仕様を参照してください)。
cdef class PyLabNode:
    """
    This is a LabNode !!!
    """
    cdef LabNode* thisptr
    cdef PyLabNetwork network
    def __cinit__(self):
       self.thisptr = new LabNode()
    def __dealloc__(self):
       if self.thisptr:
           del self.thisptr
    def SetNetwork(self, PyLabNetwork net):
        """
        Set the network !!!
        """
        self.network = net
そして、「yourextension.so」を再コンパイルします。
次に、「sphinx-quickstart」を実行して質問に答えます。「autodoc」を求められたら、「はい」と言うのを忘れないでください。これにより、「Makefile」、「index.rst」ファイル、および「conf.py」ファイルが生成されます。
この最後の「conf.py」を編集して、Sphinxがモジュールを見つけるように指示する必要があります。
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../../parent/dir/of/yourextension/'))
「index.rst」ファイルも編集して、分析される可能性のあるモジュールを確認する必要があります。
Contents:
.. toctree::
   :maxdepth: 2
.. automodule:: yourextension
   :members:
   :undoc-members:
   :show-inheritance:
最後に、次のようにしてドキュメントを作成します。
$ make html
それで十分でした(「... / _ build / html /」ディレクトリに結果のhtmlファイルのセットを取得しました)。前の質問が出されてからSphinxとCythonが進化した可能性がありますが、対処すべき「署名」の問題はありませんでした。使用する特定のCythonディレクティブも、Sphinxに適用する修正もありません...
お役に立てれば。
編集:まあ、私は私の言葉を取り戻したいと思います。Epydocを使用しているときに、「Dan」が「埋め込み署名」の問題について言及していた問題に遭遇しました(したがって、これはSphinxの問題でもあると思います)。このコンパイラ指令をアクティブ化しても、Python準拠の署名は送信されません。
PyLabNode.SetNetwork(self, PyLabNetwork net)
これには2つの欠点があります。クラスプレフィックスと型付きパラメータのドット付き表記です。
最後に、正しいものを送信するために私が理解できる唯一の方法は、次のようにドキュメント文字列の最初の行に準拠した署名を書くことでした:
def SetNetwork(self, PyLabNetwork net):
    """
    SetNetwork(self, net)
    Set the net !!!
    @param self: Handler to this.
    @type self: L{PyLabNode}
    @param net: The network this node belongs to.
    @type net: L{PyLabNetwork}
    """
    self.network = net
これがSphinxとEpydocの両方のユーザーに役立つことを願っています...
編集:に関しては、次のように説明を2倍にすることで、(Sphinxでは試していませんでし__cinit__た)ドキュメントを正常に生成できました。Epidoc
# For Epydoc only (only used for docstring)
def __init__(self, sim):
    """
    __init__(self, sim)
    Constructor.
    @param sim: The simulator this binding is attached to.
    @type sim: L{PyLabSimulatorBase} 
    """ 
# Real Cython init
def __cinit__(self, PyLabSimulatorBase sim):
   self.thisptr = new LabNetBinding()
   self.sites = []
   simulator = sim