Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2182|回复: 4
打印 上一主题 下一主题

Doxygen 注释转文档

[复制链接]

1272

主题

2067

帖子

7962

积分

认证用户组

Rank: 5Rank: 5

积分
7962
跳转到指定楼层
楼主
发表于 2019-12-31 12:18:35 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Qter 于 2020-2-11 19:16 编辑

Doxygen是一种开源跨平台的http://www.stack.nl/~dimitri/doxygen/index.html
https://sourceforge.net/projects/doxygen/

http://www.doxygen.nl/index.html
doxygen-1.8.17-setup.exe (47.2MB)    ---这个才有界面doxywizard
This is a self-installing archive that includes the HTML and compressed HTML versions of the manual and the GUI frontend. It bundles 32-bit and 64-bit versions of doxygen.exe, and will install the right one based on the OS.
If you are allergic to installers and GUIs, haven't sufficient bandwidth, or don't have administrator priviledges you can also download the32-bit doxygen binary in a zip (18.3MB) or the 64-bit version (22.3MB).



graphviz
http://www.graphviz.org/
Graphviz is open source graph visualization software.
msiexec /a graphviz-x.xx.msi









回复

使用道具 举报

1272

主题

2067

帖子

7962

积分

认证用户组

Rank: 5Rank: 5

积分
7962
沙发
 楼主| 发表于 2019-12-31 17:33:00 | 只看该作者
Doxygen是一种开源跨平台的,以类似JavaDoc风格描述的文档系统,完全支持C、C++、Java、Objective-C和IDL语言,部分支持PHP、C#。
注释的语法与Qt-Doc、KDoc和JavaDoc兼容。Doxgen可以从一套归档源文件开始,生成HTML格式的在线类浏览器,或离线的LATEX、RTF参考手册。

http://www.stack.nl/~dimitri/doxygen/index.html
回复 支持 反对

使用道具 举报

1272

主题

2067

帖子

7962

积分

认证用户组

Rank: 5Rank: 5

积分
7962
板凳
 楼主| 发表于 2020-2-3 11:18:12 | 只看该作者
本帖最后由 Qter 于 2020-2-3 11:39 编辑

http://www.doxygen.nl/download.html
GIT repository
[size=13.3333px]The GIT repository for doxygen is hosted on GitHub. In this repository you can be find the latest "bleeding edge" version of doxygen.
[size=13.3333px]If you have the necessary build tools installed (i.e. g++, python, cmake, flex, bison), you should do the following to get the initial copy of the repository:
git clone https://github.com/doxygen/doxygen.gitcd doxygen[size=13.3333px]After that you can usemkdir buildcd buildcmake -G "Unix Makefiles" ..make[size=13.3333px]To force a fresh build after an earlier check-out simple remove the build directory and redo the steps above.
[size=13.3333px]After the binaries have been built, you can use
make install[size=13.3333px]to install them.
[size=13.3333px]Public access to the GIT repository is read-only at the moment. So it is not possible to directly commit changes. Instead you can clone the repository, make you changes and create a pull request to notify me. I'll review the changes and include them (assuming they are correct and relevant).

GIT binaries[size=13.3333px]Windows binaries[size=13.3333px] for the latest tagged releases are sometimes available as well.

Sources and Binaries
Latest release
[size=13.3333px]The latest version of doxygen is 1.8.17 (release date December 27th 2019).
[size=13.3333px]The source distribution
[size=13.3333px]doxygen-1.8.17.src.tar.gz (4.9MB)
[size=13.3333px]A binary distribution for Linux x86-64
[size=13.3333px]doxygen-1.8.17.linux.bin.tar.gz (42.6MB)
Compiled using Ubuntu 16.04 with kernel 4.4.0 and gcc 5.4.0 and statically linked again libclang. This archive includes the HTML version of the manual, but not the GUI frontend.

[size=13.3333px]A binary distribution for Windows. All versions of Windows since Vista are supported.
[size=13.3333px]doxygen-1.8.17-setup.exe (47.2MB)
This is a self-installing archive that includes the HTML and compressed HTML versions of the manual and the GUI frontend. It bundles 32-bit and 64-bit versions of doxygen.exe, and will install the right one based on the OS.
If you are allergic to installers and GUIs, haven't sufficient bandwidth, or don't have administrator priviledges you can also download the32-bit doxygen binary in a zip (18.3MB) or the 64-bit version (22.3MB).

[size=13.3333px]A binary distribution for Mac OS X 10.9 and later
[size=13.3333px]Doxygen-1.8.17.dmg (126.0MB)
This is a self-contained disk image, which contains the GUI frontend. The binaries support the whole range of Intel CPUs (both 32 and 64 bit).

[size=13.3333px]Alternatively you can download the files from SourceForge.
[size=13.3333px]See the change log to find out what has changed. If you want to be informed about new releases fill in your email address in the form at the top of this page.



Download Manual
The documentation for release 1.8.17A hyperlinked PDF version of the documentationdoxygen_manual-1.8.17.pdf.zip (1.3MB)
A compiled HTML version of the documentationdoxygen_manual-1.8.17.chm.zip (3.5MB)


链接:https://pan.baidu.com/s/1riRKy1q00ueO_ss27HbPog
提取码:zifg

回复 支持 反对

使用道具 举报

1272

主题

2067

