doc: code syntax highlighting for online charm manual using CodeMirror
authorRamprasad Venkataraman <ramv@illinois.edu>
Tue, 31 Jul 2012 02:14:42 +0000 (21:14 -0500)
committerRamprasad Venkataraman <ramv@illinois.edu>
Tue, 31 Jul 2012 02:42:51 +0000 (21:42 -0500)
doc/dot.latex2html-init
doc/manual.css

index 595b553e50cd1c00b12d18467ba5014fd4bb0826..44dd637c74a87eefa30fbd3f3fe7809f475150f2 100644 (file)
@@ -200,7 +200,6 @@ sub bot_navigation_panel {
     ($NEXT_TITLE ? "<td><B> Next:</B> $NEXT_TITLE</td>\n" : undef) . 
     
     "</tr></table></center>"
-  
 }
 
 # Add more tags etc to the head section of each page
@@ -212,7 +211,25 @@ sub head_tags {
     "<!-- Inserted from l2h_init.pl -->\n" .
     "<link href='http://fonts.googleapis.com/css?family=Puritan' rel='stylesheet' type='text/css'>\n" .
     "<link href='http://fonts.googleapis.com/css?family=Droid Sans' rel='stylesheet' type='text/css'>\n" .
-    "<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>\n" .
+    "\n" .
+    "<replace_with_script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>\n" .
+    "\n" .
+    "<replace_with_script src='http://charm.cs.illinois.edu/codemirror/lib/codemirror.js' type='text/javascript'></script>\n" .
+    "<replace_with_script src='http://charm.cs.illinois.edu/codemirror/mode/clike/clike.js' type='text/javascript'></script>\n" .
+    "<replace_with_script src='http://charm.cs.illinois.edu/codemirror/lib/util/runmode.js' type='text/javascript'></script>\n" .
+    "<link href='http://charm.cs.illinois.edu/codemirror/lib/codemirror.css' rel='stylesheet' type='text/css'>\n" .
+    "<link href='http://charm.cs.illinois.edu/codemirror/theme/lesser-dark.css' rel='stylesheet' type='text/css'>\n" .
+    "<replace_with_script type='text/javascript'>\n" .
+'//<![CDATA[
+// Grab all code snippets and paint it to highlight syntax
+$(document).ready( function() {
+    $("code").each( function(idx) {
+        CodeMirror.runMode($(this).text(), "text/x-c++src", $(this).get(0));
+    })
+    .addClass("cm-s-lesser-dark");
+} )
+//]]>' .
+    "</script>\n" .
     "<!-- end of inserted tags -->\n"
 }
 
index 746c189ce85e5b11f591c0c48dc0149af157f6cc..1becf388b17122dd147fe287cf24b4239d3d6df6 100644 (file)
@@ -59,8 +59,8 @@ DIV.center            {   }
 SPAN.tt                {   }
 SPAN.sc                {   }
 pre {
-               background: #000;
-               color: #090;
+               background: #262626;
+               color: #d9bf8c;
                padding: 8px;
                margin: 10px auto;
                display: block;