Description: |
|
---|
Support custom syntax highlighting in the diff viewer
Review Request #1180 — Created Oct. 25, 2009 and discarded
Pygments supports lots of styles, but RB currently only supports its own simple syntax highlighting. This is a first step toward supporting custom syntax highlighting. Just looking for comments on the approach. * Add a script to generate all available pygment highlighters as static CSS files * Add an admin field to choose the desired style * Update templates to use a selector for the syntax highlighting This change works well enough with light-background styles, but not with dark-background styles. We'd need to support styling the changed line backgrounds based on the colorscheme of the theme for this to work well. Also needs a drop-down for selecting styles, css to be automatically generated on install, and user-selectable themes. http://github.com/djs/reviewboard/tree/review-1180
Unit tests pass. Tested diff fragments and review comment fragments with different pygments color schemes. Tested generating a new database.
DJ
-
-
reviewboard/diffviewer/diffutils.py (Diff revision 1) make sure this fits on 80 lines. might want to just do: formatter = HtmlFormatter(style=style) return pygments.....
-
reviewboard/templates/diffviewer/view_diff.html (Diff revision 1) We'll need to factor in the current style in when caching the views. Otherwise, this might be stale.
-