2013-04-25 20 views
2

Doxygen允許您生成手冊頁輸出,但據我所知它只能爲實際代碼(函數,類等)生成手冊頁。我在doxygen @mainpage註釋中提供了大量信息,例如示例,這些信息不會顯示在手冊頁輸出中的任何位置。我想用這種格式來製作它,以便我也有一個可以作爲整體介紹的手冊頁。有doxygen這樣做的方法嗎?如何獲取主頁的手冊頁輸出?

到目前爲止,我還沒有找到一種方法,我已經探索過的替代方法對於doxygen爲我創建的index.html文件不起作用。例如,我在index.html文件上嘗試了幾個不同的html2man腳本,但沒有成功。

回答

0

您是否在包含@main doumentation的文件中包含@file <filename>評論,而<filename>確實與實際文件名匹配?

的Doxygen將不包括來自文件的文檔不具有至少this.`

http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdfile

+0

感謝您的建議。我剛剛嘗試添加一個@file註釋,其中包含擴展名爲.dox的附加文件的全名,但是其中沒有任何信息出現在man輸出中。 – Troy 2013-05-01 16:11:16

0

據我所知,這是不可能的。 HTML輸出涵蓋整個項目,而手冊頁輸出涵蓋單個@file。 @mainpage適用於整個項目,而不是任何特定的@file。因此,doxygen不會爲man輸出輸出@mainpage。

我下載了源碼,並瀏覽了src/layout.cpp。搜索(例如)BriefDesc,你會看到每個「佈局處理程序」如何放在一起。我還不知道@mainpage映射到什麼地方,但顯然它不是在「文件佈局處理程序」部分中添加的內容。

我嘗試添加@mainpage或@page,並使用@ref來引用它,看我是否可以創建2個手冊頁並手動將它們綁定在一起,但仍然有一個很好的HTML首頁。例如,我試圖獲得2個手冊頁,foo和foo-intro。要做到這一點,我需要@page。但對於HTML輸出,介紹顯示在「相關頁面」下,而不是「主頁面」。然而@mainpage似乎無法觸發單獨的手冊頁。不理想。

1

我想出了這個變通辦法,這使僞炫魅文本手冊頁,並從HTML炫魅提出一個很好的鏈接到它:

/** 
* @mainpage 
* Summary of my simple project. Please see @ref foo.h for more details. 
* 
* @file foo.h 
* @brief Summary of my simple project. 
* 
* Here is the much more detailed description of my project, 
* originally intended for the main page. Since I value the quality 
* of man page output the most, this will end up on the individual 
* file man page, and will be linked to from the HTML main page. 
* I can rattle on with other things like... 
* @todo find a better solution to the mainpage problem. 
*/