[Trac] Enscript + Matlab

Jonathan Manning jmanning at alisa-jon.net
Fri Apr 15 09:19:33 EDT 2005


Hi,

Trac does map common extensions to mime-types for you. The trouble is,
'.m' files can also be Objective C files, so in trac, it's mapped to the
wrong filter (hence the "random" colorization).

You could simply edit trac's manual extension to mime-type map so that
'.m' files were always considered Matlab files.
See http://projects.edgewall.com/trac/file/trunk/trac/Mimeview.py
It's pretty easy to make tweaks here even if you don't know python.

Really, the better solution is to tell subversion explicitly that your
.m files are matlab files (see autoprops - but you did say you could
setup the client). Overriding it for trac works too, you'll just have to
keep it as a local change, because it's not likely to be integrated into
Trac - for fear of alienating all those ObjC developers. ;-)

It might be nice to have a way to do this in the project config. Now
that's a change that could easily make it into Trac...

~J

Christopher Ness wrote:
> Hi!
> 
> I'd like the syntax highlighting for my matlab and makefiles to actually
> look like the stuff that `enscript` spits out.  But Trac seems to
> butcher it somehow filtering out the HTML and putting in CSS stuff (and
> not even in the right spots!)
> 
> * Bam! *
> 
> I even made sure `svn proplist pivot.m` didn't return anything, which
> was the problem!
> After setting the ``svn:mime-type'' correctly Trac gave me the pretty-
> print I wanted.  Now I know I can set up my client to do this for me,
> but I don't really want to have to play around with mime-types.
> 
> Why do I have to set the ``svn:mime-type'' shouldn't Trac be looking for
> file extensions and files like "Makefile"?  This way it will work
> straight out of the box when no value for the mime-type exists in
> subversion (you should be able to over-ride Trac's guess)?
> 
> I'm running the 0.8.1 release.  If this is fixed in subversion just let
> me know.
> 
> Cheers,
> Chris


More information about the Trac mailing list