【问题标题】:Markdown file with table of contents exported to a doxygen documentation does not create a TOC in HTML带有导出到 doxygen 文档的目录的 Markdown 文件不会在 HTML 中创建目录
【发布时间】:2018-03-30 19:25:04
【问题描述】:

有一个 markdown 文件,我使用它通过 cmake 指令和 doxyfile.in 语句创建 doxygen 文档的一部分。生成的文档几乎是正确的。其实这个markdown文件是doxygen文档的主页。

markdown文件的开头读取

# Title1

[TOC]
## Title2

文档的其余部分继续。然而,当我生成 doxygen 文档时,目录并没有出现。请问有人知道吗?

【问题讨论】:

    标签: markdown doxygen tableofcontents


    【解决方案1】:

    我们在这里处理的是页内目录。

    看起来有多个问题。

    1) [TOC] 应该在第一个标题之前(即 #Title1)(如果不是这种情况,目录仍然不正确,除非给出其他命令,例如 \page。)

    2) TOC_INCLUDE_HEADINGS(在 Doxyfile 即 doxygen 配置文件中)应设置为大于 0 的值以获得 n 页 TOC。来自Doxyfile/doxygen 文档:

    # When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
    # to that level are automatically included in the table of contents, even if
    # they do not have an id attribute.
    # Note: This feature currently applies only to Markdown headings.
    # Minimum value: 0, maximum value: 99, default value: 0.
    # This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
    

    【讨论】:

    • 我刚刚将一个提议的文档补丁推送到 github(拉取请求 688,github.com/doxygen/doxygen/pull/688)。
    • 你的答案是正确的,效果很好。如果我让 [TOC] 在第一个标题之后,目录不会显示正确的标题并且链接会保持断开。
    • 备注正确(关于[TOC]的位置),doxygen给出警告和不正确的TOC。我还有一个 \page 命令,它再次产生正确的结果(降价和常规 doxygen 命令的可能性都非常复杂)。我会调整答案,以便您接受。
    猜你喜欢
    • 1970-01-01
    • 2015-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 1970-01-01
    • 2013-08-06
    相关资源
    最近更新 更多