Can I write a doxygen alias similar to @code or @verbatim?

I need an alias to mark the command line code set on a black background with white text for use as follows:

@cmd
C:\temp>echo Hello, world!
Hello, world!

C:\temp>
@endcmd

Regular doxygen aliases cannot do this (multi-line, nested "\ temp"), but @codethey @verbatimcan. However, I cannot use them because they are formatted as a white background with black text, so rewriting the pre.fragment class using special CSS is incorrect.

Any ideas?

UPD : Comments showed how bad my English is ...

OK, try again. Common doxygen functions, such as HTML and XML, work as shown below:

    cpp file                       doxygen produced index.html
/**
@mainpage main               |  
<pre>                        | <pre>C:&gt;echo Hello, world! 
C:\temp>echo Hello, world!   | Hello, world!</pre>  
Hello, world!                |
                             |
C:\temp>                     | <pre>C:&gt;</pre>
</pre>                       |
*/                           |

In the magazine:

/tmp/index.h:3: warning: Found unknown command `\temp'
/tmp/index.h:6: warning: Found unknown command `\temp'

"code" "verbatim" ! :

  cpp file                       doxygen produced index.html
/**
@mainpage main               |
@verbatim                    | <div class="fragment">
C:\temp>echo Hello, world!   | <pre class="fragment">C:\temp&gt;echo Hello, world!
Hello, world!                | Hello, world!
                             |
C:\temp>                     | C:\temp&gt;
@endverbatim                 | </pre>
*/                           | <div>

: , "" "". ?

+5
3

HTML div CSS, Doxygen css. , .

+1

.

- . doxygen:

ALIASES += "mycode=<div class="myfragment"><pre class=myfragment>"
ALIASES += "endmycode=</pre></div>"

\mycode \endmycode. , ++ :

/** \mainpage main
 * \mycode
 * C:\\temp>echo Hello, World!
 * Hello, World!
 *
 * \endmycode
*/

doxygen HTML:

<div class="myfragment>"><pre class="myfragment>">
 C:\temp&gt;echo Hello, World!
 Hello, World!</pre></div>

( , > class="myfragments>"). myfragments CSS.

++, , - escape- \\ .

+1

, , -

ALIASES += cmd="<div class=\"cmd\">@verbatim"
ALIASES += endcmd="@endverbatim</div>"

Where, the CSS "cmd" class is set in your own stylesheet. May be:

.cmd {color: # e3e3e3; background color: # 222222; }

0
source

All Articles