使用 Doxygen 和手动标记文件生成外部、在线、文档的链接

Glu*_*rth 4 html xml doxygen external tagfile

我编写了一个库,它使用另一个第三方库。该第三方库在特定网站上在线提供。我已成功使用 DoxyGen 来记录我的项目,但 I\xe2\x80\x99m 很难让它生成指向第 3 方在线文档的链接。

\n\n

我发现我可以为文件中的这些类创建 \xe2\x80\x9cdummy\xe2\x80\x9d 条目,并为它们生成页面,这些页面有指向在线文档的链接。这样做的缺点是,我被迫在我的文档上有一个页面,该页面只是一个链接。理想情况下,单击第 3 方类应将用户直接带到在线文档,而不是让用户浏览 \xe2\x80\x9cdo-nothing-but-link\xe2\x80\x9d 页面。

\n\n

我尝试为此使用外部标记文件,但是当 doxygen 运行时不断出现错误,并且标记的类在输出中仍然不是链接。我还没有找到任何使用手动创建的标记文件来引用在线文档的示例,但根据 doxygen 指令的措辞,这似乎应该是可行的。\n我当前的标记文件目前看起来像这样(尽管我已经尝试了相当多的操作)一些变化):\nExternalTags.xml

\n\n
<?xml version="1.0" encoding="UTF-8" standalone="true"?>\n<tagfile>\n<compound kind="class">\n<name>Vector3</name>\n<filename>Vector3.html</filename>\n</compound>\n</tagfile>\n
Run Code Online (Sandbox Code Playgroud)\n\n

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

\n\n
TAGFILES               = "externalTags.xml = http://docs.unity3d.com/ScriptReference/"\n
Run Code Online (Sandbox Code Playgroud)\n\n

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

\n\n
lookup cache used 941/65536 hits=6682 misses=1048\nfinished...\nerror: Fatal error at line 1 column 1: error while parsing element\nerror: Fatal error at line 1 column 1: error while parsing prolog\n
Run Code Online (Sandbox Code Playgroud)\n\n

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

\n

Glu*_*rth 5

终于弄清楚了:看来,我丢失了部分标记文件内容(命名空间部分)。
使用以下标记文件内容时,我没有收到错误,并且标记文件中指定的 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>
Run Code Online (Sandbox Code Playgroud)

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