How to include comment blocks starting with `//` - doxygen

I am trying to document a C library with Doxygen. It does not use the special comment block indicators listed here, but instead just //-style comments:
//
// ... text ...
//
How can I make doxygen recognise/include these?

Related

Generate link to relevant line of source code

I have documented my code with doxygen. The generated docs consist of:
a page with the documentation as I put between /** ... */, and
a page with the source-code itself (without the documentation between /** ... */).
Now my question is: Is there a way to generate links such that one can reach the page with the source code opened on the relevant line directly from the documentation?
To show visually what I would like to obtain:
I would like to have a button "Go to source" (shown in red, decorated with an arrow just for here).
Which would land me on the right line of the source code (possibly with a highlight, as shown here).
The following option does exactly that:
SOURCE_BROWSER = YES
Thanks #albert!

Remove line-though comments in VS Code

I am writing API doc comments and would like to include code examples in a comment block with comments included in this same block. I have change the font color for the block comments themselves but not for the comments in the comment.
Is there a way to edit the colors/text-decorations of these? I find it too dark and difficult to read. This happens with every theme I have installed.
This is not related to VS Code, you can highlight an example of the code usage using JSDoc tags. In your instance you're looking for #example:
/**
* #example
* myFunc('calling my func');
*/
function myFunc(args) {
}
And you will see your code sample highlighted in VS Code:

Doxygen: extract specific doxygen defines into separate documentaion

I have some source code (STM32 Peripherial Lib) with existing doxygen parameters which my Doxygen Builds without Problems.
For my project I want to generate a document with all functions in each file and a specific information which I want to add to the functions. But I want to keep the old informations for another doxygen configuration.
Is that possible?
I already added this for testing:
\ifnot "SECTION_DEFINE"
<normal Doxygen Parameters from original Source Code>
\elsif "SECTION_DEFINE"
#brief Function Check TODO
\endif
With this I could deactivate the existing documentation, but I need to write this \ifnot \elsif \endif to every function.
Can I just declare a Tag and only generate the documentation for this specific tag?
Kind regards
Andi
You may create a "related page" where only your additional information will be displayed with the \xrefitem command. As \xrefitem will also create a special text section within your original documentation you may want to combine it with your original idea of using section labels and conditional documentation. To top this concept off, use aliases in order to make your documentation more readable.
Consider this example code:
/** ST documentation
* foobar
* \exclusive for andi's function \endif
*/
void andreas(void);
/** ST documentation
* foobar
* \exclusive for beni's function \endif
*/
void benjamin(void);
You may use this alias in your Doxyfile: exclusive=\if SECTION_DEFINE \xrefitem viparea "Exclusive" "VIPs".
As long as SECTION_DEFINE is not defined, the "exclusive" information will not be included in your documentation. As soon as this section is defined, a "related page" (here: viparea.html) is created in your HTML documentation containing your documented items (here: andreas and benjamin) with the exclusive paragraph behind the command. The result:

How to create a snippet containing all lines with a mark in doxygen?

I would like to add certain lines of code to the doxygen documentation without duplicating them. I would rather mark them with a string in the comment, like
if (some1 > SOME1_MAX) return ERROR_SOME1_TOO_BIG;//include_in_doxy
//.. other code here ...
if (some2 > SOME2_MAX) return ERROR_SOME2_TOO_BIG;//include_in_doxy
and include them.

doxygen auto reference external links?

I use some external libraries in my project, e.g. libev.
I realize I can use markdown (or href) and put
[libev](http://software.schmorp.de/pkg/libev.html)
in my document.
However that only works in a single place, and I don't want to have to put that in the dozens of places I refer to libev.
If it's "ClientWatcher" (one of my classes), doxygen auto links to the class.
Is there some way to tell doxygen to make all occurrences of the word "libev" auto link to http://software.schmorp.de/pkg/libev.html (for example)
If you add
ALIASES += libev="libev"
to Doxygen's configuration file you can use the \libev command to generate a link, like so
/** #mainpage
* See \libev for more info.
*/