From c00e496bd055a1534e6643080c89262b82c30111 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 4 Oct 2009 04:34:08 +0000 Subject: [PATCH] source: syntax highlighting in global stylesheet --- base.css | 19 +++++++++++++++++++ source.plp | 15 ++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/base.css b/base.css index 76f5929..50e12f2 100644 --- a/base.css +++ b/base.css @@ -69,6 +69,14 @@ ul { list-style: none; } +#source { + text-align: center; +} +#source pre { + display: inline-block; + text-align: left; +} + /* "keyboard" (list of keys) */ ul#rows {margin-top: -5ex} /* top (esc) row fits besides header */ @@ -324,6 +332,17 @@ td.c-aa {background: #E3E8FF} td.c-sa {background: #DFF} td.c-na {background: #DFD} +/* code syntax */ +.sy-comment { color: #888 } +.sy-constant { color: #008 } +.sy-type, +.sy-identifier { color: #804 } +.sy-statement { } +.sy-preProc { } +.sy-special { color: #408 } +.sy-error { font-weight: bold; background-color: #F00; color: #FFF } +.sy-todo { background-color: #FF0 } + /* hover effects */ td.di-d, td.X:hover {cursor: help} diff --git a/source.plp b/source.plp index aad6898..68808d8 100644 --- a/source.plp +++ b/source.plp @@ -14,18 +14,7 @@ $header{content_type} = "text/html; charset=utf-8"; sheet page source code - + @@ -65,7 +54,7 @@ print "
\n";
 foreach (@$parsed) {
 	my $tag = $_->[0] && ($TYPETAG{ $_->[0] } || 'span');
 	my $arg = '';
-	print "<$tag$arg class=\"syn$_->[0]\">" if $tag;
+	print "<$tag$arg class=\"sy-\l$_->[0]\">" if $tag;
 	if ($_->[0] eq 'Constant' and $_->[1] =~ s/^(')([a-z0-9_.]+\.plp?)(?=\1$)//) {
 		printf '%s%s', $1, "/source/$2", $2;
 	}
-- 
2.30.0