Allow PHP files to be syntax highlighted (possible patch included)
|Reported by:||Owned by:||Christian Boos|
|Severity:||normal||Keywords:||highlight enscript php|
I just started using trac, after having looked at it for a while. The current project is in PHP, but enscript can't highlight PHP source. So I came up with a pretty lame solution for this :) trac/mimeviewers/enscript.py needs to be changed for this:
- (2, 'text/x-php', 'php'), has to be added to supported_types
- Change display to look like this:
if lang == 'php':
enscript = 'php -s'
enscript = env.get_config('mimeviewer', 'enscript_path', 'enscript') enscript += ' —color -h -q —language=html -p - -E' if lang:
enscript += lang
Then PHP files get highlighted by PHP itself. This isn't very clean, but… it works here.
Change History (18)
comment:8 by , 14 years ago
|Component:||general → browser|
|Status:||closed → reopened|
|Version:||0.8 → devel|