帖子

7962

积分

认证用户组

Rank: 5Rank: 5

积分
7962
地板
 楼主| 发表于 2020-2-11 21:19:34 | 只看该作者
本帖最后由 Qter 于 2020-2-14 17:36 编辑

1)工具下载及安装;2)编写Doxygen可识别的注释;3)利用Doxygen工具将注释转换成API文档。

1、工具下载及安装

  (1)Doxygen可以从一套源文件开始,生成HTML格式的在线类浏览器。笔者采用的版本是Doxygen1.8.9.1

  (2)Microsoft HTML Help Workshop是微软开发,用于本工程创建*.chm文件,笔者上官网下载最新的htmlhelp

  (3)Graphviz用于配合doxygen使用,提取函数之间、头文件之间的调用关系,笔者使用的版本是graphviz-2.38.


链接:https://pan.baidu.com/s/1riRKy1q00ueO_ss27HbPog
提取码:zifg


 2、编写Doxygen可识别的注释


https://www.cnblogs.com/fkpj/p/4537145.html

https://www.cnblogs.com/silencehuan/p/11169084.html


  一、文件注释,放于文件的开头

放在#ifndef前

  1. <font color="rgb(77, 77, 77)"><font face="&quot;"><font style="font-size: 16px">/**
  2. * @file         filename
  3. * @brief        This is a brief description.
  4. * @details  This is the detail description.
  5. * @author       author
  6. * @date     date
  7. * @version  A001
  8. * @par Copyright (c):  
  9. *       XXX公司
  10. * @par History:         
  11. *   version: author, date, desc\n
  12. */  </font></font></font>
复制代码
二、函数注释,放于函数声明前
  1. <font color="rgb(77, 77, 77)"><font face="&quot;"><font style="font-size: 16px">/**
  2. * This is a brief description.
  3. * This is a detail description.
  4. * @param[in]   inArgName input argument description.
  5. * @param[out]  outArgName output argument description.  
  6. * @retval  OK  成功
  7. * @retval  ERROR   错误  
  8. * @par 标识符
  9. *      保留
  10. * @par 其它
  11. *      无
  12. * @par 修改日志
  13. *      XXX于201X-XX-XX创建
  14. */  </font></font></font>
复制代码
三、数据结构注释,放于数据结构定义前
  1. <font color="rgb(77, 77, 77)"><font face="&quot;"><font style="font-size: 16px">/**
  2. * The brief description.
  3. * The detail description.
  4. */  
  5. typedef struct  
  6. {  
  7.     int var1;///<Description of the member variable  
  8. }XXXX;  </font></font></font>
复制代码
四、宏定义注释,放于宏定义上方或者右侧
  1. <font color="rgb(77, 77, 77)"><font face="&quot;"><font style="font-size: 16px">/** Description of the macro */  
  2. #define XXXX_XXX_XX     0  </font></font></font>
复制代码
或者
  1. <font color="rgb(77, 77, 77)"><font face="&quot;"><font style="font-size: 16px">#define XXXX_XXX_XX     0 ///< Description of the macro.  </font></font></font>
复制代码
五、全局和静态变量注释
  1. <font color="rgb(77, 77, 77)"><font face="&quot;"><font style="font-size: 16px">/**  Description of global variable  */  
  2. int g_xxx = 0;  
  3.   
  4. static int s_xxx = 0; ///<  Description of static variable  </font></font></font>
复制代码
https://blog.51cto.com/ticktick/188674
3、利用Doxygen工具将注释转换成API文档
分成九步:1、工程配置;2、模式配置;3、输出配置;4、调用图配置;5、字符集配置;6、输入字符集配置;7、chm配置;8、Grapviz配置;9、执行Doxygen。
https://www.cnblogs.com/peterYong/p/6556705.htmlhttps://www.cnblogs.com/fkpj/p/4537145.html

1、工程配置;

  2、模式配置;

  3、输出配置;

  4、调用图配置;


  5、字符集配置;


  6、输入字符集配置;

  7、chm配置;

  8、Grapviz配置;

  9、执行Doxygen

  完成上述操作之后,就能生成如下API文档

  

https://blog.csdn.net/HIVAN1/article/details/82996847


https://mp.weixin.qq.com/s?__biz ... 9&lang=zh_CN#rd


回复 支持 反对

使用道具 举报

1272

主题

2067

帖子

7962

积分

认证用户组

Rank: 5Rank: 5

积分
7962
5#
 楼主| 发表于 2020-2-13 00:11:57 | 只看该作者
Expert->HTML  HTML_DYNAMIC_MENUS
  1. HTML_DYNAMIC_MENUS

  2. If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML documentation will contain a main index with vertical navigation menus that are dynamically created via JavaScript. If disabled, the navigation index will consists of multiple levels of tabs that are statically embedded in every HTML page. Disable this option to support browsers that do not have JavaScript, like the Qt help browser.

  3. The default value is: YES.

  4. This tag requires that the tag GENERATE_HTML is set to YES.
复制代码
选中这个后,在源码里添加枚举类型,生成的chm会报如下错误:
  1. mk:@MSITStore:F:\github\chunhuitech\ccppqt\Doxygen\html\MyTestPros.chm::/jquery.js
复制代码




回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-11-26 05:00 , Processed in 0.070257 second(s), 21 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表