2017-03-11 8 views
0

私は、Doxygenで生成されたライブラリドキュメントのセットを用意しています。結果のドキュメントの「例」タブの下に表示されます。これらのページにDoxygenタイプのマークアップを追加したいと思いますが、その方法を理解できません。すべてのマークアップコメントは削除され、Doxygen出力のどこにも表示されません。私の希望は、いくつかの説明的な段落と、おそらくユーザーが見ることができる一連のプログラム出力を含めることです。私の一時的な回避策は、このすべてをソースコードに非Doxygenコメントとして含めることです。このアプローチは機能しますが、私が望んでいたものではありません。先月の過程で、この問題を探索した後Doxygenにプログラムページなどのマークアップを追加するにはどうすればよいですか?

/** 
* \brief ATTEMPTED DESCRIPTION 
* 
* I would like to include some kind of markup on the example page for 
* this program. I link to it just fine from one of my library routines, 
* the the Doxygen-generated example page just shows all of this verbatim. 
* 
* Is there any way to provide some kind of section where I can discuss 
* the example program itself? And potentially provide sample output 
* and the like? (I realize that doesn't make sense for "Hello World", 
* but you get the idea.) 
*/ 

#include <iostream> 

int main (int argc, char *argv[]) 
{ 
    std::cout << "Hello World" << std::endl ; 

    return 0 ; 
} 
+0

をあなたは\スニペットコマンドを試してみましたか? – themagicalyang

答えて

0

、 私はあなたが効果的に例プログラムファイル内のマークアップとdoxygenの出力 を変更することはできませんことを決定しました。

ソリューションは、あなたの文書に別のページを構築することです、 は\includeディレクティブとサンプルコードが含まれ、その後、 は、手動でこの新しい例のページへのリンクを提供します。上記の の例では、次の形式のファイルを作成し、 \include指示文を使用して、例の プログラムの実際のコードを追加します。次に、内容を簡単に追加し、 プログラム出力のセクションを追加します。この例では

、次のような構造を持つファイルexample-hello-world.dox作成:

/*! \page ex-page Example Program Page 
* 
* \brief Example code for the "hello world" program. 
* 
* \section ex-sec-description Program Details 
* 
* In order to display the string "Hello World" to the standard output 
* stream, the user should use the `std::cout` stream provided by C++. 
* 
* \include example_hello_world.cpp 
* 
* \section ex-sec-output Program Output 
* 
* The program above will generate the following output when executed. 
* 
*   Hello World 
*/ 
関連する問題