1

We have a requirement to setup the doxygen report generation based only upon the .dox file. So that unnecessary changes to the source code file can be avoided for just updating doxygen comments. I hope this can be done as per our expectation in doxygen report generation. We need support regarding the same.

At the moment we have added the source files and the other extensions which needs to be parsed for report generationin the FILE_PATTERNS tag as in below:

FILE_PATTERNS          = *.cpp  \
                         *.hpp  \
                         *.c    \
                         *.h    \
                         *.dox

Our expectation is like the doxygen comments will be completely parsed from .dox file and report will be generated.

Behavior: We observed the main page was coming from .dox file comments whereas the references for the API’s, defines, variable defines etc are taken from source code files and .dox files.(i.e doxygen comments from the source code files). Also sometimes it is taking from source code only and not from .dox. Is it a configuration problem or any other ? The source file Arithmetic.c contain the following code

/**
* @brief square of number
* @param[in] value1
* @return int result
* @description square of value
*/
int square(int x)
{
}

input .dox file:

/*! \fn int square(int x)
\brief Square of value
\param value1 for addition
\return square of given value.
*/

if we generate doxygen report using the above source code and .dox file, then the doxygen report will contain the description of function from both source file and .dox file, But our requirement is to take the description from the .dox file.

Akhil PK
  • 11
  • 2
  • Which version of doxygen are you using? It is a bit hard to tell where you problems are, a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) would definitely ne useful. – albert Mar 06 '20 at 17:02
  • Probably easiest is to see to it that there are no doxygen comments in the file `Arithmetic.c`, so change the `/**` into `/*`, at least when I understood the problem correcly. – albert Mar 09 '20 at 16:03
  • Can we use only the .dox file as input to doxygen for documenting .h and .c files, to avoid the the dependency of source file for the documentation? – Akhil PK Mar 11 '20 at 09:27
  • To the best of my knowledge not as doxygen would not be able to find the function to which the documentation belongs. You could, of course, add a prototype in the `.dox` file as well. The entire construct is quite error prone, especially the placing of the documentation in a different file than the code (very easy to forget to document some changes, also when e.g. the argument list changes. It is also error prone when you have 2 places with similar documentation (`.dox` and `.c` file). – albert Mar 11 '20 at 09:56
  • I don't know who gave the order for "We have a requirement to setup the doxygen report generation based only upon the .dox file.", but in my opinion this requirement should be rethought. – albert Mar 11 '20 at 09:57
  • Is there any possibility to parse source code and doucmentation file, but generate documentation only from .dox file? – Akhil PK Mar 11 '20 at 16:25
  • No, to the best of my knowledge, there is not, one needs some code as indicated before the situation you described. – albert Mar 11 '20 at 17:04

0 Answers0