社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
Doxygen是一款文档生成工具,它可以从代码中提取出相应的文档,并组织,输出成各种漂亮的文档(如HTML,PDF,RTF等),doxygen让你变成一位有品位的程序猿。
1. 安装doxygen工具
$git clone https://github.com/doxygen/doxygen.git
$cd doxygen
$mkdir build
$cd build
$cmake -G "Unix Makefiles" ..
$make
#ubuntu中需要用sudo,否则安装没有用户权限
$sudo make install
2. 修改我们之前的代码wheel_messg.h文件 代码仓库地址: https://github.com/yangang123/cpp_test/tree/doxygen/orb_sim
#ifndef _WHEEL_MESG_H
#define _WHEEL_MESG_H
#include <stdint.h>
#include <stdbool.h>
typedef struct {
bool val;
}wheel_mesg_s;
void wheel_orb_publish(wheel_mesg_s *msg);
void wheel_orb_check(bool *update);
void wheel_orb_copy(wheel_mesg_s *msg);
#endif /* _WHEEL_MESG_H */
//***************************************************************************************
//
//! file wheel_mesg.h
//! 实现转轮消息的发送和接收
//!
//! author yangang
//! version V1.0
//! date 2018-04-23
//! copyright GNU Public License V3.0
//
//**************************************************************************************
#ifndef _WHEEL_MESG_H
#define _WHEEL_MESG_H
#include <stdint.h>
#include <stdbool.h>
/*!
* Base object class.
*/
typedef struct {
bool val; /*!< an bool value */
}wheel_mesg_s;
//***************************************************************************************
//
//! brief 消息发布
//!
//! param wheel_mesg_s *msg:消息.
//! retval none.
//!
//! note
//
//***************************************************************************************
void wheel_orb_publish(wheel_mesg_s *msg);
//***************************************************************************************
//
//! brief 消息检测
//!
//! param bool *update : 是否更新.
//! retval none.
//!
//! note
//
//***************************************************************************************
void wheel_orb_check(bool *update);
//***************************************************************************************
//
//! brief 消息拷贝
//!
//! param none.
//! retval none.
//!
//! note
//
//***************************************************************************************
void wheel_orb_copy(wheel_mesg_s *msg);
#endif /* _WHEEL_MESG_H */
3. 使用doxygen生成html文件
doxygen -g
doxygen Doxyfile
4. 在html文件夹中找到index文件
4. 生成的网页是
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!