source: alternate styling for syntax highlighting
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 12 Oct 2009 19:22:35 +0000 (19:22 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 13 Oct 2009 22:38:39 +0000 (22:38 +0000)
dark.css
mono.css
red.css
source.plp

index 9540a7a59b7667abe69c4f83e28443055298eb6c..b33e7da6469aa74c72fce320468c98ce61271aa4 100644 (file)
--- 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 {
index c59ac0bb54c69706e0da4646675ad05ea020f8b8..30f878a835d2349f13d81c4b074985ebeecb6167 100644 (file)
--- 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 af617451e06780bec10f064dd2565b7a36373154..85938a90f410cc0a2a6371d487d681d786bf0138 100644 (file)
--- 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 }
+
index 68808d8447e370902a319167dd1d20fd200e1462..bc8423b1c111e5003961a80d848fc0175e875d2d 100644 (file)
@@ -14,7 +14,13 @@ $header{content_type} = "text/html; charset=utf-8";
 <head>
 <meta http-equiv="content-type" content="<:= $header{content_type} :>">
 <title>sheet page source code</title>
-<link rel="stylesheet" type="text/css" media="all" href="/base.css">
+<link rel="stylesheet" type="text/css" media="all" href="/base.css"><:
+       my %styles = map {$_ => $_} qw(dark mono red);
+       our $style = exists $get{style} && $styles{$get{style}} || 'light';
+       printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
+               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css", $_
+       ) for keys %styles;
+:>
 </head>
 
 <body id="source">