2010-11-29 21 views
9

誰かがdoxygenによって正しく解析されるようにpythonコードを正しくコメントする方法を理解できますか?pythonのdoxygen構文

何とかタグを無視します。出力(HTML)は、タグを示しています

@brief Creates a new Hello object. 
This Hello Object is beeing used to ... 

@param name The name of the user. 

私が試したの両方の変異体は機能しません。

class Hello: 
    """@brief short description... 

    longer description 
    """ 
    def __init__(self, name): 
    """@brief Creates a new Hello object. 

    This Hello Object is beeing used to ... 

    @param name The name of the user. 
    """ 
     self.name = name 

class Hello: 
    """\brief short description... 

    longer description 
    """ 
    def __init__(self, name): 
    """\brief Creates a new Hello object. 

    This Hello Object is beeing used to ... 

    \param name The name of the user. 
    """ 
     self.name = name 
+0

あなたのインデントは実際には有効ですか? –

+0

はい、そうです。私はちょうどそれを修正した。 – Mark

+1

なぜスフィンクスではありませんか? –

答えて

12

Doxygenのも文書化されていない機能(またはバグ)を持っているが、参照してください。 \の代わりに@を使用してDoxygenコマンドを開始します(バックスラッシュはdocstringのエスケープ文字として機能します)。

+0

これは完璧に動作します、ありがとう! – Penz

4

をDoxygenのは、Pythonのコメントに特別なコマンドを認識するために次のコメントフォームを使用する必要があります。

あなたは感嘆符とドキュメンテーション文字列始める場合はドキュメンテーション文字列にDoxygenの構文を解析します:Pythonのdocstingに、あなたが必要とする

class Hello: 
    def __init__(self, name): 
    """[email protected] Creates a new Hello object. 

    This Hello Object is being used to... 

    @param name The name of the user. 
    """ 
    self.name = name 
     dosomething(12) 

    def dosomething(x):   
     dosomethingelse 

ノート

http://www.stack.nl/~dimitri/doxygen/docblocks.html#pythonblocks