How to (Selectively) Disable Auto-Links to Examples In Doxygen?

2 minutes read

To selectively disable auto-links to examples in Doxygen, you can use the DISABLE_AUTO_LINKS configuration option in your Doxyfile. By setting this option to YES, Doxygen will not automatically create hyperlinks for examples in the documentation. This allows you to control which examples are linked by manually adding hyperlinks where needed. This can be useful if you have complex or specialized examples that may not need to be hyperlinked in the documentation.


How to disable auto-links to specific examples in doxygen?

To disable auto-links to specific examples in Doxygen, you can add the following tag to the specific examples in your code:

1
2
3
4
5
/**
 * @example no_auto_link_example.cpp
 *
 * This example will not be automatically linked in Doxygen.
 */


By adding @example no_auto_link_example.cpp in the documentation comment block for the example, Doxygen will not automatically create hyperlinks to this specific example. This way, you can control which examples are linked by Doxygen and which ones are not.


How to specify when to auto-link in doxygen?

To specify when to auto-link in Doxygen, you can use the \ref command with the name of the entity you want to link to. You can also use the @link tag to create a link to a specific entity in the documentation.


For example, if you want to auto-link to a class named MyClass, you can use the following syntax:

1
2
3
/**
 * This is a reference to the class \ref MyClass.
 */


Alternatively, you can use the @link tag like this:

1
2
3
/**
 * This is a reference to the class @link MyClass MyClass @endlink.
 */


By explicitly specifying the entity you want to link to using one of these methods, you can control when auto-linking occurs in your Doxygen documentation.


What is the effect of turning off auto-links in doxygen?

Turning off auto-links in Doxygen will prevent the automatic linking of certain keywords or identifiers in the code documentation to their corresponding documentation pages. This means that users will need to manually create links to connect different parts of the documentation, making it harder to navigate and understand the relationships between different components. It may lead to a less intuitive and user-friendly documentation experience for the readers.


What is the benefit of disabling auto-links in doxygen?

Disabling auto-links in Doxygen can provide more control over the documentation and prevent unintended linking of certain elements in the code. This can help in creating clearer and more precise documentation by specifying exactly which elements should be linked and which should not be linked. It allows the developer to have more control over the structure and presentation of the documentation.

Facebook Twitter LinkedIn Telegram Whatsapp

Related Posts:

To parse a makefile with Doxygen, you can include the makefile as a source file in the Doxygen configuration file. This will allow Doxygen to analyze the makefile and generate documentation based on the comments and structure within the makefile.To include the...
To make Doxygen ignore certain commands, you can use the "EXCLUDE" and "EXCLUDE_PATTERNS" configuration options in the Doxygen configuration file.The "EXCLUDE" option allows you to specify specific files or directories that you want Dox...
To extend the width of content in Doxygen, you can modify the CSS file to increase the width of the content area. By default, the content width is set in the CSS file provided by Doxygen. Locate the CSS file in your Doxygen project directory and look for the s...
To suppress a Doxygen warning, you can use special commands within your code comments. One common way to suppress a warning is to use the @ignore command followed by the warning code that you want to suppress. This tells Doxygen to ignore that specific warning...
To document C macros with Doxygen, you can add comments directly above the macro definition using the Doxygen comment syntax. This includes starting the comment with /** or /*! and using tags such as \brief, \param, \return, and \remarks to describe the macro&...