C++文档生成工具doxys详解
Doxys是基于Doxygen 1.3.3的一款C++文档生成工具(注意,这并不代表它需要Doxgen的支持)
支持成员模板,模板特化(Doxygen不支持模板),风格更加C++,支持中文。
点击该文章的PDF版本
[需要的工具]
Doxys 0.95
本站下载
官网下载
HTML Help Workshop(非必须,用来生成CHM文档)
安装Visual Studio会带这个,比较大,不好上传,自己去找吧
Graphviz(非必须,用来生成图形)
下载地址
这个版本是2.12的官方版本,我用的居然是2.8不知道怎么回事
效果图

官方截图
使用方法
1.放置文件到一个文件夹下,双击运行在同一目录下得到配置文件
2.修改配置文件。doxys并不像doxygen一样附带了图形的配置程序(至少我没看到),要手动修改。
3.运行->CMD,切换到doxys所在路径,然后输入”doxys”(不包含引号),回车
4.文档就生成好了,当前目录下生成了一个doxys_docs目录,双击index.html文件
修改配置的详情:
“INPUT = “后填源文件所在的地方,这个最重要,要不然给谁生成文档啊…
“PROJECT_NAME”代表工程名
暂时有这些就够了,配置并不如doxygen多

进一步制作文档
1.生成chm文件
把”GENERATE_HTMLHELP1″的值改为YES

重新生成一次,当前目录下会得到扩展名为hhp的文件,如果已经安装”HTML Help WorkShop”,双击打开,File->compile编译得到chm文件
2.生成图(包括类图,包含关系图等)
安装graphviz工具,修改doxys的配置文件doxysfile,在”DOT_PATH”一栏填入graphviz程序的安装地址(注意,一定要填到”\bin”那一层。再次生成文档

注意:
1.我的代码(证明支持模板)
/// template class, tested by yaker template <typename T> class TestDoxys { public: /// member template, if it can, i appreciate template<typename X> TestDoxys(X begin, X end) { vt_(begin, end); } void DoSth(); private: std::vector<T> vt_; }; ///template function template <typename T> void TestDoxys<T>::DoSth() { std::cout << vt_[0]; << std::endl; } /// template specialization, my god, doxys even support it template<> class TestDoxys<double> { void Dosth() { std::cout << "double" << std::endl; } };
2.statics的说明
生成html页面时会生成stastics页面,统计注释率以及未注释文件。但是生成chm文件时并不会被添加进去,手动修改一下hhp文件即可。
附官方简要介绍:
DoxyS, an advanced C++ documentation tool.
DoxyS is a code documentation tool for C++/C. DoxyS strives to yield a very professional looking output, presenting the the code in a structured easy to navigate set of HTML pages. Easy to use: Just navigate to the root of your code directory and type doxys.
Currently it runs on Windows and Linux, but should be quite portable.
Main features
* Generated output reflects the code directory structure.
* Layers of abstraction with heavy use of overview tables providing names and brief descriptions of classes, functions etc. Inspired by Microsoft documentation.
* Wiki like syntax for writing directory level documentation and related documentation pages or even design documents.
See all the features as well as the vision behind DoxyS on the Features page.
http://www.doxys.dk/doxys_homepage/index.html
Recent Comments