Ticket #984 (closed enhancement: fixed)
Allow PHP files to be syntax highlighted (possible patch included)
| Reported by: | k-fish@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9 |
| Component: | version control/browser | Version: | 0.9.6 |
| Severity: | normal | Keywords: | highlight enscript php |
| Cc: | quinn@… |
Description
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:
1. (2, 'text/x-php', 'php'), has to be added to supported_types
2. Change display to look like this:
if lang == 'php':
enscript = 'php -s'
else:
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.


