Question

I've got some C# documentation comments that looks like this:

/// <para>
/// Pre-Conditions:
/// </para>
/// <para>
///     1. The sky must be clear.
/// </para>
/// <para>
///     2. It must be night time.
/// </para>
/// <para>
/// Post-Conditions:
/// </para>
/// <para>
///     1. A picture of the sky will be saved.
/// </para>
/// <para>
///     2. Some second thing will be true that I can't think of.
/// </para>
/// <para>
/// Invariants:
/// </para>
/// <para>
///     1. Existing pictures will not be changed.
/// </para>
void TakePictureOfStars();

I made everything its own paragraph so it shows up correctly when I use the mouse-over tool tips in Visual Studio.

I used Doxygen to generate the comments, but I keep getting the following HTML:

<ol type="1">
    <li>The sky must be clear.</li>
</ol>
<ol type="1">
    <li>It must be night time.</li>
</ol>

That looks like this:

1. The sky must be clear.

1. It must be night time.

So, here's the question: how can I get each numbered item to show up on its own line in the Visual Studio tool tip AND get an ordered list in my code output?

Was it helpful?

Solution

Setting MARKDOWN_SUPPORT to NO will avoid that 1. 2. 3. markers are treated as ordered lists.

To preserve spaces you could use <pre> and </pre>:

/// <para><pre>
/// Pre-Conditions:
/// </pre></para>
/// <para><pre>
///     1. The sky must be clear.
/// </pre></para>
/// <para><pre>
///     2. It must be night time.
///        a. half moon
///        b. full moon
/// </pre></para>   
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top