开发者

source code syntax highlighting for trac?

开发者 https://www.devze.com 2022-12-26 00:25 出处:网络
I\'ve installed trac on my Ubuntu server but there is no php syntax highlighting. I have installed Pygments using apt-get install but how do I conf开发者_开发百科igure trac so it uses highlighting in

I've installed trac on my Ubuntu server but there is no php syntax highlighting.

I have installed Pygments using apt-get install but how do I conf开发者_开发百科igure trac so it uses highlighting in the svn source browser?


Trac should automatically detect pygments, assuming its installed in the same Python instance. You may want to have a look at the doc, particularly the bit about the mimeviewer section of trac.ini and make sure everything is ok.

The two most likely candidates I can think of are:

1) the PHP mime type is not properly registered or (even worse) your files were committed to svn with the svn property svn:mime-type set to text/plain (I had this happen on a large project, but resetting the mime-type property worked (Trac uses the file extension as a fallback if the mimetype isn't reported by the VCS).

2) Everything may be working, but the default style may not be working properly. Try adjusting the highlighting style either through the /prefs page on your Trac instance or through the pygments_default_style setting in trac.ini.

0

精彩评论

暂无评论...
验证码 换一张
取 消