wiki:HighlightingWithEnscript

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:

Error: Failed to load processor refal
No macro or processor named 'refal' found

To set up Refal syntax coloring in Trac a few changes in the Trac source code were required though.

  1. 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).
  2. And that new mime type was mapped to refal language type for enscript in mimeview/enscript.py.
Last modified 14 years ago Last modified on Sep 30, 2006, 3:46:00 AM