This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Forum: Code Formatting On Biostar

I find that the code formatting on Biostar makes is hard to read the code. The red colour and the fact that there is no syntax highlighting makes it difficult to read, at least for me.

I may be the only one to whom this is an 'issue', but I would be curious to know what others think about it.

On the other hand, I find the code formatting on GitHub to be especially clear and pleasant to read. I guess there may be libraries available to do that. Syntax highlighting can be very language dependent, but something minimal like highlighting parentheses, strings, numbers and common operators (=+-/*...) can already make a big difference.

Otherwise, maybe there is a way to view the forum in vim? ;)

biostars code

Hi Pierre, this is a nice option, but it does not improve the whole forum even if a few people use it.

1 answer

I agree that is should be better, alas we were not able to find a good solution so far.

Initially we deployed via the pygments syntax highlighter operating via python. But that option had problems properly interacting with the custom tags so it was replaced with a javascript based solution via the google-code-prettify library. This worked well most of the time but the XML output was extremely bad and if I recall correctly other systematic mis-formatting was also occurring. So that ended up being disabled.

If someone has good experiences/practice with a javascript based syntax highlighting library we could give that a try. Github is a nice solution but I am sure they have worked a lot on it and it is not clear if their solution is an open source option.

I think that github's syntax highlighting is open source, according to github/linuist, they seem to use a wrapper around pygments though

thanks for tracking that down, now that I look at it, it is a ruby module that depends on code from another project that offers a ruby based wrapper around the python pygments library ... sigh

Log in to answer this question.