Doxygen 提供了多種方法來建立項目清單。
使用破折號
在行的開頭放置多個對齊的減號 (-
),將會自動產生項目符號清單。除了減號之外,也可以使用加號 (+
) 或星號 (*
)。
編號清單也可以透過使用減號後接井號 (#
),或使用數字後接點號來產生。
當使用減號後接可選的空格,再接 [ ]
表示未勾選的核取方塊,以及 [x]
或 [X]
表示已勾選的核取方塊時,即可建立具有核取方塊指示符的清單。
允許清單的巢狀結構,並且基於項目的縮排。
以下是一個範例
/*! * A list of events: * - mouse events * -# mouse move event * -# mouse click event\n * More info about the click event. * -# mouse double click event * - keyboard events * 1. key down event * 2. key up event * - checkbox list * - [ ] unchecked * - [x] checked * * More text here. */
結果將會是
事件清單
更多文字在此。
如果您在清單中使用 Tab 鍵進行縮排,請確保組態檔案中的 TAB_SIZE 設定為正確的 Tab 鍵大小。
您可以透過開始新的段落,或在與您想要結束的清單相同縮排層級的空白行上放置一個點號 (.
) 來結束清單。
以下範例不言自明
/** * Text before the list * - list item 1 * - sub item 1 * - sub sub item 1 * - sub sub item 2 * . * The dot above ends the sub sub item list. * * More text for the first sub item * . * The dot above ends the first sub item. * * More text for the first list item * - sub item 2 * - sub item 3 * - list item 2 * . * More text in the same paragraph. * * More text in a new paragraph. */
使用 HTML 指令
如果您願意,也可以在文件區塊內使用 HTML 指令。
以下是使用 HTML 指令的上述範例
/*! * A list of events: * <ul> * <li> mouse events * <ol> * <li>mouse move event * <li>mouse click event<br> * More info about the click event. * <li>mouse double click event * </ol> * <li> keyboard events * <ol> * <li>key down event * <li>key up event * </ol> * </ul> * More text here. */
使用 \arg 或 \li
為了與 Qt Software 的內部文件工具 qdoc 和 KDoc 相容,Doxygen 有兩個可用於建立簡單非巢狀清單的指令。