Skip to content

Replace highlight.js with rouge-fork rugments

Ramya Authappan requested to merge github/fork/rumpelsepp/rouge into master

Created by: rumpelsepp

A few day ago I have opened this issue here #8404. I am neither a ruby nor a rails pro but I have managed to create some kind of demo. It is not ready for merge. You could consider it as a proof of concept and for comparing the results between highlight.js and rouge

Again some explanations

  • highlight.js is really buggy in getting the correct synthax. The solution is guessing the language with taking the filename, shebang, ... into consideration.
  • pygments handles this very well but it is a python library
  • rouge is a highlighter in ruby which is compatible to pygments themes. It is able to do this kind of guessing, too.
  • f4b9a65c reactivates highlight.js language autodetection which is buggy by design.
  • look here for some more discussion: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/232#note_622601, #8404

TODO

  • Blob
  • Blame
  • Wiki
  • Code Blocks
  • Snippets
  • Themes - find a better white and dark theme!
  • Check color definitions in themes again
  • Code Cleanup
  • Line number links
  • Line number colors
  • add new theme screenshots

Demo

Checkout my private Gitlab instance. I have included this pull request there already: https://gitlab.sevenbyte.org/u/stefan

Instructions for changing the theme without an account are here: https://github.com/gitlabhq/gitlabhq/pull/8425#issuecomment-67137852

Merge request reports

Loading