Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make doxygen resolve @ref's to C++ standard library functions?

I sometimes want to refer, in my doxygen comments, to standard library constructs. I can do this with a HTML <a> element - but that's a lot of text to paste. I would much rather be able to write simply {@ref std::string}, and have doxygen know it needs to link to the cppreference.org page for std::string.

I was thinking perhaps this could be possible if someone were to generate a doxygen tags file for the standard library (and even that might not work if tags file don't support arbitrary URLs). So, is there another way to do it?

like image 709
einpoklum Avatar asked Mar 29 '17 17:03

einpoklum


People also ask

What is doxygen in C?

Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, and to some extent D.

How exclude code from doxygen?

How can I make doxygen ignore some code fragment? The new and easiest way is to add one comment block with a \cond command at the start and one comment block with a \endcond command at the end of the piece of code that should be ignored.

How do I show code in doxygen?

You can put example source code in a special path defined in the doxygen config under EXAMPLE_PATH , and then insert examples with the @example tag. Doxygen will then generate an extra page containing the source of the example. It will also set a link to it from the class documentation containing the example tag.


1 Answers

You should have a Doxygen tag file and corresponding offline or online html files. So you can declare it in the Doxygen config file with this format:

TAGFILES = "/location/of/tagFile=http://onlineUrl Or /location/of/OfflineHtml"

To download these files, i found two below resources:

Cppreference

I recommend this way. because of complete documentation of it.

Online link

  1. Download web tag file.
  2. Set below in config file:

    TAGFILES += "location/of/cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/"
    

Offline link

  1. Download html book that is offline copy of the website.
  2. Set below in config file:

    TAGFILES += "location/of/cppreference-doxygen-local.tag.xml=/location/of/html_book_*\reference\en"
    

More


GNU project

Online link

  1. Download a tag file for the latest version.
  2. Set below in config file:

    TAGFILES = "/location/of/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen"
    

Offline link

  1. Download GCC 7.1 Standard C++ Library Reference Manual in HTML. other versions found here.
  2. Set below in config file:

    TAGFILES = "/location/of/libstdc++.tag = /location/of/libstdc++-api-html"
    

More

like image 154
ahoo Avatar answered Sep 29 '22 09:09

ahoo