Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: newcoder007 on December 31, 2020, 07:00:58 am

Title: Empty Dogygen Document
Post by: newcoder007 on December 31, 2020, 07:00:58 am
When I click on DoxyBlocks -> Extract documentation then I get an folder with dogygen/html/index.html.
But the index.html is empty. there is no description of method, parameter or return value.
Why is this so?

That's the code:

/**
 @brief test
 @param x test
 @param y test
 @return test
*/
int add(int x, int y){
    return x+y;
}
Title: Re: Empty Dogygen Document
Post by: Miguel Gimenez on December 31, 2020, 11:21:34 am
Did you put something like this at the beginning of the file?

Code
/**
 * @file
 * @brief Empty user application template
 */
Title: Re: Empty Dogygen Document
Post by: newcoder007 on January 01, 2021, 10:28:28 pm
No, I didn't.
Should I?
Title: Re: Empty Dogygen Document
Post by: Miguel Gimenez on January 01, 2021, 10:48:34 pm
Yes
Title: Re: Empty Dogygen Document
Post by: oBFusCATed on January 01, 2021, 11:09:21 pm
Are you sure? Posting links to doxygen documentation explaining why this is required might be more convincing :)
Title: Re: Empty Dogygen Document
Post by: sodev on January 02, 2021, 01:46:56 am
To document global objects that are not a class or namespace you need to add at least a @file block before them: https://www.doxygen.nl/manual/docblocks.html#structuralcommands (https://www.doxygen.nl/manual/docblocks.html#structuralcommands) (the "Attention" box further down)
Title: Re: Empty Dogygen Document
Post by: newcoder007 on January 02, 2021, 03:48:09 am
This still don't work (see attachment).
Here is my code:

Code
/**
 * @file File Description
 * @brief Empty user application template
 */

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("%d\n", sum(3,7));
    return 0;
}

/**
 @brief Lorem Ipsum
 @param a Lorem Ipsum
 @param b Lorem Ipsum
 @return Lorem Ipsum
*/
int sum(int a, int b){
    return a+b;
}
Title: Re: Empty Dogygen Document
Post by: sodev on January 02, 2021, 06:46:24 am
For your function comment to work i think you need to place the stars on each line. Still, that doesnt explain why the file comment is missing, might be related to the configuration, how does your doxygen configuration file look like?
Title: Re: Empty Dogygen Document
Post by: newcoder007 on January 03, 2021, 05:33:16 am
I put the missing stars in my code. But that's not the reason why it doesn't work.

In the doxygen.log I get this message:
warning: the name 'File' supplied as the argument in the \file statement is not an input file

You can see my configuration in the attachment.
Title: Re: Empty Dogygen Document
Post by: newcoder007 on January 03, 2021, 05:34:01 am
The other configuration settings are in the post before.
Title: Re: Empty Dogygen Document
Post by: sodev on January 03, 2021, 09:20:59 am
That warning explains something, you must not put anything else after the @file command on the same line or it will be taken as a filename parameter of that command. Since you document the current file you should not supply a parameter to the command.

Additionally it might be necessary to enable EXTRACT_ALL, but i would try first without that setting.
Title: Re: Empty Dogygen Document
Post by: newcoder007 on January 03, 2021, 11:00:28 pm
I've deleted the folder and created a new one.
Now, it looks better but it isn't what I want.
The description of the parameter is not shown and there is no link to the sum function.

Code
/**
 * @file
 * @brief Empty user application template
 */

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("%d\n", sum(3,7));
    return 0;
}

/**
* @brief Lorem Ipsum
* @param a Lorem Ipsum
* @param b Lorem Ipsum
* @return Lorem Ipsum
*/
int sum(int a, int b){
    return a+b;
}
Title: Re: Empty Dogygen Document
Post by: newcoder007 on January 05, 2021, 02:43:48 am
No idea?
Title: Re: Empty Dogygen Document
Post by: Miguel Gimenez on January 05, 2021, 10:43:09 am
Can you attach doxygen.log, or copy its content into code tags (the hash button above the composing window)?
Title: Re: Empty Dogygen Document
Post by: sodev on January 05, 2021, 12:24:46 pm
Your output looks correct to me. What you see there is some index of the documentation, if you would click on the main.c link behind the function name it opens the actual documentation page.

Usually i don't create my documentation from source files but from header files and mostly classes, free functions are rare in my code base. Mostly i use the class index to navigate the documentation and don't need anything else. However you can create extra topic pages or other pages to produce a better navigation experience.

Best option is you read the Doxygen documentation yourself to figure out what is possible. There are lots of parameters you can specify in the Doxyfile configuration file to control what gets generated like dependency graphs and the like.