符合doxygen格式的代码注释可以直接通过doxygen命令生成api文档:
# doxygen -h
Doxygen version 1.8.5
Copyright Dimitri van Heesch 1997-2013
You can use doxygen in a number of ways:
1) Use doxygen to generate a template configuration file:
doxygen [-s] -g [configName]
If - is used for configName doxygen will write to standard output.
2) Use doxygen to update an old configuration file:
doxygen [-s] -u [configName]
3) Use doxygen to generate documentation using an existing configuration file:
doxygen [configName]
If - is used for configName doxygen will read from standard input.
4) Use doxygen to generate a template file controlling the layout of the
generated documentation:
doxygen -l layoutFileName.xml
5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.
RTF: doxygen -w rtf styleSheetFile
HTML: doxygen -w html headerFile footerFile styleSheetFile [configFile]
LaTeX: doxygen -w latex headerFile footerFile styleSheetFile [configFile]
6) Use doxygen to generate an rtf extensions file
RTF: doxygen -e rtf extensionsFile
If -s is specified the comments of the configuration items in the config file will be omitted.
If configName is omitted `Doxyfile' will be used as a default.
其支持一下两种常用的style
- Javadoc style
You can use the Javadoc style, which consist of a C-style comment block starting with two *'s, like this:
/**
* ... text ...
*/
- Qt style
or you can use the Qt style and add an exclamation mark (!) after the opening of a C-style comment block, as shown in this example:
/*!
* ... text ...
*/
参考链接:
doxygen