Question

I've decided to document the code for my project. I found this tool Doxygen online and downloaded it.

But when I try to actually create an HTML file, it just displays the project contents and none of the special comments above the function.

I tried all types of comments - /*! ... */ , /** ... */ , ///,//!

It displays only the name of a function and its definition in the .h file, like this:

How can I fix this? How can I enable Doxygen to display the special comments too?

Was it helpful?

Solution 2

Doxygen by itself is a very efficient tool, but you have to learn how to use it. The key is the configuration file. The command:

doxygen -g

Will generate for you a default one in the current folder. You then need to edit it, either directly using any text editor, either through a GUI program that is name doxywizard. The default options values are usually a good start, but maybe you switched something ?

This commenting style should work:

/// define foo
#define foo 42

/// a truely efficient function
void foobar();

struct A {
    int b; ///< this is something
};

OTHER TIPS

If I understand correctly, you are just using these special markers on code comments placed in the usual way inside functions? Check that your front-end isn't using

HIDE_IN_BODY_DOCS

If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any documentation blocks found inside the body of a function. If set to NO these blocks will be appended to the function's detailed documentation block.

The default value is: NO.

You also probably want to enable

EXTRACT_ALL

If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in documentation are documented, even if no documentation was available. Private class members and static file members will be hidden unless the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.

Note

This will also disable the warnings about undocumented members that are normally produced when WARNINGS is set to YES.

The default value is: NO.

I haven't specifically tested whether comments in a function body count as "documentation was available", but if you don't have parameter documentation in the doxygen format, I'd definitely turn on EXTRACT_ALL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top