如何为xml文件注释生成doxygen文档? [英] How to generate doxygen documentation for xml files comments?

查看:245
本文介绍了如何为xml文件注释生成doxygen文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的项目是C ++应用程序。该文档是用doxygen生成的,并且注释的格式也相应。

该项目还包括几个带有注释的xml资源文件。我想将它们包括在文档中。



这是我想做的事情的图示:



输入(应用程序使用的文件) ,myFile.xml):

My current project is a C++ application. The documentation is generated with doxygen, and comments are formatted accordingly.
The project also includes several xml resource files, with comments. I would like to include them in the documentation.

Here is an illustration of the kind of thing I would like to do :

Input (file used by my application, myFile.xml):

<!-- 
@brief settings used by class MyClass at startup
@image html screenshot_default.jpg
-->
<Myclass_settings id="default_setting">
  <param_1 value="1"/>
  <param_2 value="XXXXX"/>
</Myclass_settings>

<!-- 
@brief settings used by class MyClass - reserved to experienced users
@image html screenshot_advanced.jpg
-->
<Myclass_settings id="advanced_setting">
  <param_1 value="42"/>
  <param_2 value="WWWWW"/>
</Myclass_settings>



输出(由doxygen生成的文档):


Output (documentation generated by doxygen):

myFile.xml File Reference
    Elements
        default_setting    
            settings used by class MyClass at startup
            [here screenshot_default is inserted]
        advanced_setting   
            settings used by class MyClass - reserved to experienced users      
            [here screenshot_advanced is inserted]



我应该如何编写注释以及需要哪些双氧水设置?


How should I write the comments, and which doxygen settings do I need ?

推荐答案

AFAIK doxygen不支持记录XML文件。

AFAIK doxygen does not have support for documenting XML files.

我想做的最简单的事情是编写一个其他文档文件,如问题/答案
中所述Doxygen中的自定义文件如何使用Doxygen制作简介页面。在此文件中,您可以将输入XML文件的预期格式记录为单独的页面(使用 \页面 命令)。然后,该页面将显示在生成的文档的相关页面选项卡下。该文件将类似于(请注意使用C / C ++样式注释):

The easiest thing I can think to do is to write an additional documentation file, as discussed in the question/answers How to include custom files in Doxygen and How to make an introduction page with Doxygen. In this file you can document the expected form of your input XML file as a separate page (using the \page command). This page will then appear under the Related Pages tab of your generated documentation. The file will look something like (note the use of C/C++ style comments):

/* \page input_xml_page myFile.xml File Reference

\section elements Elements

Some preliminary discussion of the file goes here...

You can refer to both the default \ref default_settings and advanced settings
\ref default_settings sections like this.

\subsection default_settings Default settings

Settings used by class MyClass at startup
\image html screenshot_default.jpg

\subsection advanced_settings Advanced settings

Settings used by class MyClass - reserved to experienced users
\image html screenshot_advanced.jpg

*/

不幸的是,此方法将您的文档与XML文件分开。

Unfortunately this method separates your documentation from your XML file.

其他工具可能会做您想要的。例如,请参阅以下问题:
可以使用Doxygen,Sandcastle或其他文档生成器来记录XML吗?

Alternatively, other tools may do what you want. See for example this question: Can XML be documented using Doxygen, Sandcastle, or other documentation generators?

这篇关于如何为xml文件注释生成doxygen文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