Doxygen + sphinx (breathe) for documentation

I am new to using doxygen and sphinx. I have a requirement to create documents that are programmed in C. The idea is to generate xml files from doxygen for each file, and then use breathing as a bridge for sphinx to create html pages. I was able to generate xml files and get html pages as well. However, I see that every html file contains the entire contents of the file, and not every html file / directory.

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

Output:

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

Expected Result

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

Here are the settings: Doxyfile (Doxygen)

 GENERATE_XML = YES 

conf.py (sphinx)

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

Can someone help me in setting the correct configuration to get the expected result?

+6
source share
1 answer

For the above requirement, a Doxyfile must be created for the directory. This will generate doxyfile based xml files

 ie for the files dir1 => file1.h and file1.c dir2 => file2.h and file2.c create Doxyfile1 in dir1 Doxyfile2 in dir2 

This generates separate index.xml files for each directory.

Sphinx configuration (conf.py) must specify location in xml

 ie breathe_projects = { <dir1_name>: <dir1/xml_path>, <dir2_name>: <dir2/xml_path> } 

With the above changes, the separate html files are file1.html (with files file1.h and file1.c) and file2.html (with files2.h and file2.c).

+3
source

Source: https://habr.com/ru/post/972300/


All Articles