使用 Doxygen 输出 chmcmd 产生虚假的错误信息

With Doxygen output chmcmd produces fake error messages

我正在使用 chmcmd 从 Doxygen 文件创建 .chm 文档。 后者向我显示(假)错误消息,例如

Error: Anchor [HTML page, generated from a file containing @page]#[a @section or @subsection with label, all in the same file] undefined; first use [HTML page, generated from a file containing @page]

在 HTML 文件中,我看到行

<li><a class="el" href="User_Guide.html#USER_GUIDE_SETUP_AND_DATA_FLOWS">SETUP AND DATA FLOWS</a><ol type="a">

<h1><a class="anchor" id="USER_GUIDE_SETUP_AND_DATA_FLOWS"></a>
SETUP AND DATA FLOWS</h1>

我认为应该没问题。错误信息是假的,因为 .html 文件和 .chm 文件都可以正常工作。它看起来无害,但会产生相当大的噪音,我担心,我会错过一些真正的错误。

我可以反对吗?

特殊字符会使 HTML 帮助编译器出现问题(请参阅附加链接)。我知道这不是你描述的问题。我不使用 ChmCmd,所以很遗憾,我无法重现您的错误消息。

但是,来自帮助和手册论坛的帖子似乎提供了一些信息 Linking to anchors in chm topics from C#。请搜索:

Follow-up by Tim Green: Note that if the topic in question is the first topic in the CHM that's a known bug in the CHM system and unavoidable. It just doesn't synchronize with the topic if its on its own and not in a chapter. That's always been an issue in CHM and Microsoft has never corrected it. The synchronization of the TOC with the topics in CHM is also beyond Help & Manual's control; it's entirely controlled by Microsoft's viewer.

所以,我认为 "... first use ..." 在您的错误消息中与此线程中的问题有关。

来自我们的 HelpwareGroup 站点的更多信息:

CHM Compiler crashed during compilation

HTMLHelp CHM Frequently Asked Questions

顺便说一句,C# 开发人员可能会发现他们的 CHM 格式的文档和电子书无法打开,因为他们将 CHM 文件存储在 'C:\E-books\C#\' 等目录中。哈希字符表示 HTML 中的锚点,因此 CHM 查看器无法正确解析路径并检索内容。要解决此问题,请从目录名称中删除“#”(井号)字符。还要避免在目录名称中使用“?”、“&”和“+”字符。

这看起来不像是 chmcmd 错误。 “@page”或“@section”对 chmcmd 没有意义。 Chmcmd 没有生成任何帮助,它只是编译,所以从这个角度来看,消息也不合逻辑。

为了以防万一,我 grep 了源以确保没有命中。

所以可能不是 chmcmd,但错误可能来自 doxygen html-for-chm 输出模块。