Doxygen Tutorials

From Macro Wiki
Jump to: navigation, search

This is a simple tutorial with some tips on how to use Doxygen to document codes and how to show the generated HTML page.

What is Doxygen

Doxygen is a tool to generate documentation from source code. It is primarily used for C++ codes, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL, Fortran, VHDL, Tcl, and, to some extent, D. You can see more information here.

Download

You can download the Doxygen here.

How to document you code

In order to generate Doxygen documentation, you need to comment the code in a specific way. You can take a look at this page to see more information on how to comment your code.

How to see the HTML page on SourceForge

When you comment your code using the Doxygen style, after compiling, it generates an HTML page.

If you try to see the HTML page in the Source Forge site, it will only show the HTML code: Html.png

However, if you want to see the result of the HTML page instead of its code, you should look at the Source Forge site using the Anonymous Access. By doing so you will have access to a ready-only page, where you can visualize the result of the HTML. You can access the Source Forge project using a path like this:

https://svn.code.sf.net/p/PROJECTNAME/REPOSITORY/

However, if your project has some sub-projects, you would need to use something like:

https://svn.code.sf.net/p/PROJECTNAME/SUBPROJECT/REPOSITORY/

Once in the repository page, you need to find the folder where the Doxygen documentation is and then click on the 'index.html' file.

Example:

To better illustrate it, let's use "Little John" as an example. We have the project 'macro@ufmg' in Source Forge. Under 'macro@ufmg', we have the sub-project 'Little John', and then the repositories 'AX18 Smart Robotic Arm', 'Mobile Base' and 'Mobile Manipulator'.

Little john.png

So let's choose the repository 'Mobile Manipulator'. The Source Forge page using the Anonymous Access is

https://svn.code.sf.net/p/macroufmg/littlejohn/mobilemanipulator/

By accessing this page you will see something like this:

Mobile manipulator.png

In the case of the repository 'Mobile Manipulator', the file 'index.html' is in the following path:

trunk/ROS/catkin_ws/src/littlejohn_control/src/documentation/html/index.html

So the page with the generated HTML will be

https://svn.code.sf.net/p/macroufmg/littlejohn/mobilemanipulator/trunk/ROS/catkin_ws/src/littlejohn_control/src/documentation/html/index.html

By clicking on this page you will see something like this:

Final page.png

This is how the Doxygen HTML page looks like. You can then navigate through this page to see the classes, namespaces, functions, etc.