Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a wiki processor for Trac to format and colour Python tracebacks?

Understandably many of the tickets we file in Trac contain tracebacks. It would be excellent if these were nicely formatted and syntax highlighted.

I've conducted a cursory Google search for a Python traceback wiki processor and have not found any quick hits.

I'm happy to roll my own if anyone can recommend a traceback formatter (stand alone or embedded in an open source project) that outputs HTML/reStructuredText/etc.

like image 276
brotchie Avatar asked Mar 01 '23 10:03

brotchie


1 Answers

I don't believe you need that patch. You could specify the shortcode mapping in the trac.ini, but you can also (at least in trac 0.12) just use the mime type directly:

{{{
#!text/x-python-traceback
<traceback>
}}}

See more at http://trac.edgewall.org/wiki/TracSyntaxColoring. x-python-traceback isn't in the list there, but you'll get an error previewing if trac can't handle it and it WorkedForMe.

like image 98
UnwashedMeme Avatar answered Mar 05 '23 15:03

UnwashedMeme