ubuntu上doxygen通过源代码生成文档

本文介绍了在Ubuntu系统上如何安装Doxygen,使用它来从C++等语言的源代码生成文档,并将生成的HTML文档部署到Nginx文件服务器进行查看。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ubuntu上doxygen通过源代码生成文档

工具安装

$ apt-cache search doxygen | grep doxygen
doxygen - Documentation system for C, C++, Java, Python and other languages
...

$ apt install -y doxygen
...

doxygen说明

$ doxygen --help
Doxygen version 1.8.13
Copyright Dimitri van Heesch 1997-2015

You can use doxygen in a number of ways:

1) Use doxygen to generate a template configuration file:
    doxygen [-s] -g [configName]

    If - is used for configName doxygen will write to standard output.

2) Use doxygen to update an old configuration file:
    doxygen [-s] -u [configName]

3) Use doxygen to generate documentation using an existing configuration file:
    doxygen [configName]

    If - is used for configName doxygen will read from standard input.

4) Use doxygen to generate a template file controlling the layout of the
   generated documentation:
    doxygen -l [layoutFileName.xml]

5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.
    RTF:        doxygen -w rtf styleSheetFile
    HTML:       doxygen -w html headerFile footerFile styleSheetFile [configFile]
    LaTeX:      doxygen -w latex headerFile footerFile styleSheetFile [configFile]

6) Use doxygen to generate a rtf extensions file
    RTF:   doxygen -e rtf extensionsFile

If -s is specified the comments of the configuration items in the config file will be omitted.
If configName is omitted `Doxyfile' will be used as a default.

-v print version string

百度翻译一下

$doxygen--帮助

Doxygen 1.8.13版
版权所有Dimitri van Heesch 1997-2015
您可以通过多种方式使用doxygen:

1) 使用doxygen生成模板配置文件:
doxygen[-s]-g[configName]
如果-用于configName,doxygen将写入标准输出。

2) 使用doxygen更新旧配置文件:
doxygen[-s]-u[configName]

3) 使用doxygen使用现有配置文件生成文档:
doxygen[configName]
如果-用于configName,则doxygen将从标准输入中读取。

4) 使用doxygen生成控制
生成的文档:
doxygen-l[layoutFileName.xml]

5) 使用doxygen为RTF、HTML或Latex生成模板样式表文件。
RTF:doxygen-w RTF样式表文件
HTML:doxygen-w HTML headerFile footerFile styleSheetFile[configFile]
LaTeX:doxygen-w乳胶头文件页脚文件样式表文件[configFile]

6) 使用doxygen生成rtf扩展名文件
RTF:doxygen-e RTF扩展名文件

如果指定了-s,则将省略配置文件中配置项的注释。
如果省略configName,则默认使用“Doxyfile”。

-v打印版本字符串

生成文档

一些需要自己编译的库,会准备好doxyfile文件,直接使用就可生辰文档。

doxygen DoxyFile

安装一个文件服务器

笔者使用nginx为例子

apt install -y nginx

将生成的html拷贝到文件服务器目录

cp /root/workspace/libpqxx-6.4.8/doc/html/Reference /var/www/html/libpqxx -r

打开网址即可查看文档
http://192.168.1.41/libpqxx/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值