Forum:Code Formatting On Biostar
1
7
Entering edit mode
10.9 years ago

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 • 3.3k views
ADD COMMENT
4
Entering edit mode

reminder , you can include a 'gist' in the answers: see 'shortcuts' in http://www.biostars.org/faq/

ADD REPLY
0
Entering edit mode

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

ADD REPLY
3
Entering edit mode
10.9 years ago

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.

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2591 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6