首页 > 解决方案 > 使用 Breathe、Exhale 和 Doxygen 构建 Sphinx 文档会导致 XML 错误

问题描述

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

在我的计算机上make html构建文档 (

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)

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

classndarray_1_1basic__extent.xml这是doxygen 生成的文件的前 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 似乎在抱怨<模板化函数的 。

标签: xmlpython-sphinxdoxygenrestructuredtextread-the-docs

解决方案


推荐阅读