I had issues with getting the correct output for various combinations of monospace, italic, and bold in the ever-changing assortment of outputs I was generating from the single-source system I was using at the time, so I use basic ASCII punctuation:
< > : to be provided by the user, for example, MON <application name>
{ } : choose one from a set of items separated by |, for example, LIST { ROLES | USERS }
[ ] : optional, for example, MON [application name>]
(MON
can be used by itself or followed by the name of an application)
This convention is explained in an "About this documentation" section. If the command is at all complicated, I follow the command syntax with an example.
You'd probably want to use a different set of punctuation if documenting something like XML, where the code is full of angle brackets.
The Microsoft Manual of Style has a good set of conventions if text formatting works for you (see "Command syntax").