vs.net下doxygen的设置与使用

doxygen的windows平台下的安装文件有大约5M左右,可到以下地址下载。
下载地址: http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc
下载后安装完毕即可使用命令行方式或wizard产生注释文档
---------------------------------------------------------------------------------------------------------------
vs.net的集合:(可参考codeproject文章10 Minutes to document your code)
在vs.net“工具”菜单下添加外部工具“生成文档“,参数如下:
命令:   c:/program files/doxygen/bin/doxygen.exe (即doxygen的安装目录)
命令参数: $(ProjectDir)/default.doxygen
初始目录: $(ProjectDir)
选中"使用输出窗口",使doxygen的输出在vs.net 的输出窗中显示。
同时拷贝default.doxygen到工作的工程目录下($(projectdir))。
根据需要可以打开修改。
使用前面的“生成文档”工具可以给工程产生html类型的文档注释,同时产生.hhp类型的html help文档的项目文件.
同时安装HTML help workshop,可以在外部工具添加一个新项目,直接调用html help workshop的主执行文件,参数
传入生成的*.hhp文件,即可直接调用编译出chm的注释文件了。
添加外部工具,用windows目录下的 hh.exe命令可以启动浏览chm文件,这样就可以不离开vs.net开发环境来完成文档的
生成与查看了。
另外:
1.doxygen不支持vs.net中的solution概念,需要拷贝default.doxygen到具体的工程目录下。
2.vs.net中的宏定义$(projectdir)有问题,直接传给html help workshop 的参数多个引号,可手工删除。
3.我编辑的一些符合doxygen注释风格的常用宏:
    Sub 函数注释()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "//!"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/*!"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Indent()
        DTE.ActiveDocument.Selection.Text = "/param"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/param"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/return"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/sa "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "*/"
        DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
        DTE.ActiveDocument.Selection.DeleteLeft()
    End Sub
    Sub 变量注释()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "//!"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
        DTE.ActiveDocument.Selection.DeleteLeft()
    End Sub
    Sub 文件注释()
        DTE.ActiveDocument.Selection.Text = "/** /file " + DTE.ActiveDocument.Name + " 版权所有 (c) 2000-2004 , 我的公司"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Indent()
        DTE.ActiveDocument.Selection.Text = "/n 文件名称 :   " + DTE.ActiveDocument.Name
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/n 功能描述 :   "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/author         我的大名   "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/n 历史信息 :   第一版  " + Date.Now
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.DeleteLeft()
        DTE.ActiveDocument.Selection.Text = "*/"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
    End Sub
    Sub 变量详细注释()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "//!"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/*!"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Indent()
        DTE.ActiveDocument.Selection.Text = "*/"
        DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
        DTE.ActiveDocument.Selection.DeleteLeft()
    End Sub
Doxygen 中文使用文档 及 适合Doxygen的注释宏 使注释更简单 统一 注释宏 已经过修改 使用简单方便 Doxygen 是一个程序的文件产生工具,可将程序中的特定批注转换成为说明文件。通常我们在写程序时,或多或少都会写上批注,但是对于其它人而言,要直接探索程序里的批注,打捞铁达尼号同样的辛苦。大部分有用的批注都是属于针对函式,类别等等的说明。所以,如果能依据程序本身的结构,将批注经过处理重新整理成为一个纯粹的参考手册,对于后面利用您的程序代码的人而言将会减少许多的负担。不过,反过来说,整理文件的工作对于您来说,就是沉重的负担。   对于未归档的源文件,也可以通过配置Doxygen来提取代码结构。或者借助自动生成的包含依赖图(includedependency graphs)、继承图(inheritance diagram)以及协作图(collaborationdiagram)来可视化文档之间的关系。Doxygen生成的帮助文档的格式可以是CHM、RTF、PostScript、PDF、HTML和Unixman page等。   一个好的程序设计师,在写程序时,都会在适当的地方加上合适的批注。如果,能够在撰写批注时,稍微符合某种格式,接着就可以透过一个工具程序依据程序结构及您的批注产生出漂亮的文件。这将令许多工作繁重的程序设计师有时间多喝几杯咖啡。   Doxygen 就是这样的一个工具。在您写批注时,稍微按照一些它所制订的规则。接着,他就可以帮您产生出漂亮的文件了。因此,Doxygen使用可分为两大部分。首先是特定格式的批注撰写,第二便是利用Doxygen工具来产生文件。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值