Permalink
Browse files

changed to js code highlighting

  • Loading branch information...
1 parent dcfa4c7 commit 4c14493232b14cec43c4cbf451c794e5498dd760 @schacon committed Jan 21, 2010
@@ -1,10 +1,10 @@
!SLIDE
-# Third Slide #
+# First Slide #
!SLIDE bullets incremental
-# Fourth Slide #
+# Second Slide #
* something
* something else
@@ -1,13 +1,19 @@
-!SLIDE
+!SLIDE subsection
-# Third Slide #
+# Subsection Slide #
-!SLIDE bullets incremental
+!SLIDE ruby
-# Fourth Slide #
+# Code Slide #
-* something
-* something else
-* a third thing
-* a fourth thing
-* a fifth thing
+ @@@ ruby
+ require 'sinatra/base'
+
+ class MyApp < Sinatra::Base
+ set :sessions, true
+ set :foo, 'bar'
+
+ get '/' do
+ 'Hello world!'
+ end
+ end
@@ -1,16 +0,0 @@
-!SLIDE commandline incremental
-
- $ git commit -am 'incremental bullet points working'
- [master ac5fd8a] incremental bullet points working
- 2 files changed, 32 insertions(+), 5 deletions(-)
-
-!SLIDE commandline incremental
-
- $ git commit -am 'incremental bullet points working'
- [bmaster ac5fd8a] incremental bullet points working
- 2 files changed, 32 insertions(+), 5 deletions(-)
-
- $ git commit -am 'incremental bullet points working'
- [cmaster ac5fd8a] incremental bullet points working
- 2 files changed, 32 insertions(+), 5 deletions(-)
-
@@ -1 +0,0 @@
-hello
@@ -0,0 +1,66 @@
+pre.sh_sourceCode {
+ background-color: white;
+ color: black;
+ font-style: normal;
+ font-weight: normal;
+}
+
+pre.sh_sourceCode .sh_keyword { color: blue; font-weight: bold; } /* language keywords */
+pre.sh_sourceCode .sh_type { color: darkgreen; } /* basic types */
+pre.sh_sourceCode .sh_usertype { color: teal; } /* user defined types */
+pre.sh_sourceCode .sh_string { color: red; font-family: monospace; } /* strings and chars */
+pre.sh_sourceCode .sh_regexp { color: orange; font-family: monospace; } /* regular expressions */
+pre.sh_sourceCode .sh_specialchar { color: pink; font-family: monospace; } /* e.g., \n, \t, \\ */
+pre.sh_sourceCode .sh_comment { color: brown; font-style: italic; } /* comments */
+pre.sh_sourceCode .sh_number { color: purple; } /* literal numbers */
+pre.sh_sourceCode .sh_preproc { color: darkblue; font-weight: bold; } /* e.g., #include, import */
+pre.sh_sourceCode .sh_symbol { color: darkred; } /* e.g., <, >, + */
+pre.sh_sourceCode .sh_function { color: black; font-weight: bold; } /* function calls and declarations */
+pre.sh_sourceCode .sh_cbracket { color: red; } /* block brackets (e.g., {, }) */
+pre.sh_sourceCode .sh_todo { font-weight: bold; background-color: cyan; } /* TODO and FIXME */
+
+/* Predefined variables and functions (for instance glsl) */
+pre.sh_sourceCode .sh_predef_var { color: darkblue; }
+pre.sh_sourceCode .sh_predef_func { color: darkblue; font-weight: bold; }
+
+/* for OOP */
+pre.sh_sourceCode .sh_classname { color: teal; }
+
+/* line numbers (not yet implemented) */
+pre.sh_sourceCode .sh_linenum { color: black; font-family: monospace; }
+
+/* Internet related */
+pre.sh_sourceCode .sh_url { color: blue; text-decoration: underline; font-family: monospace; }
+
+/* for ChangeLog and Log files */
+pre.sh_sourceCode .sh_date { color: blue; font-weight: bold; }
+pre.sh_sourceCode .sh_time, pre.sh_sourceCode .sh_file { color: darkblue; font-weight: bold; }
+pre.sh_sourceCode .sh_ip, pre.sh_sourceCode .sh_name { color: darkgreen; }
+
+/* for Prolog, Perl... */
+pre.sh_sourceCode .sh_variable { color: darkgreen; }
+
+/* for LaTeX */
+pre.sh_sourceCode .sh_italics { color: darkgreen; font-style: italic; }
+pre.sh_sourceCode .sh_bold { color: darkgreen; font-weight: bold; }
+pre.sh_sourceCode .sh_underline { color: darkgreen; text-decoration: underline; }
+pre.sh_sourceCode .sh_fixed { color: green; font-family: monospace; }
+pre.sh_sourceCode .sh_argument { color: darkgreen; }
+pre.sh_sourceCode .sh_optionalargument { color: purple; }
+pre.sh_sourceCode .sh_math { color: orange; }
+pre.sh_sourceCode .sh_bibtex { color: blue; }
+
+/* for diffs */
+pre.sh_sourceCode .sh_oldfile { color: orange; }
+pre.sh_sourceCode .sh_newfile { color: darkgreen; }
+pre.sh_sourceCode .sh_difflines { color: blue; }
+
+/* for css */
+pre.sh_sourceCode .sh_selector { color: purple; }
+pre.sh_sourceCode .sh_property { color: blue; }
+pre.sh_sourceCode .sh_value { color: darkgreen; font-style: italic; }
+
+/* other */
+pre.sh_sourceCode .sh_section { color: black; font-weight: bold; }
+pre.sh_sourceCode .sh_paren { color: red; }
+pre.sh_sourceCode .sh_attribute { color: darkgreen; }
Oops, something went wrong.
Oops, something went wrong.
@@ -43,6 +43,7 @@ function loadSlides() {
showFirstSlide()
slidesLoaded = true
}
+ sh_highlightDocument()
})
}
View
@@ -66,6 +66,19 @@ def update_image_paths(path, slide)
def update_commandline_code(slide)
html = Nokogiri::XML.parse(slide)
+
+ html.css('pre').each do |pre|
+ pre.css('code').each do |code|
+ out = code.text
+ lines = out.split("\n")
+ if lines.first[0, 3] == '@@@'
+ lang = lines.shift.gsub('@@@', '').strip
+ pre.set_attribute('class', 'sh_' + lang)
+ code.content = lines.join("\n")
+ end
+ end
+ end
+
html.css('.commandline > pre > code').each do |code|
out = code.text
lines = out.split(/^\$(.*?)$/)
View
@@ -14,8 +14,12 @@
<script type="text/javascript" src="/js/showoff.js"></script>
<script type="text/javascript" src="/js/jTypeWriter.js"> </script>
+ <script type="text/javascript" src="/js/sh_main.min.js"></script>
+ <script type="text/javascript" src="/js/sh_lang/sh_ruby.min.js"></script>
+
<link type="text/css" href="/css/fg.menu.css" media="screen" rel="stylesheet" />
<link type="text/css" href="/css/theme/ui.all.css" media="screen" rel="stylesheet" />
+ <link type="text/css" href="/css/sh_style.css" rel="stylesheet" >
<script type="text/javascript">
$(function(){

0 comments on commit 4c14493

Please sign in to comment.