From: Mischa POSLAWSKY Date: Mon, 12 Oct 2009 19:22:35 +0000 (+0000) Subject: source: alternate styling for syntax highlighting X-Git-Tag: v1.3~123 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/cad8198dbb4421c31673d233f1f05fdb5e1bffbd source: alternate styling for syntax highlighting --- diff --git a/dark.css b/dark.css index 9540a7a..b33e7da 100644 --- a/dark.css +++ b/dark.css @@ -38,6 +38,15 @@ dl.legend-options dt {background: #333} color: #000; /* on default (light) background hover */ } /* mode link */ +/* code syntax */ +.sy-comment { color: #888 } +.sy-constant { color: #8AC } +.sy-type, +.sy-identifier { color: #C9B } +.sy-special { color: #A9C } +.sy-error { font-weight: bold; background-color: #800; color: #EEE } +.sy-todo { background-color: #880 } + /* character properties */ .glyphs th, .glyphs td { diff --git a/mono.css b/mono.css index c59ac0b..30f878a 100644 --- a/mono.css +++ b/mono.css @@ -21,3 +21,15 @@ body ul.keys li.new { border-color: #888; } +/* code syntax */ +#source pre { color: #444 } +.sy-comment { color: #888; text-shadow: #888 0 0 1em } +.sy-constant { color: inherit; font-style: italic } +.sy-type, +.sy-identifier { color: #000 } +.sy-statement { color: #000 } +.sy-preProc { color: #000 } +.sy-special { color: #000; font-style: italic } +.sy-error { font-weight: bold; background-color: #000; color: #FFF } +.sy-todo { background-color: #CCC } + diff --git a/red.css b/red.css index af61745..85938a9 100644 --- a/red.css +++ b/red.css @@ -61,3 +61,13 @@ dt.pm, dt.mv, color: #FF0; } /* mode link */ +/* code syntax */ +.sy-comment { color: #888 } +.sy-constant { color: #C88 } +.sy-type, +.sy-identifier { color: #C44 } +.sy-statement { text-shadow: #F00 0 0 0.5em } +.sy-special { color: #CA8 } +.sy-error { font-weight: bold; background-color: #A00; color: #EEE } +.sy-todo { background-color: #400 } + diff --git a/source.plp b/source.plp index 68808d8..bc8423b 100644 --- a/source.plp +++ b/source.plp @@ -14,7 +14,13 @@ $header{content_type} = "text/html; charset=utf-8"; sheet page source code - +<: + my %styles = map {$_ => $_} qw(dark mono red); + our $style = exists $get{style} && $styles{$get{style}} || 'light'; + printf(qq{\n}, + $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css", $_ + ) for keys %styles; +:>