如何在 Doxygen 中的注释中添加空格

发布于 2024-12-01 08:27:34 字数 963 浏览 0 评论 0原文

我想知道有没有办法在 Doxygen 的 html 注释中插入空格?我在网上搜索了 Doxygen 手册,但找不到任何可以做到这一点的东西。

例如,我尝试添加如下注释:

//!   motor_id,          motor direction,   accel,     min veloc,     max veloc\n
//!   GAUGE_MOTOR_1,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_2,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_3,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_4,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_5,     CLOCKWISE,         400,       200,           350\n

但是 html 输出显示的结果是这样的

motor_id, motor direction, accel, min veloc, max veloc
GAUGE_MOTOR_1, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_2, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_3, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_4, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_5, CLOCKWISE, 400, 200, 350

两个单词之间的空格将被 doxygen 自动缩小为一个空格。有人知道如何解决这个问题吗?这会有很大帮助。

非常感谢。

I was wondering is there any way to insert white space in the comment in html of Doxygen? I searched online and Doxygen manual, but I couldn't find anything to do that.

For example, I am trying to add comment as following:

//!   motor_id,          motor direction,   accel,     min veloc,     max veloc\n
//!   GAUGE_MOTOR_1,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_2,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_3,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_4,     CLOCKWISE,         100,       1,             360\n
//!   GAUGE_MOTOR_5,     CLOCKWISE,         400,       200,           350\n

But the html output shows the result like this

motor_id, motor direction, accel, min veloc, max veloc
GAUGE_MOTOR_1, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_2, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_3, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_4, CLOCKWISE, 100, 1, 360
GAUGE_MOTOR_5, CLOCKWISE, 400, 200, 350

The white space between two words will be shrinked to one space by doxygen automatically. Is there anybody know how to fix this? That will help a lot.

Thank you very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风尘浪孓 2024-12-08 08:27:34

您可以使用

//! <pre>
//!   motor_id,          motor direction,   accel,     min veloc,     max veloc
//!   GAUGE_MOTOR_1,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_2,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_3,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_4,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_5,     CLOCKWISE,         400,       200,           350
//! </pre>

//! \verbatim
//!   motor_id,          motor direction,   accel,     min veloc,     max veloc
//!   GAUGE_MOTOR_1,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_2,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_3,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_4,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_5,     CLOCKWISE,         400,       200,           350
//! \endverbatim

后者将真正按原样显示文本。
前者仍然会让 doxygen 解释块内的命令,同时保留空格。

You can use either

//! <pre>
//!   motor_id,          motor direction,   accel,     min veloc,     max veloc
//!   GAUGE_MOTOR_1,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_2,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_3,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_4,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_5,     CLOCKWISE,         400,       200,           350
//! </pre>

or

//! \verbatim
//!   motor_id,          motor direction,   accel,     min veloc,     max veloc
//!   GAUGE_MOTOR_1,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_2,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_3,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_4,     CLOCKWISE,         100,       1,             360
//!   GAUGE_MOTOR_5,     CLOCKWISE,         400,       200,           350
//! \endverbatim

The latter will really show the text as-is.
The former will still let doxygen interpret commands inside the block, while preserving spaces.

伤感在游骋 2024-12-08 08:27:34

在这种情况下,我发现使用 HTML 表格并将内容放在单独的文件中很有用。例如,您可以创建一个名为“motors.html”的文件,将其放在 doxygen 配置为查找输入文件的位置,然后使用以下命令将 motors.html 包含到源代码

@htmlinclude motors.html

中 : ,您可以使用以下内容:

<center> 
<table border="0"> 
<tr> 
  <th>motor_id</th> 
  <th>motor direction</th> 
  <th>accel</th> 
  <th>min veloc</th> 
  <th>max veloc</th> 
<tr> 
<tr> 
  <td>GAUGE_MOTOR_1</td> 
  <td>CLOCKWISE</td> 
  <td>100</td> 
  <td>1</td> 
  <td>360</td> 
</tr> 
... 
</table> 
</center> 

您可以使用 CSS 文件来设置表格的样式。

In cases like this, I find it useful to use an HTML table, and put the content in a separate file. For instance, you could create a file named "motors.html", put it in a place where your doxygen is configured to find input files, and then use the following command to include motors.html into your source code:

@htmlinclude motors.html

In motors.html, you could have something along the following lines:

<center> 
<table border="0"> 
<tr> 
  <th>motor_id</th> 
  <th>motor direction</th> 
  <th>accel</th> 
  <th>min veloc</th> 
  <th>max veloc</th> 
<tr> 
<tr> 
  <td>GAUGE_MOTOR_1</td> 
  <td>CLOCKWISE</td> 
  <td>100</td> 
  <td>1</td> 
  <td>360</td> 
</tr> 
... 
</table> 
</center> 

You can use a CSS file to style the table.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文