Use of @see or @link in doxygen

15,375

Solution 1

To link to other classes you should use the ref command. You can use the \link command, but you must end your link text with the \endlink command, which I suspect is your problem (although without example documentation I can't be sure).

From the doxygen manual section on automatic linking, which I suggest you read, there is a paragraph on links to classes:

All words in the documentation that correspond to a documented class and contain at least one non-lower case character will automatically be replaced by a link to the page containing the documentation of the class. If you want to prevent that a word that corresponds to a documented class is replaced by a link you should put a % in front of the word. To link to an all lower case symbol, use \ref.

Some further points to consider:

  • Doxygen does accept the \see (which is synonymous to \sa) and \link commands. If these are not working as expected the OP should include some example documentation you we can try and work out which this is not working as expected.

  • The notation {\command description}, with the enclosing { and } is not common in doxygen documentation, I'm not sure how the program will treat these so it is probably best to not use this style.

Solution 2

I suspect you are commenting with //

Doxygen will catch the tags this way:

/**
* @KEYWORD DESCRIPTION
*/ 

You can also just add a third / to make each comment line begin with /// as doxygen will catch this also.

Share:
15,375
FredFloete
Author by

FredFloete

Updated on June 04, 2022

Comments

  • FredFloete
    FredFloete about 2 years

    I documented with Javadoc before and used the tags @see, @link or {@see foo} and {link foo} in my description to link to other classes. Now I tried doxygen and it seems that these tags are incompatible. If I run doxygen the complete tags are simply be interpreted as normal text.

    Are there any alternative tags which I can use to get the same features?

  • FredFloete
    FredFloete almost 12 years
    @DougRamsey: You're right, but I want to use the tags like this: This class implements {@link Parcelable}.. It's just an example but /// or / doesnt work for me in this one.
  • Chris Dargis
    Chris Dargis almost 12 years
    @FredFloete: Then use the `\link' command: stack.nl/~dimitri/doxygen/commands.html#cmdlink
  • Chris
    Chris almost 12 years
    @FredFloete Try replacing This class implements {@link Parcelable} with This class implements \ref Parcelable. See my answer for more information.
  • Chris
    Chris almost 12 years
    @DougRamsey \link can be used to reference other classes, but it is for using custom link text (rather than just the name of the class) and the link text must be followed by an \endlink command. It is easier in my opinion to use the ref command.
  • FredFloete
    FredFloete almost 12 years
    I've solved the problem or better worked around it. I use the normal JavaDoc Tags like {@link #onCreate(Bundle)} or {@link Content} if it is a class of my own. Documenting or refereeing to android methods and classes are not working correctly. There are no links included or displayed. I’ve the same problems in JavaDoc too so I decided to add <a href="http://developer.android.com/reference/android/app/Act‌​ivity.html">Activity‌​</a> into the text instead of {@link Activity}.
  • rekire
    rekire over 8 years
    If you want to link against the Android documentation you might want to check my android23.tag file. Which provides all links to the official documentation.