gpt4 book ai didi

doxygen+sphinx(breathe) 用于文档

转载 作者:行者123 更新时间:2023-12-02 21:23:34 24 4
gpt4 key购买 nike

我是 doxygen 和 sphinx 使用的新手。我需要创建文件用C语言编程。这个想法是从 doxygen 为每个文件生成 xml 文件,然后使用 Breath 作为 Sphinx 的桥梁来创建 html 页面。我成功生成了 xml 文件,并且还能够获取 html 页面。但是,我看到每个 html 文件都包含所有文件内容,而不是每个文件/目录的每个 html。

ie. dir1 => file1.h and file1.c
dir2 => file2.h and file2.c

输出:

file1.html => file1.xml & file2.xml
file2.html => file1.xml & file2.xml

预期输出

file1.html to contain file1.xml(both header the implementation)
file2.html for file2.xml

设置如下:Doxyfile(doxygen)

GENERATE_XML = YES

conf.py(sphinx)

breathe_projects = { <dir1_name>: <xml_path>,
<dir2_name>: <xml_path> }

有人可以帮我设置正确的配置以获得预期的输出吗?

最佳答案

对于上述要求,应为每个目录创建 Doxyfile。这将生成基于Doxyfile的xml文件

i.e. for the files
dir1 => file1.h and file1.c
dir2 => file2.h and file2.c

create
Doxyfile1 in dir1
Doxyfile2 in dir2

这会为每个目录生成单独的index.xml 文件。

在 Sphinx 配置(conf.py)中,应提供 xml 的位置

i.e. breathe_projects = { <dir1_name>: <dir1/xml_path>,
<dir2_name>: <dir2/xml_path> }

通过上述更改,分离 html 文件 - file1.html(包含 file1.h 和 file1.c)和生成file2.html(带有file2.h和file2.c)。

关于doxygen+sphinx(breathe) 用于文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24775752/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com