您如何在 Doxygen 中定义主页层次结构?

How do you define a main page hierarchy in Doxygen?

在这个 Doxygen 生成的帮助页面 http://api.fluffyunderware.com/curvy/index.html 上,有一个主页的分层文档索引和一个 table 目录。如何在我自己的文档中复制此功能?

这是上述页面的屏幕截图:

在您 link 的示例网页上,有两个主要窗格:左侧是自动生成的层次结构 index(Doxygen 称之为“ treeview"),右侧是手动生成的 table 的内容 。这些是使用不同的方法生产的。

索引

要创建自动生成的层次索引,请编辑您的 Doxyfile,并确保如下所示显示以下标记:

GENERATE_TREEVIEW      = YES

GENERATE_TREEVIEW 标签的默认值为 NO

这将使索引出现在左窗格中。

Table 个目录

右侧窗格中的Table内容可以手动生成如下。

在你的 markdown 中使用嵌套的缩进的项目符号列表来手动创建一个多级层次结构,并使用@ref(或\ref)命令标签来创建 hyperlinks.

这是我自己项目的 doxygen 文档的摘录。我把这个页面放在一个名为 "pages.dox" 的文档中,并在 Doxyfile 中的 INPUT 标签中添加了对 "pages.dox" 的引用。

/*! @page users_guide STFishFinder API User's Guide

@par Table of Contents

- @ref users_guide
    - @ref black_box
    - @ref api_overview
    - @ref stfishfinder_api
    - @ref wrappers
        - @ref ios_fishfinder_api
        - The Fish Finder API for Android   <!-- @ref android_fishfinder_api -->
        - The Fish Finder API for CLI       <!-- @ref windows_fishfinder_api -->
        - The Fish Finder API for Linux     <!-- @ref linux_fishfinder_api -->
        - @ref porting
    - @ref how_to
        - @ref how_to_connect
        - Flow of Information Overview      <!-- @ref flow_of_info -->
        - Advanced Gain Settings            <!-- @ref gain_how_to -->
        - How To Use the Depth Alarms       <!-- @ref depth_alarms_how_to -->
        - @ref simulator_how_to
        - Updating the Black Box Firmware   <!-- @ref firmware_update -->
        - @ref best_practices

*/


以上摘录的页面由 Doxygen 呈现,如下面的屏幕截图所示:

请注意,我的 table 内容中的某些条目不是 link(例如 "The Fish Finder API for Android")。这是因为我的 API 文档还没有完成,所以我为尚未编写的页面创建了 "placeholders"。我使用 HTML 风格的注释标签注释掉了 @ref links。

另见

  • Doxygen @ref 命令的联机文档位于 this link
  • Doxygen 的文档 markdown 支持 this link.