One. What is Doxygen?
Doxygen is a program file generation tool that can convert specific comments in the program into a description file. Usually when we write programs, we will write comments more or less, but for others, it is as hard as salvaging the Titanic to directly explore the comments in the program. Most of the useful comments belong to the description of functions, categories, etc. Therefore, if the annotations can be processed and rearranged into a pure reference manual based on the structure of the program itself, it will reduce a lot of burden for those who use your program code later. However, on the other hand, the work of organizing files is a heavy burden for you.
Doxygen is to follow some of its rules when you write comments. Then, he can help you produce beautiful documents.
Therefore, the use of Doxygen can be divided into two parts. The first is to write comments in a specific format, and the second is to use Doxygen's tools to generate documents.
two. Prepare the software
2.1 doxygen
Official website:http://www.doxygen.nl/
download link:http://www.stack.nl/~dimitri/doxygen/download.html
2.2 graphviz
Official website:http://www.graphviz.org/content/dot-dotexe
Note: This software is not necessary. If you need to use more powerful functions such as class inheritance system diagrams, you need to install this software for configuration and use.Need to install Java environment
download link:http://www.graphviz.org/Download_windows.php
2.3 Microsoft HTML Help Workshop
chm file creation tool
Three software

three. C# comments
<Summary> Brief description of the whole
<summary>Description</summary>
Classes, attributes (not recommended), methods, etc.
<para> Following the Summary, effective explanation of the entry parameters involved in the method
<param name=username>This parameter is the user's account</param>
Method entry parameters;
<returns> Explain the return value of the method;
<returns>A return value of zero means the operation was successful, -1 means the operation was unsuccessful</returns>
The return value of the method;
<remarks> Remarks on some sentences
<remarks>This class needs to call another User class related method</remarks>
Classes, methods, attributes, etc.;
<see> Generate a hyperlink to other descriptions in the generated document;
<see cref=”[member]”/>
Can be added to other comment identifiers
<seealso> The difference with the above is that this identifier shows the hyperlink in the "See Also" area at the end of a document, while the former is in the document;
<seealso cref=”[member]”/>
Can not be added to other comment identifiers
<value> A summary explanation of an attribute;
<value>This is a public property</value>
Attributes
<code> If you need to put a part of the source code section, you can use this identifier to mark it out
<code>
public int add(int a,b)
{
return a+b;
}
</code>
Can be added to other comment identifiers
<exception> Explain the exceptions that may be thrown in the program;
<exception cref=”System.Exception”>Exception thrown</exception>
If an exception is thrown in the method, such as "try...catch structure", you can use this identifier to explain
<permission> Some explanations on method access rights:
<permission cref=”System.Security.PermissionSet”>This is public method</permission>
Method, attribute
<c> versus<code>The identifier is basically the same, but this identifier is only used for a single line of code;
<c>return a+b;</c>
Can be inserted in other identifiers;
<example> For example, usually with<code>Supporting the use of;
<example> The following example shows how to call the Add method:
<code>
class MyClass
{
public static int Main()
{
return Add(1+2);
}
}
</code>
</example>
Can be inserted in other identifiers;
<paramref> Reference an entry parameter elsewhere
<paramref cref=”a”>Please note that this is an integer parameter</paramref>
four. Configuration
4.1 Doxygen working directory
Please choose oneExisting folders with non-Chinese paths,As shown below:
4.2 Wizard
4.2.1 Project
4.2.2 Mode mode
4.2.3 Output
Remove the hook of With search function
Plain HTML, as the first picture below, with navigation panel as the second picture below
4.2.4 Diagrams
(Use built-in class diagram generator) will use the built-in generation function to generate the class diagram of each class, only one class is not generated.
If you need larger functions such as class inheritance system diagram, please select the third item (Use dot tool from the GraphViz package) to install GraphViz.
4.3 Export
4.3.1 Project Project
OUTPUT_LANGUAGE select chinese TAB_SIZE is the length of Tab
4.3.2 Build
The default is to generate a public method, here also select EXTRACT_ALL. It guarantees to output all public methods and project methods, EXTRACT_STATIC is to generate static methods.
4.3.3 Input
Input is the input directory and supports multiple directories. We can put in the project directory and the include directory. The Exclude below ignores directories and files and can be added by yourself.
4.3.4 Index
Select ALPHABETICAL_INDEX, there will be a combination type index entry in the class.
The generated index is shown below
4.3.5 HTML
If you have previously selected (prepare form compressed HTML(.chm)), the GENERATE_HTMLHELP item will be selected, and the CHM_FILE below it will fill in the name of your CHM document (To add .chm). HHC_LOCATION selects the HHC program under your HTML Help WorkShop installation directory, usually in C:/Program Files (x86)/HTML Help Workshop/hhc.exe. Select TOC_EXPAND will generate the tree directory on the left.
4.3.6 Dot
If you choose the built-in generation function (Use build-in class diagram generator), CLASS_DIAGRAMS will be in the selected state, and HAV_DOT will be in the unselected state. If you choose to use the GraphViz dot tool to generate (Use dot tool from the GraphViz package) On the contrary, please choose CLASS_DIAGRAMS. At this time, you need to set the following DOT_PATH to the installation directory of GraphViz, otherwise it will not be generated.
In addition, if the following options are selected, the corresponding graph will be generated;
CLASS_GRAPHS Class diagram
COLLABORATION_GRAPH Collaboration graph
GROUP_GRAPHS Group picture
UML_LOOK Is it UML appearance?
INCLUDE_GRAPH include
INCLUDED BY GRAPH is included
CALL_GRAPH Call
CALLER_GRAPH is called
DIRECTORY_GRAPH Table of Contents
GRAPHICAL_HIERARCHY Inheritance system diagram
Five.Run
After configuration, enter the Run tab and clickRun Doxygen Start to generate, wait for the generation to complete and click "Show HTML output”
6. HTML renderings
Seven. CHM renderings
Share my Doxygen configuration file:
8. Reminder
To remind, if it is a WIN8 operating system, it is recommended to set dot compatibility and run as an administrator, otherwise a warning box will pop up that dot stops running.
This article is reproduced from Zhao Qingqing's blog, the original link: http://www.cnblogs.com/zhaoqingqing/p/3842236.html, please contact the original author if you need to reprint