• 如何使用Doxygen生成keil工程的代码文档 (how to use doxygen properly with keil)


    书接上文,Doxygen生成美丽注释文档(1):初体验

    已经体验过使用Doxygen,以注释的方式,同时生成代码文档。

    那么对于使用Keil开发单片机程序的话,是否可以集成到Keil软件中使用Doxygen呢。

    通过查看ARM官网,找到了相应的方法,如下图所示。(小知识:2011年,Keil软件公司被ARM公司收购,Keil公司资产总额为450万美元。)

    具体方式如下:

    1. 安装Doxygen和graphviz(见前文博客)

    2. 打开Keil的 Tool -> Customize Tools Menu...

    3. 添加一个名为 Doxygen : Make Template 的工具栏实体。在此项目中:

      * Command : 填写doxygen.exe程序的绝对路径名称

      * Arguments: 填写 -g @p.doxyfile

    4. 添加一个名为 Doxygen : Generate Documentation 的工具栏实体。在此项目中:

      * Command: 填写doxygen.exe程序的绝对路径名称

      * Arguments: 填写 @p.doxyfile

    步骤3中 -g 是生成doxyfile文档,同doxygen的命令行中帮助内容的1),@p 指代工程名称 ,@p.xxxx 后缀名可以任意内容,但是要保持两个工具栏实体的配置文件名称相同

    步骤4中 Arguments 为 @p.doxyfile 表示使用配置文件,生成代码文档,同doxygen命令行中帮助内容的3)

    C:Users>doxygen /? # 帮助
    error: configuration file /? not found!
    Doxygen version 1.8.14
    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
    
    C:Users>

    上述2,3,4步骤操作如下图:

     使用演示如下:

    1.  打开一个工程

    2. 使用 Tools - Doxygen: Make Template 生成一个配置文件,文件生成路径为uv5文件的路径,名称是工程名称,后缀是.doxyfile

    3. 添加这个配置文件 projectName.doxyfile 到工程项目中,打开文件,按照 官网的配置文件说明 配置相关参数。

    4. 使用 Tools - Doxygen: Make Documetation 生成文档。

    参考文献

    [1]. ARM Information Center

    [2]. Doxygen Manual: Configuration

     

  • 相关阅读:
    placement new小结
    template template parameter 模板模板参数
    windows下创建和删除软链接
    gcc下载地址
    map的erase函数小结
    typedef函数指针
    宏定义条件编译中使用多条件
    关于c++模板特例化测试
    tolua使用
    c++多态
  • 原文地址:https://www.cnblogs.com/yqmcu/p/11498081.html
Copyright © 2020-2023  润新知