微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 Breathe、Exhale 和 Doxygen 构建 Sphinx 文档会出现 XML 错误

如何解决使用 Breathe、Exhale 和 Doxygen 构建 Sphinx 文档会出现 XML 错误

我正在尝试为我的 C++/Python 库设置文档,并希望使用 Sphinx 和阅读文档来完成此操作。因为库的很大一部分将用 C++ 编写,所以我必须使用 Breathe 和 Doxygen 之类的东西来访问提供的 C++ 文档字符串。

在我的计算机 (make html) 上构建文档时,一切正常,我按预期获得文档,但是,当我尝试使用 Read The Docs 构建文档时,构建失败并出现 XML 错误:

breathe.parser.ParserError:
file /home/docs <a load of directories> /doxygenoutput/xml/classndarray_1_1basic__extent.xml:
not well-formed (invalid token): line 13,column 33

我检查了被投诉的文件,第 13 行甚至没有 33 列,所以我唯一的假设是构建过程正在做一些不同的事情。

对这个问题的任何帮助将不胜感激。

如果有帮助,以下是我使用的软件版本:

Sphinx: 3.4.3
breathe: 4.30.0
exhale: 0.2.3
doxygen: 1.9.1 <== (EDIT -- installed version 1.8.13,which is the version on RTD)

============ 编辑 ============

这是由 doxygen 生成文件 classndarray_1_1basic__extent.xml 的前 40 行。看起来这个版本的 doxygen 不喜欢模板化函数

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.13">
  <compounddef id="classndarray_1_1basic__extent" kind="class" language="C++" prot="public">
    <compoundname>ndarray::basic_extent</compoundname>
    <templateparamlist>
      <param>
        <type>typename</type>
        <declname>T</declname>
        <defname>T</defname>
      </param>
      <param>
        <type>typename</type>
        <declname>std::enable_if< std::is_integral< T >::value,int >::type</declname> <<<<<<<< This is line 13
        <defname>std::enable_if< std::is_integral< T >::value,int >::type</defname>
        <defval>0</defval>
      </param>
    </templateparamlist>
      <sectiondef kind="private-attrib">
      <memberdef kind="variable" id="classndarray_1_1basic__extent_1a4e3d7dc85fd368dfcc46750ca908322f" prot="private" static="no" mutable="no">
        <type>T</type>
        <deFinition>T ndarray::basic_extent&lt; T,type &gt;::m_extent[50]</deFinition>
        <argsstring>[50]</argsstring>
        <name>m_extent</name>
        <initializer>{}</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="project dir/ndarray/basic_extent.hpp" line="218" column="1" bodyfile="project dir/ndarray/basic_extent.hpp" bodystart="218" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classndarray_1_1basic__extent_1ab050b78051726f3bfedad2b793f49d24" prot="private" static="no" mutable="no">
        <type>T</type>
        <deFinition>T ndarray::basic_extent&lt; T,type &gt;::m_extent_alt[50]</deFinition>
        <argsstring>[50]</argsstring>
        <name>m_extent_alt</name>
        <initializer>{}</initializer>
        <briefdescription>
        </briefdescription>

在第 13 行(如上所述)中,doxygen 似乎在抱怨模板化函数<

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。