**Some time ago, the company’s project required to follow the doxygen document specification, and the Doxygen 1.8.4 version was installed under Windows XP. It can be used to check whether the header file complies with the doxygen specification and some simple errors. In addition, you can also follow the C or C++ source code It is more convenient to generate the corresponding API document, especially when generating the html format. **
**For example, if you want to find API documents related to the source code of dbus, glib, etc., you can use the doxygen tool to generate the corresponding API documents from the source code of the downloaded open source software. **
doxygen also has an open source version of linux, the download address is as follows: http://sourceforge.net/projects/doxygen/
Doxygen website: http://www.stack.nl/~dimitri/doxygen/index.html
Doxygen Manual :http://www.stack.nl/~dimitri/doxygen/manual/index.html
** Documenting the code : **http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html#docstructure
**If you are not familiar with English, you can refer to the introduction of doxygen on Baidu Encyclopedia for the time being: **http://baike.baidu.com/view/1502693.html
**Doxygen is an open source, cross-platform, document system described in a style similar to JavaDoc. It fully supports C, C++, Java, Objective-C and IDL languages, and partially supports PHP, C#. The comment syntax is compatible with Qt-Doc, KDoc and JavaDoc. Doxgen can start from a set of archives source files, generate HTML format online class Browser, or offline LATEX RTF reference manual. **
1. Use the apt-get install command under Ubuntu 12.04 to install the doxygen command line tool and the corresponding GUI tool. The command is as follows:
sudo apt-get install doxygen
sudo apt-get install doxygen-gui
After installation, there are three command tools about doxygen in the /usr/bin directory:
doxygen (command line tool)
doxytag
doxywizard (GUI wizard tool)
**2. Use doxygen under Ubuntu 12.04 to generate API documentation from the downloaded source code. ****1. Download the source code D-Bus-1.6.10 from the blfs website http://www.linuxfromscratch.org/blfs/view/svn/general/dbus.html, the link is: ** http://dbus.freedesktop.org/releases/dbus/dbus-1.6.10.tar.gz**, this website has many ready-made Linux commonly used software. **
**2、 Ctrl+Alt+T to open the terminal, enter doxywizard, the following doxygen GUI interface will pop up, which is similar to the doxygen used under Windows XP. **
2、 Unzip the just downloaded dbus-1.6.10.tar.gz
Enter the directory where dbus-1.6.10.tar.gz is downloaded, and use the following command to decompress:
tar -xzvf dbus-1.6.10.tar.gz
Or select dbus-1.6.10.tar.gz, right-click, and select [Extract here].
**3、 Configure the options of the dbus project, such as: doxygen script configuration file storage path, doxygen API document storage path, project name, version number and other information. **
In the working directory, for example, /home/ccf/Downloads, create a tmp directory to store the doxygen script configuration files, create a dbus-html-docs directory to store the output dbus API documents, and decompress the dbus-1.6.10 source code Also move to this directory, and perform the following configuration in the doxygen gui interface that pops up in step 1:
It can be seen from the above configuration:
The storage path of the doxygen API configuration script is: /home/ccf/Downloads/tmp
The project name is: dbus
The version number is: 1.6.10
The directory where the source code is located is: /home/ccf/Downloads/dbus-1.6.10
Doxygen API document output path: /home/ccf/Downloads/dbus-html-docs
In addition, note that the [Scan recursively] radio button above must be selected, otherwise the corresponding doxygen API documentation will not be generated.
4、 Run the configuration script to generate doxygen documentation
Select the run tab, and then click the Run doxygen button to generate doxygen API documentation, as shown in the following figure:
5、 Check the generated dbus API documentation reference manual,
You can directly click the [Show HTML output] button on the Run doxygen Tab page in step 4 to view the dbus API html format document.
Or directly enter the dbus API document result output directory, enter the html directory, namely /home/ccf/Downloads/dbus-html-docs/html/, find index.html and double-click to open it, as shown below:
You can see information about dbus API, dbus introduction, modules, classes, files, etc.
There is also a Mac GUI instruction for the Doxywizard command tool. You can look at it against Ubuntu 12.04 and find that the Doxygen tool interface under Windows, Ubuntu 12.04, and Mac is similar, and the usage is similar. The website is: http://www.stack.nl/~dimitri/doxygen/manual/doxywizard_usage.html
**Download the source code later, if you can’t find the official documentation, or the online introduction is not detailed enough, you can use doxygen to generate the corresponding API reference manual, but the prerequisite is that the document is written in compliance with the doxygen code specification! **
Recommended Posts