Ubuntu18.04 uses doxygen to generate comment documents

       In the process of program development, what I often encounter is handing over programs with others. It is a headache to directly look at other people's codes. What's more, some people write programs that are very bad. Functions with hundreds of lines are blind The named variable is simply the code with its own encryption function, which is very unfriendly to people.
       My previous company had relatively strict requirements. The system design and detailed design documents are relatively complete. After the design is completed, write the code. When explaining the program to others, just send the detailed design documents to others. You can avoid the problem of looking directly at the code. The problem I encountered in my current work is that the development cycle is very short, and the function is immediately requested when the demand is put forward. There is no design at all, and it is very uncomfortable after a long time, especially when many people participate in a module project.
       Let's share how to use doxygen to generate comment documents. One is that when there is no requirement after all, everyone is lazy and unwilling to write design documents. The second is to save time. Generate documents through comments, which is very convenient when handing over to others, and makes you look more professional. From a manager's point of view, programs with documentation are very helpful in multi-person collaborative projects, especially in the context of the current high turnover of personnel. Leaving documentation is really necessary.
       That's a lot of nonsense, let's talk about how to do it. First of all, the system I use is ubuntu. If you are developing under windows, it will only be simpler than mine.
       First of all, the advantage of using vscode as a development work is that it has its own comment generation plug-in, and it is easy to generate comments.
As shown below, install the Doxygen Documentation Generator plugin. You can find it by searching for Doxygen in the extension store.
insert image description here


       What is particularly convenient after using this plugin is that typing /** and pressing Enter can automatically generate comments. Enter /** in the development of the header file to generate header file comments, enter /** on the function and press Enter to generate function comments. As shown below, this is very convenient, and it is also convenient to write comments, which are just a matter of convenience. :
insert image description here


       Not to mention whether there is a design document in the back, it is simply a comment with a uniform style, which makes people feel very comfortable.
After the code is commented, it is how to generate the document. Not to mention under windows, just install the doxygen software.
Execute the following command under ubuntu to install the doxygen graphical interface:

sudo apt-get install doxygen doxygen-gui

After the installation is complete, enter doxywizard in the terminal, and then open the gui panel

$doxywizard

After opening the graphical interface, enter the following positions according to the actual situation of your own project.
insert image description here

After the above input is completed, click the [Run] panel, and click the button [Run Doxygen] to generate it in the specified directory.
insert image description here

Finally, enter the specified generation directory to find the index.html file, open it with a web page and you can read it. It is a very nice description document.

       What is specifically explained here is that there is no way to generate chm documents on ubuntu. Because this is the format of windows. If it is windows, you can choose to generate chm documents. Under linux, only the form of html can be generated.

Guess you like

Origin blog.csdn.net/yangcunbiao/article/details/123452583