61

Are there similar documentation generation systems like Javadoc, for C++? Javadoc produces nice output; It would be great if you could use something like it in other languages.

dreadwail
  • 15,098
  • 21
  • 65
  • 96
DHamrick
  • 8,338
  • 9
  • 45
  • 62

6 Answers6

65

There are several tools that works like JavaDoc for C++ The most popular tool is probably doxygen. It can handle JavaDoc-like comments, and also several languages (e.g., C++, C, Java, Objective-C, Python, PHP, C#). It has pretty good support for tweaking the style of the HTML output using CSS (see the users list for example documentations).

Two important issues when choosing the documentation system is to make sure that it allows you to

  • Document the entities that you are interested in. Do you want to document the system following the code structure or according to some other module division.
  • Getting the output formatted as you want. It is preferable when the documentation fits in with your general project style.

Our experience with doxygen is that it is pretty easy to set up and use, and the resulting output is fairly easy to tweak. Unfortunately, doxygen is not perfect, so in some cases it is necessary to work around quirks or bugs where the doxygen parser breaks down. Be sure to inspect all of your generated documentation carefully.

albert
  • 8,285
  • 3
  • 19
  • 32
Zayenz
  • 1,914
  • 12
  • 11
  • In regards to the parser breaking down I have found my problems seemed to be fixed since moving to using XML commenting, but then again not many of the editors and IDE available support that out of the box. – John Bellone Apr 13 '12 at 14:43
24

You can't use javadoc specifically, but there are a couple of tools that do what you want. The one most people tend to use is Doxygen. Here are some links for Doxygen and Doc++:

Doxygen
Doc++

Vsevolod Golovanov
  • 4,068
  • 3
  • 31
  • 65
dreadwail
  • 15,098
  • 21
  • 65
  • 96
13

There's doxygen that supports a lot of things (and more) Doxygen

albert
  • 8,285
  • 3
  • 19
  • 32
Grant Limberg
  • 20,913
  • 11
  • 63
  • 84
2

I'm just starting to use Sphinx for my Python projects. Its home page states "C/C++ is already supported as well".

It uses a lightweight markup called "reStructuredText".

I've just started using it for my Python projects, and like the look of the output very much.

yan
  • 2,932
  • 1
  • 23
  • 25
Dan H
  • 14,044
  • 6
  • 39
  • 32
1

There is also qdoc for QT based C++ projects. http://doc-snapshot.qt-project.org/qdoc

Yair
  • 926
  • 7
  • 4
0

From the Standardese home page:

Standardese aims to be a nextgen Doxygen. It consists of two parts: a library and a tool.

The library aims at becoming the documentation frontend that can be easily extended and customized. It parses C++ code with the help of libclang and provides access to it.

The tool drives the library to generate documentation for user-specified files. It supports a couple of output formats including Markdown and HTML as well as experimental Latex and Man pages.

The Standardese code repository also points to some blog posts:

Samuel Lelièvre
  • 3,212
  • 1
  • 14
  • 27