Script source:devel-tools/trunk/enscript/refal.st allows to color in Refal programs with GNU Enscript.
Just place it alongside other enscript highlighting scripts and use -E refal option to get pretty looking refal sources in PostScript or html. Also you can change namerules in enscript.st for automatically recognize refal programs by file extensions. Insert a line like this:
/\.(ref|rf|rfi)$/ refal;
Trac uses enscript for syntax coloring of source code. See source:to-imperative/trunk/rfp/rfpj.rf#2095 for colored example of "real" Refal program.
And you can insert blocks of colored Refal code in wiki text as with other WikiProcessors:
{{{ #!refal $func Fab e.in = e.out; Fab { e1 'a' e2 = e1 'b' <Fab e2>; e1 = e1; }; }}}
Results in:
To set up Refal syntax coloring in Trac a few changes in the Trac source code were required though.
- First, new mime type text/x-refal had to be added to MIME_MAP in mimeview/api.py. It was used for file extensions .ref, .rf, and .rfi, and also refal for #!refal code blocks could work as shown above (or else one could use just #!ref or #!rf).
- And that new mime type was mapped to refal language type for enscript in mimeview/enscript.py.