How to add white space in the comment in 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.
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.
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.
精彩评论