Code blocks in doxygen are rendered as literal blocks without syntax highlighting. The reason is, that the doxygen XML output does not contain information about the used code domain.
The example code
bool myFunction(int parameter)
{
if (parameter > 0)
{
return false;
}
return true;
}
produces the following XML output
<para><programlisting><codeline><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>myFunction(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>parameter)</highlight></codeline>
<codeline><highlight class="normal">{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(parameter<sp/>><sp/>0)</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
<codeline><highlight class="normal">}</highlight></codeline>
</programlisting></para>
The problem could be probably solved by using embedded rst but at the price of not having links to documented items.
Code blocks in doxygen are rendered as literal blocks without syntax highlighting. The reason is, that the doxygen XML output does not contain information about the used code domain.
The example code
produces the following XML output
The problem could be probably solved by using embedded rst but at the price of not having links to documented items.