kwc
kwc

Reputation: 307

Doxygen: link to C++ class member from page without writing class name

Let's say I have a class Foo with a member function bar(), documented with Doxygen:

foo.h:

/// This is the Foo class.
class Foo
{
  /// Does something.
  void bar();
};

and a page in a separate file where I want to reference bar() (written in Markdown):

notes.md:

To do something, call bar().

I want "bar()" in the generated page to link to the documentation for the bar() function. I can make this happen by writing Foo::bar() instead, but I don't want it to be displayed as "Foo::bar()" in the page. What is a good way to make this happen?

Upvotes: 1

Views: 2833

Answers (1)

kwc
kwc

Reputation: 307

The best solution I've found so far is to use \ref in notes.md:

To do something, call \ref Foo::bar() "bar()".

In my opinion, this is still a little messy, though. It also doesn't show a brief description of the function on mouseover, unlike auto-generated links.

Upvotes: 1

Related Questions