4

我写了一个库,它使用另一个 3rd 方库。此第 3 方库在特定网站上在线提供。我已经成功地使用 DoxyGen 来记录我的项目,但是我很难让它生成到第 3 方、在线、文档的链接。

我发现我可以在我的文件中为这些类创建“虚拟”条目,并为它们生成页面,这些页面有一个指向在线文档的链接。这样做的缺点是,我被迫在我的文档上有一个页面,它只是一个链接。理想情况下,单击第 3 方课程应该将用户直接带到在线文档,而不是让用户浏览“无所事事但链接”页面。

我试图为此使用外部标记文件,但是当 doxygen 运行时不断出现错误,并且标记的类在输出中仍然是非链接。我没有找到任何使用手动创建的标记文件来引用在线文档的示例,但是根据 doxygen 说明的措辞,这似乎应该是可行的。我当前的标签文件目前看起来像这样(尽管我尝试了很多变体):ExternalTags.xml

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<tagfile>
<compound kind="class">
<name>Vector3</name>
<filename>Vector3.html</filename>
</compound>
</tagfile>

我的配置文件包含以下行(也尝试了许多变体):

TAGFILES               = "externalTags.xml = http://docs.unity3d.com/ScriptReference/"

当标记文件从配置中删除时,doxygen 运行时不会出现任何错误。如果包含标签文件选项,doxygen 总是会产生以下错误:

lookup cache used 941/65536 hits=6682 misses=1048
finished...
error: Fatal error at line 1 column 1: error while parsing element
error: Fatal error at line 1 column 1: error while parsing prolog

如何解决这些错误,并在 doxygen 输出中正确生成链接?

4

2 回答 2

3

终于弄明白了:看来,我缺少部分标记文件内容(命名空间部分)。
使用以下标记文件内容时,我没有收到任何错误,并且标记文件中指定的 Unity 类型的链接正确显示在输出中。

另外,请注意文件名字段不包括 .html 扩展名。

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<tagfile>
  <compound kind="namespace">
    <name>UnityEngine</name>
    <filename></filename>
    <class kind="class">UnityEngine::PlayerPrefs</class>
    <class kind="class">UnityEngine::Vector3</class>
  </compound>
  <compound kind="class">
    <name>UnityEngine::PlayerPrefs</name>
    <filename>PlayerPrefs</filename>
  </compound>
  <compound kind="class">
    <name>UnityEngine::Vector3</name>
    <filename>Vector3</filename>
  </compound>
</tagfile>

可能与问题无关,但尚未测试将其改回,我重命名了标记文件:unity3d-doxygen-web.tag.xml

于 2019-01-16T16:22:09.137 回答
1

已经一年了,但是如果其他人遇到了这个问题,那么问题就出在第一行:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>

应该读作:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Doxygen 只是无法识别true为有效关键字。

于 2017-04-04T15:08:45.520 回答