The following diff documents the change made to SyntaxHighlightingPlugin, to integrate the ScmToXexpr Scheme source highlighting program. The diff applies to SyntaxHighlightingPlugin.pm.
All the change does is test whether the specified language is "scheme", and if so, submits an HTTP POST request containing the specified source code, to the source formatting servlet (see source listing at ScmToXexpr). The HTML returned by the servlet is returned to the invoker of the plugin.
*** SyntaxHighlightingPlugin.original.pm Sat Apr 10 15:05:13 2004
--- SyntaxHighlightingPlugin.pm Thu Apr 22 19:40:37 2004
***************
*** 33,36 ****
--- 33,38 ----
use IPC::Open2;
+ use LWP::UserAgent;
+ use HTTP::Request::Common;
use vars qw(
***************
*** 120,123 ****
--- 122,131 ----
my ($lang, $text, $nb_option, $nb_start) = @_;
+
+ if ($lang eq"scheme") {
+ my $ua = LWP::UserAgent->new;
+ my $response = $ua->simple_request(POST 'http://127.0.0.1:8000/servlets/pretty.scm', [source => $text]);
+ return $response->content;
+ }
my $highlighted = pipeThru("enscript --color --language=html --highlight=$langs{lc($lang)} -o - -q", $text);