Support custom syntax highlighting in the diff viewer
Review Request #1180 — Created Oct. 25, 2009 and discarded — Latest diff uploaded
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.
Diff Revision 1 (Latest)
contrib/internal/gen-styles.py |
---|
reviewboard/admin/forms.py |
---|
reviewboard/admin/siteconfig.py |
---|
reviewboard/diffviewer/diffutils.py |
---|
reviewboard/htdocs/media/rb/css/diffviewer.css |
---|
reviewboard/htdocs/media/rb/css/syntax.css |
---|
reviewboard/htdocs/media/rb/css/syntax/reviewboard.css |
---|
reviewboard/templates/diffviewer/diff_file_fragment.html |
---|
reviewboard/templates/diffviewer/view_diff.html |
---|
reviewboard/templates/reviews/diff_comment_fragment.html |
---|
reviewboard/templates/reviews/review_detail.html |
---|