VS Code中使用Doxygen

VS Code中使用Doxygen

安装Doxygen

树梅派中可直接在Add Softwares中搜索Doxygen
安装之后的Doxygen路径为/usr/bin/doxygen

安装Doxygen插件

在VS Code插件中搜索Doxygen,找到Doxygen Runner,并安装。这个插件用于从doxyfile生成代码说明文档。
找到Doxygen Documentation Generator并安装,这个插件用于快速生成doxygen的注释,只需要在相关代码前面输入/**,就会自动填补doxygen注释,非常方便。

生成Doxyfile

生成默认选项的doxyfile:Creating a Doxyfile

doxygen -g 

The INPUT option (line 746): put “…/src” as the input (put it, without the quotes, after the equals sign). This tells Doxygen which files to process.
The GENERATE_LATEX option (line 1,543): change “YES” to “NO”. We want HTML output (which is already set to yes), but we don’t want LaTeX output.
The EXTRACT_ALL option (line 401): set to “YES”. This will cause Doxygen to create documentation for all the members in our file, including our average() function.
The PAPER_TYPE option (line 1,586): set to “letter”. We don’t use A4 paper size.
The GENERATE_RTF option (line 1,690): set to “YES”. This will generate a rich text format (rtf) version of the documentation, which we can load into our favorite word processor.
The OUTPUT_DIRECTORY option (line 61): set to “doc/”. This will cause all the created files to be in the doc/ sub-directory, and this is necessary for us to find your files.
The PROJECT_NAME option (line 35): set to “PDR Lab 11”; note that this is the only option (of the ones we are seeing here) that should have double quotes around it. This creates the appropriate title for the created documentation.
You may want to set the QUIET option (line 686) to “YES”

生成Doxygen说明文档

使用如下命令对这个doxyfile更新,

doxyfile -u

doxyfile定义了文件输出的路径,如果路径不存在会报错,因此提前建立好这个路径,
OUTPUT_DIRECTORY = ../docs/doxygen
在VS Code中可能有多个package,每个package里都有各自的doxyfile,需要在VS Code中打开要使用的那个doxyfile。
在VS Code中调出命令框ctrl+shift+P,输入doxygen,会提示出两个命令,选择

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值