Indefero

Issue 490: syntax high. support for Haskell

Reported by Gour D., Jun 28, 2010

Hello!

I plan to take 'business' hosting at Indefero by using Monotone (it 
will hopefully arrive soon) for the program written in Haskell 
language.

Please, add support for highlighting Haskell (*.hs) source files!


Sincerely,
Gour

Comment 1 by Gour D., Jun 29, 2010

Hi,

Let me just add that it would be nice to add support for other 
languages (e.g. Elisp & co,), i.e. everything which is supported 
by the JS lib used for syntax highlighting support.


Sincerely,
Gour

Comment 2 by Anthony George, Aug 31, 2010

You can change the syntax highlighting to GeSHi(websvn uses it, 
works well and it's fairly configurable). I wanted it as I was used 
to it, so here's how:

1-Download GeSHi(http://qbnz.com/highlighter/), unpack into 
somewhere(I put mine so I had a src/IDF/geshi directory)
2-Make a backup of src/IDF/Views/Source.php, just in case.
3-Open up src/IDF/Views/Source.php in your favorite editor.
4-Just under the Pluf::loadFunction... lines add:
include_once '/your/path/to/geshi/geshi.php';
5-Search for "function highLight"(without quotes, should 
be around line 551)
6-Replace everything within the function with:
   public static function highLight($fileinfo, $content)
    {
       if($fileinfo[2]==='vb') {
                $filetype='vb.net';
        } else {
                $filetype=$fileinfo[2];
        }
        $geshi = new GeSHi($content,$filetype);
        $geshi->set_header_type(GESHI_HEADER_PRE_TABLE);
        $geshi->enable_classes(false);
        $geshi->set_tab_width(4);
        $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS,2);
        $geshi->set_line_style('background: #fcfcfc;', 
'background: #f0f0f0;');
        return  Pluf_Template::markSafe("<tr 
class="c-line"><td colspan=2 
>".$geshi->parse_code()."</td></tr>"
);
    }
7-Should work!  The vb~vb.net fixup is because I work primarily in 
vb.net(not "old" vb) and .vb should be recognized as 
vb.net not vb.

Comment 3 by Gour D., Sep 1, 2010

Nice. I hope they will put it on indefero.net hosting since I do not 
host my own forge.


Sincerely,
Gour

Comment 4 by Patrick Georgi, Oct 30, 2010

idf-prettify-lisp-haskell-visualstudio.diff should enable the 
already present support in prettify for:
- cl, el, lisp, scm (various lisps and scheme)
- hs (Haskell)
- fs (F#)
- vbs (Visual Basic Script)

An update of prettify and some more extensions of this list could 
enable further support for yaml, vhdl and a couple of other things 
that appeared this year in upstream prettify.

Comment 5 by Gour D., Oct 30, 2010

Please add support for D as well...we'll do project in D.

Comment 6 by Patrick Georgi, Oct 31, 2010

It might be enough to add "d" to the list of supported 
file extensions, but there's no explicit d parser available for 
prettify, so that might be incomplete.
Because of that I'm reluctant to just add it.

Comment 7 by Thomas Keller, Oct 31, 2010

Labels: Type:Enhancement Type:Defect

Comment 8 by Thomas Keller, Oct 31, 2010

Patch applied in commit c0ccdc7
Status: Fixed

Comment 9 by Thomas Keller, Nov 25, 2010

Labels: Milestone:Release1.1

Created: 2 years 10 months ago by Gour D.

Updated: 2 years 5 months ago

Status: Fixed

Followed by: 3 persons

Labels:
Priority:Medium
Type:Enhancement
Milestone:Release1.1