Power[a, b] throws $Failed
a^b or Power[a, b] throws $Failed. Maybe typesetting boxes (like SuperscriptBox here and FractionBox in scdevries's example) should all be avoided?
Yes, right. There is the simplified CodeFormatterMakeBoxes inside the package, which I introduced specifically for handling such cases. Use it instead of MakeBoxes for your expression, and (hopefully), it will format Ok. Have a look at the project page, there is an example there of how to use that.
Thanks. Didn't notice the CodeFormatterMakeBoxes. I thought of reading Boxes from Input cells in a temp nb, which can handle comments as well. But then I realized UsingFrontEnd needs x-server so won't work in a pure console environment :(
Yes, comments are currently not handled by the formatter. I know how to do this, it is relatively straight-forward. Hopefully, some time soon :)