DoxyPress  1.7.0
Auto Links

DoxyPress has a command to generate a ‘see also’ section which shows links to relate documentation. Refer to \sa.

For LaTeX documentation a reference to the page number is written instead of a link. Furthermore, the index at the end of the document can be used to quickly find the documentation for a member, class, namespace, or file.

For man pages no reference information is generated.

The next sections show how auto links are generated to the various documented entities in a source file.

Note
When the auto-link tag is set, DoxyPress will link words which correspond to classes or namespaces to the appropriate documentation. An auto link can be prevented for individual cases by adding a % character in front of the word.

Linking to a URL

For HTML, DoxyPress will automatically replace any URLs and mail addresses found in the documentation by links.

To manually specify a link use the HTML 'a' tag shown below. DoxyPress will automatically translate this tag for other output formats.

     <a href="linkURL">link text</a>

Linking to Classes

All words in the documentation which 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.

An auto link can be prevented for individual cases by adding a % character in front of the word.

To link to an all lower case symbol, use \ref.

Linking to Files

All words which contain a dot, which is not the last character in the word are considered to be file names. If the word is indeed the name of a documented input file, a link will automatically be created to the documentation of that file.

Linking to Functions

Links to functions are created if one of the following patterns is found:

  1. <functionName>"("<argument-list>")"
  2. <functionName>"()"
  3. "::"<functionName>
  4. (<className>"::")*<functionName>"("<argument-list>")"
  5. (<className>"::")*<functionName>"("<argument-list>")"<modifiers>
  6. (<className>"::")*<functionName>"()"
  7. (<className>"::")*<functionName>
  • Function arguments should be specified with the correct types to match prototypes. Or you can specify "()" to match any prototype. For non-overloaded members the argument list may be omitted.
  • Member function modifiers (like 'const' and 'volatile') are required.
  • For JavaDoc compatibility a # may be used instead of a :: in the patterns above.
  • In the documentation of a class containing a member myVariable a reference to a global variable is made using "::myVariable", whereas #myVariable will link to the member.
  • If a function is overloaded and no argument are specified a link will be created to the documentation of one of the overloaded members.

For member functions the class scope (as used in patterns 4 to 7 above) may be omitted if:

  • The pattern points to a documented member that belongs to the same class as the documentation block that contains the pattern.
  • The class that corresponds to the documentation blocks that contains the pattern has a base class that contains a documented member that matches the pattern.

Other Links

The following examples can be linked in the same way as described in the previous section. For clarity it is advised to use pattern 3 or 7 shown in the preceding section.

Example:
/*!
  \file autolink.cpp

  Testing automatic link generation.
  
  A link to a member of the Test class: Test::member 
  
  Specific links to overloaded methods:
     Test::member(int) and Test#member(int, int)

  A link to a protected member variable of Test: Test#var 

  A link to the global enumeration type #GlobEnum.
 
  A link to the define #ABS(x)
  
  A link to the destructor of the Test class: Test::~Test 
  
  A link to the typedef ::B
 
  A link to the enumeration type Test::EType
  
  A link to some enumeration values Test::Val1 and ::GVal2
*/


/*!
  This documentation block belongs to the class Test, so no link to Test is generated.

  Two ways to link to a constructor are: #Test and Test()

  Links to the destructor are: #~Test and ~Test()
  
  A link to a member in this class: member()

  Specific links to overloaded methods:
     member(int) and member(int, int)
 
  A link to the variable #var

  A link to the global typedef ::B

  A link to the global enumeration type #GlobEnum
  
  A link to the define ABS(x)
  
  A link to a variable \link #var using another text\endlink as a link.
  
  A link to the enumeration type #EType

  A link to some enumeration values: \link Test::Val1 Val1 \endlink and ::GVal1

  And last but not least a link to a file: autolink.cpp
  
  \sa Inside a see also section every word is checked, so EType, 
      Val1, GVal1, ~Test and member will be replaced by links in HTML.
*/

class Test
{
  public:
    Test();               //!< constructor 
   ~Test();               //!< destructor 
    void member(int);     /**< A member function. Details. */
    void member(int,int); /**< An overloaded member function. Details */

    /** An enum type. More details */
    enum EType { 
      Val1,               /**< enum value 1 */ 
      Val2                /**< enum value 2 */ 
    };                

  protected:
    int var;              /**< A member variable */
};

/*! details. */
Test::Test() { }

/*! details. */
Test::~Test() { }

/*! A global variable. */
int globVar;

/*! A global enum. */
enum GlobEnum { 
                GVal1,    /*!< global enum value 1 */ 
                GVal2     /*!< global enum value 2 */ 
              };

/*!
 *  A macro definition.
 */ 
#define ABS(x) (((x)>0)?(x):-(x))

typedef Test B;

/*! \fn typedef Test B
 *  A type definition. 
 */

Typedefs

Typedefs which involve classes, structs and unions, like

typedef struct StructName TypeName

create an alias for StructName, so links will be generated to StructName, when either StructName itself or TypeName is encountered.

Example:
/*!
\file restypedef.cpp

An example of resolving typedefs.
*/

/*!
\struct CoordStruct

A coordinate pair.
*/
struct CoordStruct
{
  /*! The x coordinate */
  float x;

  /*! The y coordinate */
  float y;
};

/*! Creates a type name for CoordStruct */
typedef CoordStruct Coord;

/*!
This function returns the addition of \a c1 and \a c2, i.e: (c1.x+c2.x,c1.y+c2.y)
*/
Coord add(Coord c1,Coord c2)
{
}