问题描述
我正在尝试为我的 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< T,type >::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< T,type >::m_extent_alt[50]</deFinition>
<argsstring>[50]</argsstring>
<name>m_extent_alt</name>
<initializer>{}</initializer>
<briefdescription>
</briefdescription>
在第 13 行(如上所述)中,doxygen 似乎在抱怨模板化函数的 <
。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)