Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial state

  • Loading branch information...
commit b9d4ebc61da2f0848d4dc8131805c16e95cc3e77 1 parent acd8635
@sleeper authored
Showing with 9,651 additions and 0 deletions.
  1. +35 −0 Rakefile
  2. +13 −0 coffee/background.coffee
  3. +65 −0 coffee/slide.coffee
  4. +123 −0 coffee/slidemanager.coffee
  5. +18 −0 coffee/util.coffee
  6. +19 −0 css/goliath.css
  7. +32 −0 css/slides.css
  8. BIN  fonts/Lato-Regular.woff
  9. BIN  fonts/PermanentMarker.woff
  10. BIN  fonts/Ubuntu-Regular.woff
  11. BIN  fonts/YanoneKaffeesatz-Regular.ttf
  12. +206 −0 goliath.html
  13. BIN  images/artwild1x.jpg
  14. BIN  images/fred2.png
  15. BIN  images/gplus.png
  16. BIN  images/image004.jpg
  17. BIN  images/io.jpg
  18. BIN  images/twitter.png
  19. +1 −0  js/highlight
  20. +46 −0 js/highlight.js-6.1/AUTHORS.en.txt
  21. +46 −0 js/highlight.js-6.1/AUTHORS.ru.txt
  22. +24 −0 js/highlight.js-6.1/LICENSE
  23. +136 −0 js/highlight.js-6.1/README.md
  24. +140 −0 js/highlight.js-6.1/README.ru.md
  25. +437 −0 js/highlight.js-6.1/classref.txt
  26. +87 −0 js/highlight.js-6.1/export.html
  27. +1 −0  js/highlight.js-6.1/highlight
  28. +630 −0 js/highlight.js-6.1/highlight.js
  29. +1 −0  js/highlight.js-6.1/highlight.pack.js
  30. +68 −0 js/highlight.js-6.1/languages/1c.js
  31. +432 −0 js/highlight.js-6.1/languages/apache.js
  32. +75 −0 js/highlight.js-6.1/languages/avrasm.js
  33. +43 −0 js/highlight.js-6.1/languages/axapta.js
  34. +56 −0 js/highlight.js-6.1/languages/bash.js
  35. +24 −0 js/highlight.js-6.1/languages/cmake.js
  36. +62 −0 js/highlight.js-6.1/languages/cpp.js
  37. +41 −0 js/highlight.js-6.1/languages/cs.js
  38. +101 −0 js/highlight.js-6.1/languages/css.js
  39. +70 −0 js/highlight.js-6.1/languages/delphi.js
  40. +64 −0 js/highlight.js-6.1/languages/diff.js
  41. +72 −0 js/highlight.js-6.1/languages/django.js
  42. +29 −0 js/highlight.js-6.1/languages/dos.js
  43. +81 −0 js/highlight.js-6.1/languages/erlang-repl.js
  44. +201 −0 js/highlight.js-6.1/languages/erlang.js
  45. +58 −0 js/highlight.js-6.1/languages/go.js
  46. +77 −0 js/highlight.js-6.1/languages/haskell.js
  47. +32 −0 js/highlight.js-6.1/languages/ini.js
  48. +45 −0 js/highlight.js-6.1/languages/java.js
  49. +53 −0 js/highlight.js-6.1/languages/javascript.js
  50. +87 −0 js/highlight.js-6.1/languages/lisp.js
  51. +75 −0 js/highlight.js-6.1/languages/lua.js
  52. +40 −0 js/highlight.js-6.1/languages/mel.js
  53. +224 −0 js/highlight.js-6.1/languages/nginx.js
  54. +94 −0 js/highlight.js-6.1/languages/objectivec.js
  55. +52 −0 js/highlight.js-6.1/languages/parser3.js
  56. +143 −0 js/highlight.js-6.1/languages/perl.js
  57. +55 −0 js/highlight.js-6.1/languages/php.js
  58. +49 −0 js/highlight.js-6.1/languages/profile.js
  59. +71 −0 js/highlight.js-6.1/languages/python.js
  60. +230 −0 js/highlight.js-6.1/languages/renderman.js
  61. +203 −0 js/highlight.js-6.1/languages/ruby.js
  62. +60 −0 js/highlight.js-6.1/languages/scala.js
  63. +55 −0 js/highlight.js-6.1/languages/smalltalk.js
  64. +90 −0 js/highlight.js-6.1/languages/sql.js
  65. +62 −0 js/highlight.js-6.1/languages/tex.js
  66. +75 −0 js/highlight.js-6.1/languages/vala.js
  67. +30 −0 js/highlight.js-6.1/languages/vbscript.js
  68. +30 −0 js/highlight.js-6.1/languages/vhdl.js
  69. +103 −0 js/highlight.js-6.1/languages/xml.js
  70. +151 −0 js/highlight.js-6.1/styles/arta.css
  71. +45 −0 js/highlight.js-6.1/styles/ascetic.css
  72. +105 −0 js/highlight.js-6.1/styles/brown_paper.css
  73. BIN  js/highlight.js-6.1/styles/brown_papersq.png
  74. +103 −0 js/highlight.js-6.1/styles/dark.css
  75. +121 −0 js/highlight.js-6.1/styles/default.css
  76. +118 −0 js/highlight.js-6.1/styles/far.css
  77. +129 −0 js/highlight.js-6.1/styles/github.css
  78. +118 −0 js/highlight.js-6.1/styles/idea.css
  79. +103 −0 js/highlight.js-6.1/styles/ir_black.css
  80. +118 −0 js/highlight.js-6.1/styles/magula.css
  81. +111 −0 js/highlight.js-6.1/styles/school_book.css
  82. BIN  js/highlight.js-6.1/styles/school_book.png
  83. +96 −0 js/highlight.js-6.1/styles/solarized_dark.css
  84. +96 −0 js/highlight.js-6.1/styles/solarized_light.css
  85. +147 −0 js/highlight.js-6.1/styles/sunburst.css
  86. +84 −0 js/highlight.js-6.1/styles/vs.css
  87. +115 −0 js/highlight.js-6.1/styles/zenburn.css
  88. +1,609 −0 js/highlight.js-6.1/test.html
  89. +295 −0 js/slides.js
  90. +62 −0 less/_macros.less
  91. +104 −0 less/goliath.less
  92. +249 −0 less/slides.less
View
35 Rakefile
@@ -0,0 +1,35 @@
+require 'bundler/setup'
+require 'coffee-script'
+
+namespace :js do
+ desc "compile coffee-scripts"
+ task :compile do
+ File.open "#{File.dirname(__FILE__)}/js/slides.js", 'w+' do |js|
+ Dir.chdir("#{File.dirname(__FILE__)}/coffee/") do
+ ['util.coffee', 'background.coffee', 'slide.coffee', 'slidemanager.coffee'].each do |f|
+ js.puts CoffeeScript.compile File.read(f)
+ end
+ end
+ end
+ end
+end
+
+namespace :less do
+ desc "compile less"
+ task :compile do
+ Dir.chdir("#{File.dirname(__FILE__)}/less/") do
+ Dir.foreach(".") do |cf|
+ if /^([^_].+)\.less$/ =~ cf
+ name = $1
+ puts "Treating #{cf} ..."
+ File.open("../css/#{name}.css", "w+") do |css|
+ file = File.join(File.dirname(__FILE__),"less", cf)
+ oc = `lessc #{file}`
+ css.puts oc
+ end
+ end
+ end
+ end
+ end
+end
+
View
13 coffee/background.coffee
@@ -0,0 +1,13 @@
+# vim: ts=2 sw=2 et :
+class Background
+ constructor: (@dom, @manager)->
+
+ dispatchEvent: ()->
+ evt = document.createEvent('Event');
+ evt.initEvent('backgroundTransitioned', false, false);
+ evt.background = this;
+ slide = @manager.getCurrent();
+ slide.dom.dispatchEvent(evt);
+
+window.Background = Background
+
View
65 coffee/slide.coffee
@@ -0,0 +1,65 @@
+# vim: ts=2 sw=2 et :
+class Slide
+ constructor: (@dom, @manager, @index, @util) ->
+ styles = window.getComputedStyle(dom, null)
+ transitionProps = styles.getPropertyValue('-webkit-transition-property') ||
+ styles.getPropertyValue('-moz-transition-property')
+ @transitionPropertyCount = transitionProps.split(',').length
+ onTransition = @onTransition.bind(this)
+ @dom.addEventListener(@util.transitionEnd, onTransition, false)
+ @dom.addEventListener('backgroundTransitioned', @onBackground, false)
+
+ onTransition: (evt)->
+ if (evt.target == @dom)
+ @transitionFinishedCount += 1
+ if (@transitionFinishedCount >= @transitionPropertyCount)
+ @dispatchEvent()
+
+ onBackground:()->
+
+ setCurrentOffset: (offset)->
+ # We need to set class only for the 2 slides
+ # before and after the current slide
+ if Math.abs(offset) <= 2
+ if @dom.parentNode != @manager.domStage
+ @manager.domStage.appendChild( @dom )
+
+ @setClassIf( offset == -2, 'far-past' )
+ @setClassIf( offset == -1, 'past' )
+ @setClassIf( offset == 0, 'current' )
+ @setClassIf( offset == 1, 'future' )
+ @setClassIf( offset == 2, 'far-future' )
+ else
+ if @dom.parentNode != @manager.domContent
+ @manager.domContent.appendChild( @dom )
+ @transitionFinishedCount = 0
+
+ dispatchEvent: ()->
+ evt = document.createEvent('Event')
+ evt.slide = this
+ if (@dom.classList.contains('current'))
+ evt.initEvent('slideIn', false, false)
+ else
+ evt.initEvent('slideOut', false, false)
+ @dom.dispatchEvent(evt)
+
+ setClassIf: (cond, name)->
+ if cond
+ @dom.classList.add name
+ else
+ @dom.classList.remove name
+
+ addEventListener: (evt, callback, cascade)->
+ @dom.addEventListener.apply( @dom, arguments)
+
+ getBackgroundId: ()->
+ if @dom.dataset && @dom.dataset.backgroundid
+ @dom.dataset.backgroundid
+ else if @dom.hasAttribute('data-backgroundid')
+ @dom.getAttribute('data-backgroundid')
+ else
+ null
+
+
+window.Slide = Slide
+
View
123 coffee/slidemanager.coffee
@@ -0,0 +1,123 @@
+# vim: ts=2 sw=2 et :
+class SlideManager
+ constructor: () ->
+ @util = new Util
+ @slides = []
+ @backgrounds = {}
+ domslides = document.querySelectorAll('.slide')
+ dombgds = document.querySelectorAll('.background')
+ @domStage = document.querySelector('#stage')
+ @domContent = document.querySelector('#content')
+ @domBackground = document.querySelector('#background')
+ @bgDefault = 'bg-white';
+
+ idx = 0
+ for s in domslides
+ @slides.push new Slide(s, this, idx, @util)
+ idx += 1
+
+ idx = 0
+ for b in dombgds
+ @backgrounds[b.id] = new Background(b, this)
+
+ @init_events()
+ @init_slide_in()
+ @parse_history()
+
+ next: ()->
+ @setCurrent( @current + 1 )
+
+ prev: ()->
+ @setCurrent( @current - 1)
+
+ init_events: () ->
+ window.addEventListener 'keydown', @on_key_down.bind(this), false
+
+ on_key_down: (evt) ->
+ switch evt.keyCode
+ when 37 then @prev()
+ when 32, 39 then @next()
+
+ init_slide_in: ()->
+ # Let's ensure that each slide will receive a slideIn event
+ for s in @slides
+ s.addEventListener 'slideIn', @onSlideIn.bind(this), false
+
+ # Let's ensure that 'slide-in' slide will have the right
+ # events handler
+ slides = document.querySelectorAll('.slide-in')
+ for s in slides
+ s.classList.add('off')
+ s.addEventListener 'slideIn', () ->
+ s.classList.remove('off')
+ , false
+ s.addEventListener 'slideOut', ()->
+ s.classList.add('off')
+ , false
+
+ onSlideIn: (evt)->
+ @setBackground(@getBackgroundId(evt.slide.index));
+# @domOverlay.style.opacity = 0;
+
+ parse_history: ()->
+ parts = window.location.href.split('#')
+ @current = 0
+ if parts.length == 2
+ @current = parseInt(parts[1])-1;
+ @setCurrent( @current )
+ @getCurrent().dispatchEvent();
+
+
+ setCurrent: (idx)->
+ @current = idx
+ @setHistory( idx )
+ i = 0
+ for s in @slides
+ s.setCurrentOffset(i - idx)
+ i += 1
+
+ getCurrent: ()->
+ @slides[@current]
+
+ setHistory: (idx)->
+ path = window.location.pathname + '#' + (idx+1)
+ window.history.pushState({}, null, path)
+
+ setBackground: (id)->
+ current = @backgrounds['active']
+ next = @backgrounds[id];
+ if (current != next)
+ last = @backgrounds['last']
+ if (last)
+ last.dom.classList.remove('last')
+ @domContent.appendChild(last.dom)
+ @backgrounds['last'] = null
+
+ if (current)
+ current.dom.classList.add('last')
+ @backgrounds['last'] = current
+ current.dom.classList.remove('active')
+ @backgrounds['active'] = null
+
+ if (next)
+ @backgrounds['active'] = next
+ @domBackground.appendChild(next.dom)
+ window.setTimeout ()->
+ next.dom.classList.add('active')
+ , 0
+ else
+ next.dispatchEvent()
+
+ # Get the backgroundid of the slide 'idx'
+ # or the first one found before
+ # or even the default one
+ getBackgroundId: (idx)->
+ i = idx
+ bgid = null
+ while !(bgid = @slides[i].getBackgroundId()) && i>=0
+ i -= 1
+
+ return bgid || @bgDefault
+
+new SlideManager
+
View
18 coffee/util.coffee
@@ -0,0 +1,18 @@
+# vim: ts=2 sw=2 et :
+class Util
+ constructor: ()->
+ @ua = navigator.userAgent
+ @isFF = parseFloat(@ua.split("Firefox/")[1]) || undefined;
+ @isWK = parseFloat(@ua.split("WebKit/")[1]) || undefined;
+ @isOpera = parseFloat(@ua.split("Opera/")[1]) || undefined;
+ @transitionEnd = if @isWK
+ "webkitTransitionEnd"
+ else
+ if @isFF
+ "transitionend"
+ else
+ "OTransitionEnd"
+
+
+window.Util = Util
+
View
19 css/goliath.css
@@ -0,0 +1,19 @@
+h1{text-align:center;}
+h1 .small{font-size:20%;}
+.huge{font-size:150%;}
+#me-contact{padding-left:1em;}
+#twitter,#gplus{vertical-align:middle;}
+a:link,a:visited,a:hover{text-decoration:none;}
+#io{width:75%;list-style-type:none;background-color:#E0E4CC;padding-top:1em;padding-bottom:1em;border-radius:15px;margin:0 auto;}#io li{display:-webkit-box;-webkit-box-orient:horizontal;}#io li div:first-child{-webkit-box-flex:1;}
+#io li div:last-child{margin-right:1em;}
+.hcenter{display:-webkit-box;display:-moz-box;display:-o-box;display:-ms-box;display:box;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-o-box-orient:horizontal;box-orient:horizontal;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;box-pack:center;-webkit-box-align:center;-moz-box-align:center;-o-box-align:center;box-align:center;}.hcenter *:last-child{-webkit-box-flex:1;}
+.vcenter{display:-webkit-box;display:-moz-box;display:-o-box;display:-ms-box;display:box;-webkit-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;box-orient:vertical;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;box-pack:center;}.vcenter >*{-webkit-box-flex:1;}
+.center{margin:auto 0;}
+.small{font-size:60%;}
+#test{display:-webkit-box;-webkit-box-orient:horizontal;}
+ul.bullet{list-style:none;padding:0;margin:0;}
+ul.bullet li{padding-left:1em;text-indent:-0.7em;}
+ul.bullet li:before{content:"";}
+#bg-sumo{-webkit-background-size:contain;-moz-background-size:contain;-o-background-size:contain;background-size:contain;background:url('../images/artwild1x.jpg') bottom no-repeat,#ffffff;}
+#bg-black{background:#000;}
+.title h1{color:#A7DBD8;}
View
32 css/slides.css
@@ -0,0 +1,32 @@
+@font-face{font-family:'Yanone Kaffeesatz';font-style:normal;font-weight:400;src:url('../fonts/YanoneKaffeesatz-Regular.ttf') format('truetype');}@font-face{font-family:'Permanent Marker';font-style:normal;font-weight:normal;src:local('../fonts/Permanent Marker.woff'),local('../fonts/PermanentMarker.woff'),url('../fonts/PermanentMarker.woff') format('woff');}@font-face{font-family:'Ubuntu';font-style:normal;font-weight:normal;src:local('../fonts/Ubuntu-Regular.woff'),url('../fonts/Ubuntu-Regular.woff') format('woff');}@font-face{font-family:'Lato';font-style:normal;font-weight:400;src:local('../fonts/Lato-Regular.woff'),url('../fonts/Lato-Regular.woff') format('woff');}body,html,.background,#stage,#background{width:100%;height:100%;margin:0;padding:0;font-size:15px;}
+body,html,#background{background-color:#fff;}
+#content{display:none;}
+#stage{background-color:transparent;margin:0;padding:0;position:relative;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;z-index:8;width:1150px;height:675px;}
+#background{z-index:7;position:absolute;left:0;top:0;width:100%;height:100%;}
+body{font:30px Arial;background:#000;overflow:hidden;-webkit-perspective:1000px;-moz-perspective:1000px;display:-webkit-box;display:-moz-box;display:-o-box;display:-ms-box;display:box;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;box-pack:center;-webkit-box-align:center;-moz-box-align:center;-o-box-align:center;box-align:center;}
+.slide{width:1150px;height:675px;position:absolute;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-radius:40px;background:#a7dbd8;color:#000000;padding:20px 40px;-webkit-transition:-webkit-transform 0.8s ease-in-out,opacity 1.2s ease-in-out;-moz-transition:-moz-transform 0.8s ease-in-out,opacity 1.2s ease-in-out;box-shadow:0 3px 15px #000;font:30px Arial;}.slide.current{opacity:1;z-index:9;-webkit-transform:translatez(-600px) rotatey(0deg) translatez(600px);-moz-transform:translatez(-600px) rotatey(0deg) translatez(600px);-o-transform:translatez(-600px) rotatey(0deg) translatez(600px);transform:translatez(-600px) rotatey(0deg) translatez(600px);}
+.slide.past{opacity:0.0;-webkit-transform:translatez(-600px) rotatey(-90deg) translatez(600px);-moz-transform:translatez(-600px) rotatey(-90deg) translatez(600px);-o-transform:translatez(-600px) rotatey(-90deg) translatez(600px);transform:translatez(-600px) rotatey(-90deg) translatez(600px);}
+.slide.far-past{opacity:0;-webkit-transform:translatez(-600px) rotatey(-180deg) translatez(600px);-moz-transform:translatez(-600px) rotatey(-180deg) translatez(600px);-o-transform:translatez(-600px) rotatey(-180deg) translatez(600px);transform:translatez(-600px) rotatey(-180deg) translatez(600px);}
+.slide.future{opacity:0;-webkit-transform:translatez(-600px) rotatey(90deg) translatez(600px);-moz-transform:translatez(-600px) rotatey(90deg) translatez(600px);-o-transform:translatez(-600px) rotatey(90deg) translatez(600px);transform:translatez(-600px) rotatey(90deg) translatez(600px);}
+.slide.far-future{opacity:0;-webkit-transform:translatez(-600px) rotatey(180deg) translatez(600px);-moz-transform:translatez(-600px) rotatey(180deg) translatez(600px);-o-transform:translatez(-600px) rotatey(180deg) translatez(600px);transform:translatez(-600px) rotatey(180deg) translatez(600px);}
+.slide.transparent{background:transparent;color:#fff;box-shadow:none;}
+.slide{-webkit-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;box-orient:vertical;overflow:hidden;}.slide>section{max-width:100%;margin:20px 0;}
+.slide>header{position:absolute;left:40px;top:20px;}
+.centercontents{display:-webkit-box;display:-moz-box;display:-o-box;display:-ms-box;display:box;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;box-pack:center;-webkit-box-align:center;-moz-box-align:center;-o-box-align:center;box-align:center;}
+.centertext{text-align:center;}
+header{font:40px 'Cabin',Arial;color:#0054AB;text-shadow:white 0px 2px 0px,rgba(0, 0, 0, 0.2) 0 2px 5px;}
+section{font:30px 'Lato','Ubuntu',Arial;font-weight:normal;color:#3f3f3f;text-shadow:white 0px 1px 0px,rgba(0, 0, 0, 0.2) 0 2px 5px;}
+h1,h2{font-size:150%;font-family:'Yanone Kaffeesatz';margin-top:0;}
+.title h1{font-size:500%;text-shadow:black 0 2px 5px;text-align:center;}
+.title .author{font-family:'Ubuntu';text-align:right;margin-top:5em;font-style:italic;}
+.highlight{display:inline-block;padding:3px 5px;border-radius:5px;color:#fff;background:#f38630;-webkit-text-shadow:0 1px 4px #000000;-moz-text-shadow:0 1px 4px #000000;-o-text-shadow:0 1px 4px #000000;text-shadow:0 1px 4px #000000;}
+.slide-in section{-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-o-box-orient:horizontal;box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-o-box;display:-ms-box;display:box;}
+.slide-in-left,.slide-in-right{-webkit-transition:-webkit-transform 0.6s ease-out,opacity 1s ease-out;}
+.slide-in .slide-in-right{-webkit-transform:translatex(0px);opacity:1;}
+.slide-in .slide-in-left{-webkit-transform:translatex(0px);opacity:1;}
+.slide-in.off .slide-in-left{-webkit-transform:translatex(-400px);opacity:0;}
+.slide-in.off .slide-in-right{-webkit-transform:translatex(400px);opacity:0;}
+pre code{border-radius:15px;}
+.background,#stage{background-color:transparent;}
+.background{position:absolute;z-index:1;opacity:0;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out;}.background.last{z-index:2;opacity:1;}
+.background.active{z-index:3;opacity:1;display:block;}
View
BIN  fonts/Lato-Regular.woff
Binary file not shown
View
BIN  fonts/PermanentMarker.woff
Binary file not shown
View
BIN  fonts/Ubuntu-Regular.woff
Binary file not shown
View
BIN  fonts/YanoneKaffeesatz-Regular.ttf
Binary file not shown
View
206 goliath.html
@@ -0,0 +1,206 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <title> Goliath ... a tiny GIANT</title>
+ <link href="css/slides.css" rel="stylesheet" type="text/css">
+ <link href="css/goliath.css" rel="stylesheet" type="text/css">
+ <link rel="stylesheet" href="js/highlight/styles/solarized_light.css">
+ </head>
+ <body>
+ <div id="content" class="hidden">
+ <div id="bg-black" class="background"></div>
+ <div id="bg-sumo" class="background"></div>
+
+
+ <div class="slide title centercontents transparent" data-backgroundid="bg-sumo">
+ <h1>Goliath ... a <span class="small">tiny</span> <span class="huge">GIANT</span></h1>
+ <section class="author">
+ F. Ros @ Riviera.rb
+ </section>
+ </div>
+ <div class="slide slide-in" data-backgroundid="bg-black">
+ <section class="hcenter">
+ <div class="slide-in-left">
+ <img id="me" src="images/fred2.png" alt="Frederick Ros">
+ </div>
+ <div id="me-contact" class="slide-in-right">
+ <h1>Frederick Ros</h1>
+ <p>Senior Manager, aMaDEUS</p>
+ <p>Dev addict</p>
+ <p><img id="twitter" src="images/twitter.png" alt="twitter"/><a href="http://twitter.com/#!/sl33p3r">@sl33p3r</a></p>
+ <p><img id="gplus" src="images/gplus.png"alt="google+"/><a href="https://plus.google.com/112360515366365281857">+Frederick Ros</a></p>
+ </div>
+ </section>
+ </div>
+
+ <div class="slide vcenter">
+ <h1>The IO issue</h1>
+ <section>
+ <ul id="io">
+ <li><div>L1-cache</div> <div>3 cycles</div></li>
+ <li><div>L2-cache</div> <div>14 cycles</div></li>
+ <li><div>RAM</div> <div>250 cycles</div></li>
+ <li><div>Disk</div> <div class="highlight">41 000 000 cycles</div></li>
+ <li><div>Network</div> <div class="highlight">240 000 000 cycles</div></li>
+ </ul>
+ </section>
+ </div>
+
+ <div class="slide centercontents">
+ <h1>Traditional web servers</h1>
+ <img alt="IO jam" src="images/io.jpg"/>
+ </div>
+ <div class="slide">
+ <h1>Enters the Reactor</h1>
+ <section>
+ <p>Single threaded while loop.</p>
+ <p>Your code reacts to incoming events</p>
+ <p><div class="highlight">Watch out</div>: do not block the reactor !!</p>
+ <pre><code>
+while reactor_running?
+ expired_timers.each {|timer| timer.process }
+ new_network_io.each {|io| io.process }
+end
+ </code></pre>
+ </section>
+ </div>
+
+ <div class="slide vcenter centertext">
+ <h1>... and EventMachine</h1>
+ <section>
+ <div class="center">
+ <p>Reactor pattern (i.e. event driven)</p>
+ <p>+</p>
+ <p>Asynchronous code </p>
+ </div>
+ </section>
+ </div>
+ <div class="slide">
+ <h1>Spaghetti code !</h1>
+ <section>
+ Writing evented code is hard ... and ugly !
+ <pre><code>
+db.find_url { |url|
+ http.get(url) { |response|
+ email.send(response) {
+ puts 'email sent'
+ }
+ }
+}
+ </code></pre>
+ </section>
+ </div>
+
+ <div class="slide">
+ <h1>EM::Synchrony ?</h1>
+ <section>
+ <div class="small">
+ <pre><code>
+EventMachine.run {
+ page = EventMachine::HttpRequest.new('http://google.com/').get
+ page.errback { p "Google is down! terminate?" }
+ page.callback {
+ about = EventMachine::HttpRequest.new('http://google.com/search?q=eventmachine').get
+ about.callback { # callback nesting, ad infinitum }
+ about.errback { # error-handling code }
+ }
+}
+ </code></pre>
+ ... + Fibers (on MRI 1.9.x) becomes ...
+ <pre><code>
+EventMachine.synchrony do
+ page = EventMachine::HttpRequest.new("http://www.google.com").get
+ about = EventMachine::HttpRequest.new('http://google.com/search?q=eventmachine').get
+ EventMachine.stop
+end
+ </code></pre>
+ </div>
+ </section>
+ </div>
+
+ <div class="slide">
+ <h1>Goliath</h1>
+ <section>
+ <ul>
+ <li>Mix EventMachine and EM::Synchrony</li>
+ <li>Let PostRank iterates on this ...</li>
+ </ul>
+ <div class="small">
+ <pre><code>
+require 'goliath'
+
+class Hello < Goliath::API
+ # default to JSON output, allow Yaml as secondary
+ use Goliath::Rack::Render, ['json', 'yaml']
+
+ def response(env)
+ [200, {}, "Hello World"]
+ end
+end
+
+# > ruby hello.rb -sv
+# > [97570:INFO] 2011-02-15 00:33:51 :: Starting server on 0.0.0.0:9000 in development mode. Watch out for stones.
+ </code></pre>
+ </div>
+ </section>
+ </div>
+
+ <div class="slide">
+ <h1>Goliath</h1>
+ <section>
+ <ul class="bullet">
+ <li>App server</li>
+ <li>Fully-asynchronous</li>
+ <li>Streaming support</li>
+ <li>Middleware support</li>
+ <li>Simple configuration</li>
+ <li>High performance: around 3000 req/s</li>
+ <li>Readable and maitainable code</li>
+ </ul>
+ </section>
+ </div>
+
+ <div class="slide">
+ <h1>Bonus</h1>
+ <section>
+ <ul class="bullet">
+ <li>Middlewares</li>
+ <li>Async Upload</li>
+ <li>Streaming API</li>
+ <li>Routing</li>
+ <li>Websockets</li>
+ <li>Integration testing</li>
+ </ul>
+ </section>
+ </div>
+
+ <div class="slide">
+ <h1>Use cases</h1>
+ <section>
+ <ul class="bullet">
+ <li>Interface with dbs</li>
+ <li>Proxying remote web-services</li>
+ <li>Streaming API</li>
+ <li>Websockets server</li>
+ </ul>
+ </section>
+ </div>
+ <div class="slide">
+ <h1>Demo time</h1>
+ <section>
+ Stream Twitter search over a websocket !
+ </section>
+ </div>
+
+ </div>
+ <div id="background"></div>
+ <div id="stage"> </div>
+ <script src="js/highlight/highlight.pack.js"></script>
+ <script src="js/slides.js"></script>
+ <script type="text/javascript">
+ hljs.initHighlightingOnLoad();
+ </script>
+ </body>
+</html>
+
View
BIN  images/artwild1x.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/fred2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/gplus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/image004.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/io.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/twitter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1  js/highlight
View
46 js/highlight.js-6.1/AUTHORS.en.txt
@@ -0,0 +1,46 @@
+Syntax highlighting with language autodetection.
+
+URL: http://softwaremaniacs.org/soft/highlight/en/
+
+Original author and current maintainer:
+Ivan Sagalaev <maniac@softwaremaniacs.org>
+
+Contributors:
+
+- Peter Leonov <gojpeg@gmail.com>
+- Victor Karamzin <Victor.Karamzin@enterra-inc.com>
+- Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
+- Anton Kovalyov <anton@kovalyov.net>
+- Nikita Ledyaev <lenikita@yandex.ru>
+- Konstantin Evdokimenko <qewerty@gmail.com>
+- Dmitri Roudakov <dmitri@roudakov.ru>
+- Yuri Ivanov <ivanov@supersoft.ru>
+- Vladimir Ermakov <vooon341@mail.ru>
+- Vladimir Gubarkov <xonixx@gmail.com>
+- Brian Beck <exogen@gmail.com>
+- MajestiC <majestic2k@gmail.com>
+- Vasily Polovnyov <vast@whiteants.net>
+- Vladimir Epifanov <voldmar@voldmar.ru>
+- Alexander Makarov (http://rmcreative.ru/)
+- Vah <vahtenberg@gmail.com>
+- Shuen-Huei Guan <drake.guan@gmail.com>
+- Jason Diamond <jason@diamond.name>
+- Michal Gabrukiewicz <mgabru@gmail.com>
+- Ruslan Keba <rukeba@gmail.com>
+- Sergey Baranov <segyrn@yandex.ru>
+- Zaripov Yura <yur4ik7@ukr.net>
+- Oleg Volchkov <oleg@volchkov.net>
+- Vasily Mikhailitchenko <vaskas@programica.ru>
+- Jan Berkel <jan.berkel@gmail.com>
+- Vladimir Moskva <vladmos@gmail.com>
+- Loren Segal <lsegal@soen.ca>
+- Andrew Fedorov <dmmdrs@mail.ru>
+- Igor Kalnitsky <igor.kalnitsky@gmail.com>
+- Jeremy Hull <sourdrums@gmail.com>
+- Valerii Hiora <valerii.hiora@gmail.com>
+- Nikolay Zakharov <nikolay.desh@gmail.com>
+- Dmitry Kovega <arhibot@gmail.com>
+- Sergey Ignatov <sergey@ignatov.spb.su>
+- Antono Vasiljev <self@antono.info>
+- Stephan Kountso <steplg@gmail.com>
+- pumbur <pumbur@pumbur.net>
View
46 js/highlight.js-6.1/AUTHORS.ru.txt
@@ -0,0 +1,46 @@
+Подсветка синтаксиса с автоопределением языка.
+
+URL: http://softwaremaniacs.org/soft/highlight/
+
+Первоначальный автор и ведущий проекта:
+Иван Сагалаев <maniac@softwaremaniacs.org>
+
+Внесли свой вклад:
+
+- Петр Леонов <gojpeg@gmail.com>
+- Виктор Карамзин <Victor.Karamzin@enterra-inc.com>
+- Всеволод Соловьёв <vsevolod.solovyov@gmail.com>
+- Антон Ковалёв <anton@kovalyov.net>
+- Никита Ледяев <lenikita@yandex.ru>
+- Константин Евдокименко <qewerty@gmail.com>
+- Дмитрий Рудаков <dmitri@roudakov.ru>
+- Юрий Иванов <ivanov@supersoft.ru>
+- Владимир Ермаков <vooon341@mail.ru>
+- Владимир Губарьков <xonixx@gmail.com>
+- Брайан Бек <exogen@gmail.com>
+- MajestiC <majestic2k@gmail.com>
+- Василий Половнёв <vast@whiteants.net>
+- Владимир Епифанов <voldmar@voldmar.ru>
+- Александр Макаров (http://rmcreative.ru/)
+- Vah <vahtenberg@gmail.com>
+- Шуэн-Хуэй Гуан <drake.guan@gmail.com>
+- Джейсон Даймонд <jason@diamond.name>
+- Михал Габрукевич <mgabru@gmail.com>
+- Руслан Кеба <rukeba@gmail.com>
+- Сергей Баранов <segyrn@yandex.ru>
+- Зарипов Юра <yur4ik7@ukr.net>
+- Олег Волчков <oleg@volchkov.net>
+- Василий Михайличенко <vaskas@programica.ru>
+- Ян Беркель <jan.berkel@gmail.com>
+- Владимир Москва <vladmos@gmail.com>
+- Лорен Сегал <lsegal@soen.ca>
+- Андрей Фёдоров <dmmdrs@mail.ru>
+- Игорь Кальницкий <igor.kalnitsky@gmail.com>
+- Джереми Халл <sourdrums@gmail.com>
+- Валерий Хиора <valerii.hiora@gmail.com>
+- Николай Захаров <nikolay.desh@gmail.com>
+- Дмитрий Ковега <arhibot@gmail.com>
+- Сергей Игнатов <sergey@ignatov.spb.su>
+- Антоно Васильев <self@antono.info>
+- Степан Кунцьо <steplg@gmail.com>
+- pumbur <pumbur@pumbur.net>
View
24 js/highlight.js-6.1/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2006, Ivan Sagalaev
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of highlight.js nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
136 js/highlight.js-6.1/README.md
@@ -0,0 +1,136 @@
+# Highlight.js
+
+Highlight.js highlights syntax in code examples on blogs, forums and,
+in fact, on any web page. It's very easy to use because it works
+automatically: finds blocks of code, detects a language, highlights it.
+
+Autodetection can be fine tuned when it fails by itself (see "Heuristics").
+
+
+## Installation and usage
+
+The download package includes the file "highlight.pack.js" which is a full
+compressed version of the library intended for use in production. All
+uncompressed source files are also available, feel free to look into them!
+
+The script is installed by linking to a single file and making a single
+initialization call:
+
+```html
+<script type="text/javascript" src="highlight.pack.js"></script>
+<script type="text/javascript">
+ hljs.initHighlightingOnLoad();
+</script>
+```
+
+Also you can replace TAB ('\x09') characters used for indentation in your code
+with some fixed number of spaces or with a `<span>` to give them special
+styling:
+
+```html
+<script type="text/javascript">
+ hljs.tabReplace = ' '; // 4 spaces
+ // ... or
+ hljs.tabReplace = '<span class="indent">\t</span>';
+
+ hljs.initHighlightingOnLoad();
+</script>
+```
+
+The script looks in your page for fragments `<pre><code>...</code></pre>`
+that are traditionally used to mark up code examples. Their content is
+marked up by logical pieces with defined class names.
+
+
+### Custom initialization
+
+If you use different markup for code blocks you can initialize them manually
+with `highlightBlock(code, tabReplace)` function. It takes a DOM element
+containing the code to highlight and optionally a string with which to replace
+TAB characters.
+
+Initialization using, for example, jQuery might look like this:
+
+```javascript
+$(document).ready(function() {
+ $('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')});
+});
+```
+
+If your code container relies on `<br>` tags instead of line breaks (i.e. if
+it's not `<pre>`) pass `true` into third parameter of `highlightBlock`:
+
+```javascript
+$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)});
+```
+
+### Styling
+
+Elements of code marked up with classes can be styled as desired:
+
+```css
+.comment {
+ color: gray;
+}
+
+.keyword {
+ font-weight: bold;
+}
+
+.python .string {
+ color: blue;
+}
+
+.html .atribute .value {
+ color: green;
+}
+```
+
+Highlight.js comes with several style themes located in "styles" directory that
+can be used directly or as a base for your own experiments.
+
+For full reference list of classes see [classref.txt][cr].
+
+[cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt
+
+
+## Export
+
+File export.html contains a little program that allows you to paste in a code
+snippet and then copy and paste the resulting HTML code generated by the
+highlighter. This is useful in situations when you can't use the script itself
+on a site.
+
+
+## Heuristics
+
+Autodetection of a code's language is done using a simple heuristic:
+the program tries to highlight a fragment with all available languages and
+counts all syntactic structures that it finds along the way. The language
+with greatest count wins.
+
+This means that in short fragments the probability of an error is high
+(and it really happens sometimes). In this cases you can set the fragment's
+language explicitly by assigning a class to the `<code>` element:
+
+```html
+<pre><code class="html">...</code></pre>
+```
+
+You can use class names recommended in HTML5: "language-html",
+"language-php". Classes also can be assigned to the `<pre>` element.
+
+To disable highlighting of a fragment altogether use "no-highlight" class:
+
+```html
+<pre><code class="no-highlight">...</code></pre>
+```
+
+## Meta
+
+- Version: 6.1
+- URL: http://softwaremaniacs.org/soft/highlight/en/
+- Author: Ivan Sagalaev (<maniac@softwaremaniacs.org>)
+
+For the license terms see LICENSE files.
+For the list of contributors see AUTHORS.en.txt file.
View
140 js/highlight.js-6.1/README.ru.md
@@ -0,0 +1,140 @@
+# Highlight.js
+
+Highlight.js нужен для подсветки синтаксиса в примерах кода в блогах,
+форумах и вообще на любых веб-страницах. Пользоваться им очень просто,
+потому что работает он автоматически: сам находит блоки кода, сам
+определяет язык, сам подсвечивает.
+
+Автоопределением языка можно управлять, когда оно не справляется само (см.
+дальше "Эвристика").
+
+
+## Подключение и использование
+
+В загруженном архиве лежит файл "highlight.pack.js" -- полная сжатая версия
+библиотеки для работы. Все несжатые исходные файлы также есть в пакете, поэтому
+не стесняйтесь в них смотреть!
+
+Скрипт подключается одним файлом и одним вызовом инициализирующей
+функции:
+
+```html
+<script type="text/javascript" src="highlight.pack.js"></script>
+<script type="text/javascript">
+ hljs.initHighlightingOnLoad();
+</script>
+```
+
+Также вы можете заменить символы TAB ('\x09'), используемые для отступов, на
+фиксированное количество пробелов или на отдельный `<span>`, чтобы задать ему
+какой-нибудь специальный стиль:
+
+```html
+<script type="text/javascript">
+ hljs.tabReplace = ' '; // 4 spaces
+ // ... or
+ hljs.tabReplace = '<span class="indent">\t</span>';
+
+ hljs.initHighlightingOnLoad();
+</script>
+```
+
+Дальше скрипт ищет на странице конструкции `<pre><code>...</code></pre>`,
+которые традиционно используются для написания кода, и код в них
+размечается на куски, помеченные разными значениями классов.
+
+
+### Инициализация вручную
+
+Если вы используете другие теги для блоков кода, вы можете инициализировать их
+явно с помощью функции `highlightBlock(code, tabReplace)`. Она принимает
+DOM-элемент с текстом расцвечиваемого кода и опционально - строчку для замены
+символов TAB.
+
+Например с использованием jQuery код инициализации может выглядеть так:
+
+```javascript
+$(document).ready(function() {
+ $('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')});
+});
+```
+
+Если ваш блок кода использует `<br>` вместо переводов строки (т.е. если это не
+`<pre>`), передайте `true` третьим параметром в `highlightBlock`:
+
+```javascript
+$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)});
+```
+
+### Выбор стилей
+
+Размеченным классами элементам кода можно задать желаемые стили например так:
+
+```css
+.comment {
+ color: gray;
+}
+
+.keyword {
+ font-weight: bold;
+}
+
+.python .string {
+ color: blue;
+}
+
+.html .atribute .value {
+ color: green;
+}
+```
+
+В комплекте с highlight.js идут несколько стилевых тем в директории styles,
+которые можно использовать напрямую или как основу для собственных экспериментов.
+
+Полный список классов приведён в файле [crossref.txt][cr].
+
+[cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt
+
+
+## Экспорт
+
+В файле export.html находится небольшая программка, которая показывает и дает
+скопировать непосредственно HTML-код подсветки для любого заданного фрагмента кода.
+Это может понадобится например на сайте, на котором нельзя подключить сам скрипт
+highlight.js.
+
+
+## Эвристика
+
+Определение языка, на котором написан фрагмент, делается с помощью
+довольно простой эвристики: программа пытается расцветить фрагмент всеми
+языками подряд, и для каждого языка считает количество подошедших
+синтаксически конструкций и ключевых слов. Для какого языка нашлось больше,
+тот и выбирается.
+
+Это означает, что в коротких фрагментах высока вероятность ошибки, что
+периодически и случается. Чтобы указать язык фрагмента явно, надо написать
+его название в виде класса к элементу `<code>`:
+
+```html
+<pre><code class="html">...</code></pre>
+```
+
+Можно использовать рекомендованные в HTML5 названия классов:
+"language-html", "language-php". Также можно назначать классы на элемент
+`<pre>`.
+
+Чтобы запретить расцветку фрагмента вообще, используется класс "no-highlight":
+
+```html
+<pre><code class="no-highlight">...</code></pre>
+```
+
+## Координаты
+
+- Версия: 6.1
+- URL: http://softwaremaniacs.org/soft/highlight/
+- Автор: Иван Сагалаев (<maniac@softwaremaniacs.org>)
+
+Лицензионное соглашение читайте в файле LICENSE.
+Список соавторов читайте в файле AUTHORS.ru.txt
View
437 js/highlight.js-6.1/classref.txt
@@ -0,0 +1,437 @@
+This is a full list of available classes corresponding to languages'
+syntactic structures. The parentheses after language name contain identifiers
+used as class names in `<code>` element.
+
+Python ("python"):
+
+ keyword keyword
+ built_in built-in objects (None, False, True and Ellipsis)
+ number number
+ string string (of any type)
+ comment comment
+ decorator @-decorator for functions
+ function function header "def some_name(...):"
+ class class header "class SomeName(...):"
+ title name of a function or a class inside a header
+ params everything inside parentheses in a function's or class' header
+
+Python profiler results ("profile"):
+
+ number number
+ string string
+ builtin builtin function entry
+ filename filename in an entry
+ summary profiling summary
+ header header of table of results
+ keyword column header
+ function function name in an entry (including parentheses)
+ title actual name of a function in an entry (excluding parentheses)
+
+Ruby ("ruby"):
+
+ keyword keyword
+ string string
+ subst in-string substitution (#{...})
+ comment comment
+ yardoctag YARD tag
+ function function header "def some_name(...):"
+ class class header "class SomeName(...):"
+ title name of a function or a class inside a header
+ parent name of a parent class
+ symbol symbol
+ instancevar instance variable
+
+Perl ("perl"):
+
+ keyword keyword
+ comment comment
+ number number
+ string string
+ regexp regular expression
+ sub subroutine header (from "sub" till "{")
+ variable variable starting with "$", "%", "@"
+ operator operator
+ pod plain old doc
+
+PHP ("php"):
+
+ keyword keyword
+ number number
+ string string (of any type)
+ comment comment
+ phpdoc phpdoc params in comments
+ variable variable starting with "$"
+ preprocessor preprocessor marks: "<?php" and "?>"
+
+Scala ("scala"):
+
+ keyword keyword
+ number number
+ string string
+ comment comment
+ annotaion annotation
+ javadoc javadoc comment
+ javadoctag @-tag in javadoc
+ class class header
+ title class name inside a header
+ params everything in parentheses inside a class header
+ inheritance keywords "extends" and "with" inside class header
+
+Go language ("go"):
+ comment comment
+ string string constant
+ number number
+ keyword language keywords
+ constant true false nil iota
+ typename built-in plain types (int, string etc.)
+ built_in built-in functions
+
+XML ("xml"):
+
+ tag any tag from "<" till ">"
+ comment comment
+ pi processing instruction (<? ... ?>)
+ cdata CDATA section
+ attribute attribute
+ value attribute's value
+
+HTML ("html"):
+
+ keyword HTML tag
+ tag any tag from "<" till ">"
+ comment comment
+ doctype <!DOCTYPE ... > declaration
+ attribute tag's attribute with or without value
+ value attribute's value
+
+CSS ("css"):
+
+ tag HTML tag in selectors
+ id #some_name in selectors
+ class .some_name in selectors
+ at_rule @-rule till first "{" or ";"
+ attr_selector attribute selector (square brackets in a[href^=http://])
+ pseudo pseudo classes and elemens (:after, ::after etc.)
+ comment comment
+ rules everything from "{" till "}"
+ property property name inside a rule
+ value property value inside a rule, from ":" till ";" or
+ till the end of rule block
+ number number within a value
+ string string within a value
+ hexcolor hex color (#FFFFFF) within a value
+ function CSS function within a value
+ params everything between "(" and ")" within a function
+ important "!important" symbol
+
+Django ("django"):
+
+ keyword HTML tag in HTML, default tags and default filters in templates
+ tag any tag from "<" till ">"
+ comment comment
+ doctype <!DOCTYPE ... > declaration
+ attribute tag's attribute with or withou value
+ value attribute's value
+ template_tag template tag {% .. %}
+ variable template variable {{ .. }}
+ template_comment template comment, both {# .. #} and {% comment %}
+ filter filter from "|" till the next filter or the end of tag
+ argument filter argument
+
+Javascript ("javascript"):
+
+ keyword keyword
+ comment comment
+ number number
+ literal special literal: "true", "false" and "null"
+ string string
+ regexp regular expression
+ function header of a function
+ title name of a function inside a header
+ params everything inside parentheses in a function's header
+
+VBScript ("vbscript"):
+
+ keyword keyword
+ number number
+ string string
+ comment comment
+ built_in built-in function
+
+Lua ("lua"):
+
+ keyword keyword
+ number number
+ string string
+ comment comment
+ built_in built-in operator
+ function header of a function
+ title name of a function inside a header
+ params everything inside parentheses in a function's header
+ long_brackets multiline string in [=[ .. ]=]
+
+Delphi ("delphi"):
+
+ keyword keyword
+ comment comment (of any type)
+ number number
+ string string
+ function header of a function, procedure, constructor and destructor
+ title name of a function, procedure, constructor or destructor
+ inside a header
+ params everything inside parentheses in a function's header
+ class class' body from "= class" till "end;"
+
+Java ("java"):
+
+ keyword keyword
+ number number
+ string string
+ comment commment
+ annotaion annotation
+ javadoc javadoc comment
+ class class header from "class" till "{"
+ title class name inside a header
+ params everything in parentheses inside a class header
+ inheritance keywords "extends" and "implements" inside class header
+
+C++ ("cpp"):
+
+ keyword keyword
+ number number
+ string string and character
+ comment comment
+ preprocessor preprocessor directive
+ stl_container instantiation of STL containers ("vector<...>")
+
+Objective C ("objectivec"):
+ keyword keyword
+ built_in Cocoa/Cocoa Touch constants and classes
+ number number
+ string string
+ comment comment
+ preprocessor preprocessor directive
+ class interface/implementation, protocol and forward class declaration
+
+Vala ("vala"):
+
+ keyword keyword
+ number number
+ string string
+ comment comment
+ class class definitions
+ title in class definition
+ constant ALL_UPPER_CASE
+
+C# ("cs"):
+
+ keyword keyword
+ number number
+ string string
+ comment commment
+ xmlDocTag xmldoc tag ("///", "<!--", "-->", "<..>")
+
+RenderMan RSL ("rsl"):
+
+ keyword keyword
+ number number
+ string string (including @"..")
+ comment comment
+ preprocessor preprocessor directive
+ shader sahder keywords
+ shading shading keywords
+ built_in built-in function
+
+RenderMan RIB ("rib"):
+
+ keyword keyword
+ number number
+ string string
+ comment comment
+ commands command
+
+Maya Embedded Language ("mel"):
+
+ keyword keyword
+ number number
+ string string
+ comment comment
+ variable variable
+
+SQL ("sql"):
+
+ keyword keyword (mostly SQL'92 and SQL'99)
+ number number
+ string string (of any type: "..", '..', `..`)
+ comment comment
+ aggregate aggregate function
+
+Smalltalk ("smalltalk"):
+
+ keyword keyword
+ number number
+ string string
+ comment commment
+ symbol symbol
+ array array
+ class name of a class
+ char char
+ localvars block of local variables
+
+Lisp ("lisp"):
+
+ keyword keyword
+ number number
+ string string
+ comment commment
+ variable variable
+ literal b, t and nil
+ list non-quoted list
+ title first symbol in a non-quoted list
+ body remainder of the non-quoted list
+ quoted quoted list, both "(quote .. )" and "'(..)"
+
+Ini ("ini"):
+
+ title title of a section
+ value value of a setting of any type
+ string string
+ number number
+ keyword boolean value keyword
+
+Apache ("apache"):
+
+ keyword keyword
+ number number
+ comment commment
+ literal On and Off
+ sqbracket variables in rewrites "%{..}"
+ cbracket options in rewrites "[..]"
+ tag begin and end of a configuration section
+
+Nginx ("nginx"):
+
+ keyword keyword
+ string string
+ number number
+ comment comment
+ built_in built-in constant
+ variable $-variable
+
+Diff ("diff"):
+
+ header file header
+ chunk chunk header within a file
+ addition added lines
+ deletion deleted lines
+ change changed lines
+
+DOS ("dos"):
+
+ keyword keyword
+ flow batch control keyword
+ stream DOS special files ("con", "prn", ...)
+ winutils some commands (see dos.js specifically)
+ envvar environment variables
+
+Bash ("bash"):
+
+ keyword keyword
+ string string
+ number number
+ comment comment
+ literal special literal: "true" и "false"
+ variable variable
+ shebang script interpreter header
+
+CMake ("cmake")
+
+ keyword keyword
+ number number
+ string string
+ comment commment
+ envvar $-variable
+
+Axapta ("axapta"):
+
+ keyword keyword
+ number number
+ string string
+ comment commment
+ class class header from "class" till "{"
+ title class name inside a header
+ params everything in parentheses inside a class header
+ inheritance keywords "extends" and "implements" inside class header
+ preprocessor preprocessor directive
+
+1C ("1c"):
+
+ keyword keyword
+ number number
+ date date
+ string string
+ comment commment
+ function header of function or procudure
+ title function name inside a header
+ params everything in parentheses inside a function header
+ preprocessor preprocessor directive
+
+AVR assembler ("avrasm"):
+
+ keyword keyword
+ built_in pre-defined register
+ number number
+ string string
+ comment commment
+ label label
+ preprocessor preprocessor directive
+ localvars substitution in .macro
+
+VHDL ("vhdl")
+
+ keyword keyword
+ number number
+ string string
+ comment commment
+ literal signal logical value
+
+Parser3 ("parser3"):
+
+ keyword keyword
+ number number
+ comment commment
+ variable variable starting with "$"
+ preprocessor preprocessor directive
+ title user-defined name starting with "@"
+
+TeX ("tex"):
+
+ comment comment
+ number number
+ command command
+ parameter parameter
+ formula formula
+ special special symbol
+
+Haskell ("haskell"):
+
+ keyword keyword
+ built_in built-in typeclass/functions (Bool, Int)
+ number number
+ string string
+ comment comment
+ class type classes and other data types
+ title function name
+ label type class name
+
+Erlang ("erlang"):
+
+ comment comment
+ string string
+ number number
+ keyword keyword
+ record_name record access (#record_name)
+ title name of declaration function
+ variable variable (starts with capital letter or with _)
+ pp.keywords module's attribute (-attribute)
+ function_name atom or atom:atom in case of function call
View
87 js/highlight.js-6.1/export.html
@@ -0,0 +1,87 @@
+<!-- saved from url=(0013)about:internet -->
+<!-- ^^^ This is for IE not to show security warning for local files,
+see http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2brows.mspx-->
+
+<!--
+Highlighted code export
+Copyright (c) Vladimir Gubarkov <xonixx@gmail.com>
+-->
+
+<html>
+ <head>
+ <title>Highlited code export</title>
+ <link rel="stylesheet" href="styles/default.css">
+ <meta charset="utf-8">
+ <style type="text/css">
+ #t1, #t2 { width: 100%;}
+ tr { vertical-align: top; }
+ address { margin-top: 4em; }
+ </style>
+ <script src="highlight.pack.js"></script>
+ <script>hljs.initHighlightingOnLoad();</script>
+ </head>
+ <body>
+ <script type="text/javascript">
+ String.prototype.escape = function() {
+ return this.replace(/&/gm, '&amp;').replace(/</gm, '&lt;').replace(/>/gm, '&gt;');
+ }
+
+ function doIt() {
+ var viewDiv = document.getElementById("highlight-view");
+ var t1 = document.getElementById("t1");
+ var t2 = document.getElementById("t2");
+ var selector = document.getElementById("langSelector");
+ var selectedLang = selector.options[selector.selectedIndex].value.toLowerCase();
+ if(selectedLang) {
+ viewDiv.innerHTML = '<pre><code class="'+selectedLang+'">'+t1.value.escape()+"</code></pre>";
+ } else { // try auto
+ viewDiv.innerHTML = '<pre><code>' + t1.value.escape() + "</code></pre>";
+ }
+ hljs.highlightBlock(viewDiv.firstChild.firstChild);
+ t2.value = viewDiv.innerHTML;
+ }
+
+ function copyToBuffer(textToCopy) {
+ if (window.clipboardData) { // IE
+ window.clipboardData.setData("Text", textToCopy);
+ } else if (window.netscape) { // FF
+ // from http://developer.mozilla.org/en/docs/Using_the_Clipboard
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+ var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
+ gClipboardHelper.copyString(textToCopy);
+ }
+ }
+ </script>
+ <script type="text/javascript">
+ var langSelectorHtml = '<label>Language <select id="langSelector">';
+ langSelectorHtml += '<option value="">Auto</option>';
+ for (var i in hljs.LANGUAGES) {
+ if (hljs.LANGUAGES.hasOwnProperty(i))
+ langSelectorHtml += '<option value=\"'+i+'\">'+i.charAt(0).toUpperCase()+i.substr(1)+'</option>';
+ }
+ langSelectorHtml += '</select></label>';
+ document.write(langSelectorHtml);
+ </script>
+ <table width="100%">
+ <tr>
+ <td><textarea rows="20" cols="50" id="t1"></textarea></td>
+ <td><textarea rows="20" cols="50" id="t2"></textarea></td>
+ </tr>
+ <tr>
+ <td>Write a code snippet</td>
+ <td>Get HTML to paste anywhere (for actual styles and colors see sample.css)</td>
+ </tr>
+ </table>
+ <table width="98%">
+ <tr>
+ <td><input type="button" value="Export &rarr;" onclick="doIt()"/></td>
+ <td align="right"><input type="button" value="Copy to buffer" onclick="copyToBuffer(document.getElementById('t2').value);"/></td>
+ </tr>
+ </table>
+ <div id="highlight-view"></div>
+ <address>
+ Export script: <a href="mailto:xonixx@gmail.com">Vladimir Gubarkov</a><br>
+ Highlighting: <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js</a>
+ </address>
+ </body>
+</html>
View
1  js/highlight.js-6.1/highlight
View
630 js/highlight.js-6.1/highlight.js
@@ -0,0 +1,630 @@
+/*
+Syntax highlighting with language autodetection.
+http://softwaremaniacs.org/soft/highlight/
+*/
+
+var hljs = new function() {
+
+ /* Utility functions */
+
+ function escape(value) {
+ return value.replace(/&/gm, '&amp;').replace(/</gm, '&lt;');
+ }
+
+ function langRe(language, value, global) {
+ return RegExp(
+ value,
+ 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '')
+ );
+ }
+
+ function findCode(pre) {
+ for (var i = 0; i < pre.childNodes.length; i++) {
+ var node = pre.childNodes[i];
+ if (node.nodeName == 'CODE')
+ return node;
+ if (!(node.nodeType == 3 && node.nodeValue.match(/\s+/)))
+ break;
+ }
+ }
+
+ function blockText(block, ignoreNewLines) {
+ var result = '';
+ for (var i = 0; i < block.childNodes.length; i++)
+ if (block.childNodes[i].nodeType == 3) {
+ var chunk = block.childNodes[i].nodeValue;
+ if (ignoreNewLines)
+ chunk = chunk.replace(/\n/g, '');
+ result += chunk;
+ } else if (block.childNodes[i].nodeName == 'BR')
+ result += '\n';
+ else
+ result += blockText(block.childNodes[i]);
+ // Thank you, MSIE...
+ if (/MSIE [678]/.test(navigator.userAgent))
+ result = result.replace(/\r/g, '\n');
+ return result;
+ }
+
+ function blockLanguage(block) {
+ var classes = block.className.split(/\s+/)
+ classes = classes.concat(block.parentNode.className.split(/\s+/));
+ for (var i = 0; i < classes.length; i++) {
+ var class_ = classes[i].replace(/^language-/, '');
+ if (languages[class_] || class_ == 'no-highlight') {
+ return class_;
+ }
+ }
+ }
+
+ /* Stream merging */
+
+ function nodeStream(node) {
+ var result = [];
+ (function (node, offset) {
+ for (var i = 0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType == 3)
+ offset += node.childNodes[i].nodeValue.length;
+ else if (node.childNodes[i].nodeName == 'BR')
+ offset += 1
+ else {
+ result.push({
+ event: 'start',
+ offset: offset,
+ node: node.childNodes[i]
+ });
+ offset = arguments.callee(node.childNodes[i], offset)
+ result.push({
+ event: 'stop',
+ offset: offset,
+ node: node.childNodes[i]
+ });
+ }
+ }
+ return offset;
+ })(node, 0);
+ return result;
+ }
+
+ function mergeStreams(stream1, stream2, value) {
+ var processed = 0;
+ var result = '';
+ var nodeStack = [];
+
+ function selectStream() {
+ if (stream1.length && stream2.length) {
+ if (stream1[0].offset != stream2[0].offset)
+ return (stream1[0].offset < stream2[0].offset) ? stream1 : stream2;
+ else {
+ /*
+ To avoid starting the stream just before it should stop the order is
+ ensured that stream1 always starts first and closes last:
+
+ if (event1 == 'start' && event2 == 'start')
+ return stream1;
+ if (event1 == 'start' && event2 == 'stop')
+ return stream2;
+ if (event1 == 'stop' && event2 == 'start')
+ return stream1;
+ if (event1 == 'stop' && event2 == 'stop')
+ return stream2;
+
+ ... which is collapsed to:
+ */
+ return stream2[0].event == 'start' ? stream1 : stream2;
+ }
+ } else {
+ return stream1.length ? stream1 : stream2;
+ }
+ }
+
+ function open(node) {
+ var result = '<' + node.nodeName.toLowerCase();
+ for (var i = 0; i < node.attributes.length; i++) {
+ var attribute = node.attributes[i];
+ result += ' ' + attribute.nodeName.toLowerCase();
+ if (attribute.nodeValue != undefined && attribute.nodeValue != false && attribute.nodeValue != null) {
+ result += '="' + escape(attribute.nodeValue) + '"';
+ }
+ }
+ return result + '>';
+ }
+
+ while (stream1.length || stream2.length) {
+ var current = selectStream().splice(0, 1)[0];
+ result += escape(value.substr(processed, current.offset - processed));
+ processed = current.offset;
+ if ( current.event == 'start') {
+ result += open(current.node);
+ nodeStack.push(current.node);
+ } else if (current.event == 'stop') {
+ var i = nodeStack.length;
+ do {
+ i--;
+ var node = nodeStack[i];
+ result += ('</' + node.nodeName.toLowerCase() + '>');
+ } while (node != current.node);
+ nodeStack.splice(i, 1);
+ while (i < nodeStack.length) {
+ result += open(nodeStack[i]);
+ i++;
+ }
+ }
+ }
+ result += value.substr(processed);
+ return result;
+ }
+
+ /* Initialization */
+
+ function compileModes() {
+
+ function compileMode(mode, language, is_default) {
+ if (mode.compiled)
+ return;
+
+ if (!is_default) {
+ mode.beginRe = langRe(language, mode.begin ? mode.begin : '\\B|\\b');
+ if (!mode.end && !mode.endsWithParent)
+ mode.end = '\\B|\\b'
+ if (mode.end)
+ mode.endRe = langRe(language, mode.end);
+ }
+ if (mode.illegal)
+ mode.illegalRe = langRe(language, mode.illegal);
+ if (mode.relevance == undefined)
+ mode.relevance = 1;
+ if (mode.keywords)
+ mode.lexemsRe = langRe(language, mode.lexems || hljs.IDENT_RE, true);
+ for (var key in mode.keywords) {
+ if (!mode.keywords.hasOwnProperty(key))
+ continue;
+ if (mode.keywords[key] instanceof Object)
+ mode.keywordGroups = mode.keywords;
+ else
+ mode.keywordGroups = {'keyword': mode.keywords};
+ break;
+ }
+ if (!mode.contains) {
+ mode.contains = [];
+ }
+ // compiled flag is set before compiling submodes to avoid self-recursion
+ // (see lisp where quoted_list contains quoted_list)
+ mode.compiled = true;
+ for (var i = 0; i < mode.contains.length; i++) {
+ compileMode(mode.contains[i], language, false);
+ }
+ if (mode.starts) {
+ compileMode(mode.starts, language, false);
+ }
+ }
+
+ for (var i in languages) {
+ if (!languages.hasOwnProperty(i))
+ continue;
+ compileMode(languages[i].defaultMode, languages[i], true);
+ }
+ }
+
+ /*
+ Core highlighting function. Accepts a language name and a string with the
+ code to highlight. Returns an object with the following properties:
+
+ - relevance (int)
+ - keyword_count (int)
+ - value (an HTML string with highlighting markup)
+
+ */
+ function highlight(language_name, value) {
+ if (!compileModes.called) {
+ compileModes();
+ compileModes.called = true;
+ }
+
+ function subMode(lexem, mode) {
+ for (var i = 0; i < mode.contains.length; i++) {
+ if (mode.contains[i].beginRe.test(lexem)) {
+ return mode.contains[i];
+ }
+ }
+ }
+
+ function endOfMode(mode_index, lexem) {
+ if (modes[mode_index].end && modes[mode_index].endRe.test(lexem))
+ return 1;
+ if (modes[mode_index].endsWithParent) {
+ var level = endOfMode(mode_index - 1, lexem);
+ return level ? level + 1 : 0;
+ }
+ return 0;
+ }
+
+ function isIllegal(lexem, mode) {
+ return mode.illegalRe && mode.illegalRe.test(lexem);
+ }
+
+ function compileTerminators(mode, language) {
+ var terminators = [];
+
+ for (var i = 0; i < mode.contains.length; i++) {
+ terminators.push(mode.contains[i].begin);
+ }
+
+ var index = modes.length - 1;
+ do {
+ if (modes[index].end) {
+ terminators.push(modes[index].end);
+ }
+ index--;
+ } while (modes[index + 1].endsWithParent);
+
+ if (mode.illegal) {
+ terminators.push(mode.illegal);
+ }
+
+ return langRe(language, '(' + terminators.join('|') + ')', true);
+ }
+
+ function eatModeChunk(value, index) {
+ var mode = modes[modes.length - 1];
+ if (!mode.terminators) {
+ mode.terminators = compileTerminators(mode, language);
+ }
+ mode.terminators.lastIndex = index;
+ var match = mode.terminators.exec(value);
+ if (match)
+ return [value.substr(index, match.index - index), match[0], false];
+ else
+ return [value.substr(index), '', true];
+ }
+
+ function keywordMatch(mode, match) {
+ var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]
+ for (var className in mode.keywordGroups) {
+ if (!mode.keywordGroups.hasOwnProperty(className))
+ continue;
+ var value = mode.keywordGroups[className].hasOwnProperty(match_str);
+ if (value)
+ return [className, value];
+ }
+ return false;
+ }
+
+ function processKeywords(buffer, mode) {
+ if (!mode.keywords)
+ return escape(buffer);
+ var result = '';
+ var last_index = 0;
+ mode.lexemsRe.lastIndex = 0;
+ var match = mode.lexemsRe.exec(buffer);
+ while (match) {
+ result += escape(buffer.substr(last_index, match.index - last_index));
+ var keyword_match = keywordMatch(mode, match);
+ if (keyword_match) {
+ keyword_count += keyword_match[1];
+ result += '<span class="'+ keyword_match[0] +'">' + escape(match[0]) + '</span>';
+ } else {
+ result += escape(match[0]);
+ }
+ last_index = mode.lexemsRe.lastIndex;
+ match = mode.lexemsRe.exec(buffer);
+ }
+ result += escape(buffer.substr(last_index, buffer.length - last_index));
+ return result;
+ }
+
+ function processBuffer(buffer, mode) {
+ if (mode.subLanguage && languages[mode.subLanguage]) {
+ var result = highlight(mode.subLanguage, buffer);
+ keyword_count += result.keyword_count;
+ return result.value;
+ } else {
+ return processKeywords(buffer, mode);
+ }
+ }
+
+ function startNewMode(mode, lexem) {
+ var markup = mode.className?'<span class="' + mode.className + '">':'';
+ if (mode.returnBegin) {
+ result += markup;
+ mode.buffer = '';
+ } else if (mode.excludeBegin) {
+ result += escape(lexem) + markup;
+ mode.buffer = '';
+ } else {
+ result += markup;
+ mode.buffer = lexem;
+ }
+ modes.push(mode);
+ relevance += mode.relevance;
+ }
+
+ function processModeInfo(buffer, lexem, end) {
+ var current_mode = modes[modes.length - 1];
+ if (end) {
+ result += processBuffer(current_mode.buffer + buffer, current_mode);
+ return false;
+ }
+
+ var new_mode = subMode(lexem, current_mode);
+ if (new_mode) {
+ result += processBuffer(current_mode.buffer + buffer, current_mode);
+ startNewMode(new_mode, lexem);
+ return new_mode.returnBegin;
+ }
+
+ var end_level = endOfMode(modes.length - 1, lexem);
+ if (end_level) {
+ var markup = current_mode.className?'</span>':'';
+ if (current_mode.returnEnd) {
+ result += processBuffer(current_mode.buffer + buffer, current_mode) + markup;
+ } else if (current_mode.excludeEnd) {
+ result += processBuffer(current_mode.buffer + buffer, current_mode) + markup + escape(lexem);
+ } else {
+ result += processBuffer(current_mode.buffer + buffer + lexem, current_mode) + markup;
+ }
+ while (end_level > 1) {
+ markup = modes[modes.length - 2].className?'</span>':'';
+ result += markup;
+ end_level--;
+ modes.length--;
+ }
+ var last_ended_mode = modes[modes.length - 1];
+ modes.length--;
+ modes[modes.length - 1].buffer = '';
+ if (last_ended_mode.starts) {
+ startNewMode(last_ended_mode.starts, '');
+ }
+ return current_mode.returnEnd;
+ }
+
+ if (isIllegal(lexem, current_mode))
+ throw 'Illegal';
+ }
+
+ var language = languages[language_name];
+ var modes = [language.defaultMode];
+ var relevance = 0;
+ var keyword_count = 0;
+ var result = '';
+ try {
+ var index = 0;
+ language.defaultMode.buffer = '';
+ do {
+ var mode_info = eatModeChunk(value, index);
+ var return_lexem = processModeInfo(mode_info[0], mode_info[1], mode_info[2]);
+ index += mode_info[0].length;
+ if (!return_lexem) {
+ index += mode_info[1].length;
+ }
+ } while (!mode_info[2]);
+ if(modes.length > 1)
+ throw 'Illegal';
+ return {
+ relevance: relevance,
+ keyword_count: keyword_count,
+ value: result
+ }
+ } catch (e) {
+ if (e == 'Illegal') {
+ return {
+ relevance: 0,
+ keyword_count: 0,
+ value: escape(value)
+ }
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ /*
+ Highlighting with language detection. Accepts a string with the code to
+ highlight. Returns an object with the following properties:
+
+ - language (detected language)
+ - relevance (int)
+ - keyword_count (int)
+ - value (an HTML string with highlighting markup)
+ - second_best (object with the same structure for second-best heuristically
+ detected language, may be absent)
+
+ */
+ function highlightAuto(text) {
+ var result = {
+ keyword_count: 0,
+ relevance: 0,
+ value: escape(text)
+ };
+ var second_best = result;
+ for (var key in languages) {
+ if (!languages.hasOwnProperty(key))
+ continue;
+ var current = highlight(key, text);
+ current.language = key;
+ if (current.keyword_count + current.relevance > second_best.keyword_count + second_best.relevance) {
+ second_best = current;
+ }
+ if (current.keyword_count + current.relevance > result.keyword_count + result.relevance) {
+ second_best = result;
+ result = current;
+ }
+ }
+ if (second_best.language) {
+ result.second_best = second_best;
+ }
+ return result;
+ }
+
+ /*
+ Post-processing of the highlighted markup:
+
+ - replace TABs with something more useful
+ - replace real line-breaks with '<br>' for non-pre containers
+
+ */
+ function fixMarkup(value, tabReplace, useBR) {
+ if (tabReplace) {
+ value = value.replace(/^((<[^>]+>|\t)+)/gm, function(match, p1, offset, s) {
+ return p1.replace(/\t/g, tabReplace);
+ })
+ }
+ if (useBR) {
+ value = value.replace(/\n/g, '<br>');
+ }
+ return value;
+ }
+
+ /*
+ Applies highlighting to a DOM node containing code. Accepts a DOM node and
+ two optional parameters for fixMarkup.
+ */
+ function highlightBlock(block, tabReplace, useBR) {
+ var text = blockText(block, useBR);
+ var language = blockLanguage(block);
+ if (language == 'no-highlight')
+ return;
+ if (language) {
+ var result = highlight(language, text);
+ } else {
+ var result = highlightAuto(text);
+ language = result.language;
+ }
+ var original = nodeStream(block);
+ if (original.length) {
+ var pre = document.createElement('pre');
+ pre.innerHTML = result.value;
+ result.value = mergeStreams(original, nodeStream(pre), text);
+ }
+ result.value = fixMarkup(result.value, tabReplace, useBR);
+
+ var class_name = block.className;
+ if (!class_name.match('(\\s|^)(language-)?' + language + '(\\s|$)')) {
+ class_name = class_name ? (class_name + ' ' + language) : language;
+ }
+ if (/MSIE [678]/.test(navigator.userAgent) && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {
+ // This is for backwards compatibility only. IE needs this strange
+ // hack becasue it cannot just cleanly replace <code> block contents.
+ var pre = block.parentNode;
+ var container = document.createElement('div');
+ container.innerHTML = '<pre><code>' + result.value + '</code></pre>';
+ block = container.firstChild.firstChild;
+ container.firstChild.className = pre.className;
+ pre.parentNode.replaceChild(container.firstChild, pre);
+ } else {
+ block.innerHTML = result.value;
+ }
+ block.className = class_name;
+ block.result = {
+ language: language,
+ kw: result.keyword_count,
+ re: result.relevance
+ };
+ if (result.second_best) {
+ block.second_best = {
+ language: result.second_best.language,
+ kw: result.second_best.keyword_count,
+ re: result.second_best.relevance
+ };
+ }
+ }
+
+ /*
+ Applies highlighting to all <pre><code>..</code></pre> blocks on a page.
+ */
+ function initHighlighting() {
+ if (initHighlighting.called)
+ return;
+ initHighlighting.called = true;
+ var pres = document.getElementsByTagName('pre');
+ for (var i = 0; i < pres.length; i++) {
+ var code = findCode(pres[i]);
+ if (code)
+ highlightBlock(code, hljs.tabReplace);
+ }
+ }
+
+ /*
+ Attaches highlighting to the page load event.
+ */
+ function initHighlightingOnLoad() {
+ if (window.addEventListener) {
+ window.addEventListener('DOMContentLoaded', initHighlighting, false);
+ window.addEventListener('load', initHighlighting, false);
+ } else if (window.attachEvent)
+ window.attachEvent('onload', initHighlighting);
+ else
+ window.onload = initHighlighting;
+ }
+
+ var languages = {}; // a shortcut to avoid writing "this." everywhere
+
+ /* Interface definition */
+
+ this.LANGUAGES = languages;
+ this.highlight = highlight;
+ this.highlightAuto = highlightAuto;
+ this.fixMarkup = fixMarkup;
+ this.highlightBlock = highlightBlock;
+ this.initHighlighting = initHighlighting;
+ this.initHighlightingOnLoad = initHighlightingOnLoad;
+
+ // Common regexps
+ this.IDENT_RE = '[a-zA-Z][a-zA-Z0-9_]*';
+ this.UNDERSCORE_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*';
+ this.NUMBER_RE = '\\b\\d+(\\.\\d+)?';
+ this.C_NUMBER_RE = '\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)';
+ this.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
+
+ // Common modes
+ this.BACKSLASH_ESCAPE = {
+ begin: '\\\\.', relevance: 0
+ };
+ this.APOS_STRING_MODE = {
+ className: 'string',
+ begin: '\'', end: '\'',
+ illegal: '\\n',
+ contains: [this.BACKSLASH_ESCAPE],
+ relevance: 0
+ };
+ this.QUOTE_STRING_MODE = {
+ className: 'string',
+ begin: '"', end: '"',
+ illegal: '\\n',
+ contains: [this.BACKSLASH_ESCAPE],
+ relevance: 0
+ };
+ this.C_LINE_COMMENT_MODE = {
+ className: 'comment',
+ begin: '//', end: '$'
+ };
+ this.C_BLOCK_COMMENT_MODE = {
+ className: 'comment',
+ begin: '/\\*', end: '\\*/'
+ };
+ this.HASH_COMMENT_MODE = {
+ className: 'comment',
+ begin: '#', end: '$'
+ };
+ this.NUMBER_MODE = {
+ className: 'number',
+ begin: this.NUMBER_RE,
+ relevance: 0
+ };
+ this.C_NUMBER_MODE = {
+ className: 'number',
+ begin: this.C_NUMBER_RE,
+ relevance: 0
+ };
+
+ // Utility functions
+ this.inherit = function(parent, obj) {
+ var result = {}
+ for (var key in parent)
+ result[key] = parent[key];
+ if (obj)
+ for (var key in obj)
+ result[key] = obj[key];
+ return result;
+ }
+}();
View
1  js/highlight.js-6.1/highlight.pack.js
@@ -0,0 +1 @@
+var hljs=new function(){function m(p){return p.replace(/&/gm,"&amp;").replace(/</gm,"&lt;")}function c(r,q,p){return RegExp(q,"m"+(r.cI?"i":"")+(p?"g":""))}function j(r){for(var p=0;p<r.childNodes.length;p++){var q=r.childNodes[p];if(q.nodeName=="CODE"){return q}if(!(q.nodeType==3&&q.nodeValue.match(/\s+/))){break}}}function g(t,s){var r="";for(var q=0;q<t.childNodes.length;q++){if(t.childNodes[q].nodeType==3){var p=t.childNodes[q].nodeValue;if(s){p=p.replace(/\n/g,"")}r+=p}else{if(t.childNodes[q].nodeName=="BR"){r+="\n"}else{r+=g(t.childNodes[q])}}}if(/MSIE [678]/.test(navigator.userAgent)){r=r.replace(/\r/g,"\n")}return r}function a(s){var q=s.className.split(/\s+/);q=q.concat(s.parentNode.className.split(/\s+/));for(var p=0;p<q.length;p++){var r=q[p].replace(/^language-/,"");if(d[r]||r=="no-highlight"){return r}}}function b(p){var q=[];(function(s,t){for(var r=0;r<s.childNodes.length;r++){if(s.childNodes[r].nodeType==3){t+=s.childNodes[r].nodeValue.length}else{if(s.childNodes[r].nodeName=="BR"){t+=1}else{q.push({event:"start",offset:t,node:s.childNodes[r]});t=arguments.callee(s.childNodes[r],t);q.push({event:"stop",offset:t,node:s.childNodes[r]})}}}return t})(p,0);return q}function l(y,z,x){var r=0;var w="";var t=[];function u(){if(y.length&&z.length){if(y[0].offset!=z[0].offset){return(y[0].offset<z[0].offset)?y:z}else{return z[0].event=="start"?y:z}}else{return y.length?y:z}}function s(C){var D="<"+C.nodeName.toLowerCase();for(var A=0;A<C.attributes.length;A++){var B=C.attributes[A];D+=" "+B.nodeName.toLowerCase();if(B.nodeValue!=undefined&&B.nodeValue!=false&&B.nodeValue!=null){D+='="'+m(B.nodeValue)+'"'}}return D+">"}while(y.length||z.length){var v=u().splice(0,1)[0];w+=m(x.substr(r,v.offset-r));r=v.offset;if(v.event=="start"){w+=s(v.node);t.push(v.node)}else{if(v.event=="stop"){var q=t.length;do{q--;var p=t[q];w+=("</"+p.nodeName.toLowerCase()+">")}while(p!=v.node);t.splice(q,1);while(q<t.length){w+=s(t[q]);q++}}}}w+=x.substr(r);return w}function i(){function p(u,t,v){if(u.compiled){return}if(!v){u.bR=c(t,u.b?u.b:"\\B|\\b");if(!u.e&&!u.eW){u.e="\\B|\\b"}if(u.e){u.eR=c(t,u.e)}}if(u.i){u.iR=c(t,u.i)}if(u.r==undefined){u.r=1}if(u.k){u.lR=c(t,u.l||hljs.IR,true)}for(var s in u.k){if(!u.k.hasOwnProperty(s)){continue}if(u.k[s] instanceof Object){u.kG=u.k}else{u.kG={keyword:u.k}}break}if(!u.c){u.c=[]}u.compiled=true;for(var r=0;r<u.c.length;r++){p(u.c[r],t,false)}if(u.starts){p(u.starts,t,false)}}for(var q in d){if(!d.hasOwnProperty(q)){continue}p(d[q].dM,d[q],true)}}function e(J,D){if(!i.called){i();i.called=true}function z(r,M){for(var L=0;L<M.c.length;L++){if(M.c[L].bR.test(r)){return M.c[L]}}}function w(L,r){if(C[L].e&&C[L].eR.test(r)){return 1}if(C[L].eW){var M=w(L-1,r);return M?M+1:0}return 0}function x(r,L){return L.iR&&L.iR.test(r)}function A(O,N){var M=[];for(var L=0;L<O.c.length;L++){M.push(O.c[L].b)}var r=C.length-1;do{if(C[r].e){M.push(C[r].e)}r--}while(C[r+1].eW);if(O.i){M.push(O.i)}return c(N,"("+M.join("|")+")",true)}function s(M,L){var N=C[C.length-1];if(!N.t){N.t=A(N,H)}N.t.lastIndex=L;var r=N.t.exec(M);if(r){return[M.substr(L,r.index-L),r[0],false]}else{return[M.substr(L),"",true]}}function p(O,r){var L=H.cI?r[0].toLowerCase():r[0];for(var N in O.kG){if(!O.kG.hasOwnProperty(N)){continue}var M=O.kG[N].hasOwnProperty(L);if(M){return[N,M]}}return false}function F(M,O){if(!O.k){return m(M)}var N="";var P=0;O.lR.lastIndex=0;var L=O.lR.exec(M);while(L){N+=m(M.substr(P,L.index-P));var r=p(O,L);if(r){t+=r[1];N+='<span class="'+r[0]+'">'+m(L[0])+"</span>"}else{N+=m(L[0])}P=O.lR.lastIndex;L=O.lR.exec(M)}N+=m(M.substr(P,M.length-P));return N}function K(r,M){if(M.sL&&d[M.sL]){var L=e(M.sL,r);t+=L.keyword_count;return L.value}else{return F(r,M)}}function I(M,r){var L=M.cN?'<span class="'+M.cN+'">':"";if(M.rB){q+=L;M.buffer=""}else{if(M.eB){q+=m(r)+L;M.buffer=""}else{q+=L;M.buffer=r}}C.push(M);B+=M.r}function E(O,L,Q){var R=C[C.length-1];if(Q){q+=K(R.buffer+O,R);return false}var M=z(L,R);if(M){q+=K(R.buffer+O,R);I(M,L);return M.rB}var r=w(C.length-1,L);if(r){var N=R.cN?"</span>":"";if(R.rE){q+=K(R.buffer+O,R)+N}else{if(R.eE){q+=K(R.buffer+O,R)+N+m(L)}else{q+=K(R.buffer+O+L,R)+N}}while(r>1){N=C[C.length-2].cN?"</span>":"";q+=N;r--;C.length--}var P=C[C.length-1];C.length--;C[C.length-1].buffer="";if(P.starts){I(P.starts,"")}return R.rE}if(x(L,R)){throw"Illegal"}}var H=d[J];var C=[H.dM];var B=0;var t=0;var q="";try{var v=0;H.dM.buffer="";do{var y=s(D,v);var u=E(y[0],y[1],y[2]);v+=y[0].length;if(!u){v+=y[1].length}}while(!y[2]);if(C.length>1){throw"Illegal"}return{r:B,keyword_count:t,value:q}}catch(G){if(G=="Illegal"){return{r:0,keyword_count:0,value:m(D)}}else{throw G}}}function f(t){var r={keyword_count:0,r:0,value:m(t)};var q=r;for(var p in d){if(!d.hasOwnProperty(p)){continue}var s=e(p,t);s.language=p;if(s.keyword_count+s.r>q.keyword_count+q.r){q=s}if(s.keyword_count+s.r>r.keyword_count+r.r){q=r;r=s}}if(q.language){r.second_best=q}return r}function h(r,q,p){if(q){r=r.replace(/^((<[^>]+>|\t)+)/gm,function(t,w,v,u){return w.replace(/\t/g,q)})}if(p){r=r.replace(/\n/g,"<br>")}return r}function o(u,x,q){var y=g(u,q);var s=a(u);if(s=="no-highlight"){return}if(s){var w=e(s,y)}else{var w=f(y);s=w.language}var p=b(u);if(p.length){var r=document.createElement("pre");r.innerHTML=w.value;w.value=l(p,b(r),y)}w.value=h(w.value,x,q);var t=u.className;if(!t.match("(\\s|^)(language-)?"+s+"(\\s|$)")){t=t?(t+" "+s):s}if(/MSIE [678]/.test(navigator.userAgent)&&u.tagName=="CODE"&&u.parentNode.tagName=="PRE"){var r=u.parentNode;var v=document.createElement("div");v.innerHTML="<pre><code>"+w.value+"</code></pre>";u=v.firstChild.firstChild;v.firstChild.cN=r.cN;r.parentNode.replaceChild(v.firstChild,r)}else{u.innerHTML=w.value}u.className=t;u.result={language:s,kw:w.keyword_count,re:w.r};if(w.second_best){u.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function k(){if(k.called){return}k.called=true;var r=document.getElementsByTagName("pre");for(var p=0;p<r.length;p++){var q=j(r[p]);if(q){o(q,hljs.tabReplace)}}}function n(){if(window.addEventListener){window.addEventListener("DOMContentLoaded",k,false);window.addEventListener("load",k,false)}else{if(window.attachEvent){window.attachEvent("onload",k)}else{window.onload=k}}}var d={};this.LANGUAGES=d;this.highlight=e;this.highlightAuto=f;this.fixMarkup=h;this.highlightBlock=o;this.initHighlighting=k;this.initHighlightingOnLoad=n;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.inherit=function(p,s){var r={};for(var q in p){r[q]=p[q]}if(s){for(var q in s){r[q]=s[q]}}return r}}();hljs.LANGUAGES.bash=function(){var d={"true":1,"false":1};var b={cN:"variable",b:"\\$([a-zA-Z0-9_]+)\\b"};var a={cN:"variable",b:"\\$\\{(([^}])|(\\\\}))+\\}",c:[hljs.CNM]};var c={cN:"string",b:'"',e:'"',i:"\\n",c:[hljs.BE,b,a],r:0};var e={cN:"test_condition",b:"",e:"",c:[c,b,a,hljs.CNM],k:{literal:d},r:0};return{dM:{k:{keyword:{"if":1,then:1,"else":1,fi:1,"for":1,"break":1,"continue":1,"while":1,"in":1,"do":1,done:1,echo:1,exit:1,"return":1,set:1,declare:1},literal:d},c:[{cN:"shebang",b:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",r:10},hljs.HCM,hljs.CNM,c,b,a,hljs.inherit(e,{b:"\\[ ",e:" \\]",r:0}),hljs.inherit(e,{b:"\\[\\[ ",e:" \\]\\]"})]}}}();hljs.LANGUAGES.cs={dM:{k:{"abstract":1,as:1,base:1,bool:1,"break":1,"byte":1,"case":1,"catch":1,"char":1,checked:1,"class":1,"const":1,"continue":1,decimal:1,"default":1,delegate:1,"do":1,"do":1,"double":1,"else":1,"enum":1,event:1,explicit:1,extern:1,"false":1,"finally":1,fixed:1,"float":1,"for":1,foreach:1,"goto":1,"if":1,implicit:1,"in":1,"int":1,"interface":1,internal:1,is:1,lock:1,"long":1,namespace:1,"new":1,"null":1,object:1,operator:1,out:1,override:1,params:1,"private":1,"protected":1,"public":1,readonly:1,ref:1,"return":1,sbyte:1,sealed:1,"short":1,sizeof:1,stackalloc:1,"static":1,string:1,struct:1,"switch":1,"this":1,"throw":1,"true":1,"try":1,"typeof":1,uint:1,ulong:1,unchecked:1,unsafe:1,ushort:1,using:1,virtual:1,"volatile":1,"void":1,"while":1,ascending:1,descending:1,from:1,get:1,group:1,into:1,join:1,let:1,orderby:1,partial:1,select:1,set:1,value:1,"var":1,where:1,yield:1},c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|<!--|-->"},{cN:"xmlDocTag",b:"</?",e:">"}]},hljs.CLCM,hljs.CBLCLM,{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},hljs.ASM,hljs.QSM,hljs.CNM]}};hljs.LANGUAGES.ruby=function(){var g="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var a="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var n={keyword:{and:1,"false":1,then:1,defined:1,module:1,"in":1,"return":1,redo:1,"if":1,BEGIN:1,retry:1,end:1,"for":1,"true":1,self:1,when:1,next:1,until:1,"do":1,begin:1,unless:1,END:1,rescue:1,nil:1,"else":1,"break":1,undef:1,not:1,"super":1,"class":1,"case":1,require:1,yield:1,alias:1,"while":1,ensure:1,elsif:1,or:1,def:1},keymethods:{__id__:1,__send__:1,abort:1,abs:1,"all?":1,allocate:1,ancestors:1,"any?":1,arity:1,assoc:1,at:1,at_exit:1,autoload:1,"autoload?":1,"between?":1,binding:1,binmode:1,"block_given?":1,call:1,callcc:1,caller:1,capitalize:1,"capitalize!":1,casecmp:1,"catch":1,ceil:1,center:1,chomp:1,"chomp!":1,chop:1,"chop!":1,chr:1,"class":1,class_eval:1,"class_variable_defined?":1,class_variables:1,clear:1,clone:1,close:1,close_read:1,close_write:1,"closed?":1,coerce:1,collect:1,"collect!":1,compact:1,"compact!":1,concat:1,"const_defined?":1,const_get:1,const_missing:1,const_set:1,constants:1,count:1,crypt:1,"default":1,default_proc:1,"delete":1,"delete!":1,delete_at:1,delete_if:1,detect:1,display:1,div:1,divmod:1,downcase:1,"downcase!":1,downto:1,dump:1,dup:1,each:1,each_byte:1,each_index:1,each_key:1,each_line:1,each_pair:1,each_value:1,each_with_index:1,"empty?":1,entries:1,eof:1,"eof?":1,"eql?":1,"equal?":1,"eval":1,exec:1,exit:1,"exit!":1,extend:1,fail:1,fcntl:1,fetch:1,fileno:1,fill:1,find:1,find_all:1,first:1,flatten:1,"flatten!":1,floor:1,flush:1,for_fd:1,foreach:1,fork:1,format:1,freeze:1,"frozen?":1,fsync:1,getc:1,gets:1,global_variables:1,grep:1,gsub:1,"gsub!":1,"has_key?":1,"has_value?":1,hash:1,hex:1,id:1,include:1,"include?":1,included_modules:1,index:1,indexes:1,indices:1,induced_from:1,inject:1,insert:1,inspect:1,instance_eval:1,instance_method:1,instance_methods:1,"instance_of?":1,"instance_variable_defined?":1,instance_variable_get:1,instance_variable_set:1,instance_variables:1,"integer?":1,intern:1,invert:1,ioctl:1,"is_a?":1,isatty:1,"iterator?":1,join:1,"key?":1,keys:1,"kind_of?":1,lambda:1,last:1,length:1,lineno:1,ljust:1,load:1,local_variables:1,loop:1,lstrip:1,"lstrip!":1,map:1,"map!":1,match:1,max:1,"member?":1,merge:1,"merge!":1,method:1,"method_defined?":1,method_missing:1,methods:1,min:1,module_eval:1,modulo:1,name:1,nesting:1,"new":1,next:1,"next!":1,"nil?":1,nitems:1,"nonzero?":1,object_id:1,oct:1,open:1,pack:1,partition:1,pid:1,pipe:1,pop:1,popen:1,pos:1,prec:1,prec_f:1,prec_i:1,print:1,printf:1,private_class_method:1,private_instance_methods:1,"private_method_defined?":1,private_methods:1,proc:1,protected_instance_methods:1,"protected_method_defined?":1,protected_methods:1,public_class_method:1,public_instance_methods:1,"public_method_defined?":1,public_methods:1,push:1,putc:1,puts:1,quo:1,raise:1,rand:1,rassoc:1,read:1,read_nonblock:1,readchar:1,readline:1,readlines:1,readpartial:1,rehash:1,reject:1,"reject!":1,remainder:1,reopen:1,replace:1,require:1,"respond_to?":1,reverse:1,"reverse!":1,reverse_each:1,rewind:1,rindex:1,rjust:1,round:1,rstrip:1,"rstrip!":1,scan:1,seek:1,select:1,send:1,set_trace_func:1,shift:1,singleton_method_added:1,singleton_methods:1,size:1,sleep:1,slice:1,"slice!":1,sort:1,"sort!":1,sort_by:1,split:1,sprintf:1,squeeze:1,"squeeze!":1,srand:1,stat:1,step:1,store:1,strip:1,"strip!":1,sub:1,"sub!":1,succ:1,"succ!":1,sum:1,superclass:1,swapcase:1,"swapcase!":1,sync:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,taint:1,"tainted?":1,tell:1,test:1,"throw":1,times:1,to_a:1,to_ary:1,to_f:1,to_hash:1,to_i:1,to_int:1,to_io:1,to_proc:1,to_s:1,to_str:1,to_sym:1,tr:1,"tr!":1,tr_s:1,"tr_s!":1,trace_var:1,transpose:1,trap:1,truncate:1,"tty?":1,type:1,ungetc:1,uniq:1,"uniq!":1,unpack:1,unshift:1,untaint:1,untrace_var:1,upcase:1,"upcase!":1,update:1,upto:1,"value?":1,values:1,values_at:1,warn:1,write:1,write_nonblock:1,"zero?":1,zip:1}};var h={cN:"yardoctag",b:"@[A-Za-z]+"};var d={cN:"comment",b:"#",e:"$",c:[h]};var c={cN:"comment",b:"^\\=begin",e:"^\\=end",c:[h],r:10};var b={cN:"comment",b:"^__END__",e:"\\n$"};var u={cN:"subst",b:"#\\{",e:"}",l:g,k:n};var p=[hljs.BE,u];var s={cN:"string",b:"'",e:"'",c:p,r:0};var r={cN:"string",b:'"',e:'"',c:p,r:0};var q={cN:"string",b:"%[qw]?\\(",e:"\\)",c:p,r:10};var o={cN:"string",b:"%[qw]?\\[",e:"\\]",c:p,r:10};var m={cN:"string",b:"%[qw]?{",e:"}",c:p,r:10};var l={cN:"string",b:"%[qw]?<",e:">",c:p,r:10};var k={cN:"string",b:"%[qw]?/",e:"/",c:p,r:10};var j={cN:"string",b:"%[qw]?%",e:"%",c:p,r:10};var i={cN:"string",b:"%[qw]?-",e:"-",c:p,r:10};var t={cN:"string",b:"%[qw]?\\|",e:"\\|",c:p,r:10};var e={cN:"function",b:"\\bdef\\s+",e:" |$|;",l:g,k:n,c:[{cN:"title",b:a,l:g,k:n},{cN:"params",b:"\\(",e:"\\)",l:g,k:n},d,c,b]};var f={cN:"identifier",b:g,l:g,k:n,r:0};var v=[d,c,b,s,r,q,o,m,l,k,j,i,t,{cN:"class",b:"\\b(class|module)\\b",e:"$|;",k:{"class":1,module:1},c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+hljs.IR+"::)?"+hljs.IR}]},d,c,b]},e,{cN:"constant",b:"(::)?([A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[s,r,q,o,m,l,k,j,i,t,f],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},f,{b:"("+hljs.RSR+")\\s*",c:[d,c,b,{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[hljs.BE]}],r:0}];u.c=v;e.c[1].c=v;return{dM:{l:g,k:n,c:v}}}();hljs.LANGUAGES.diff={cI:true,dM:{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}};hljs.LANGUAGES.javascript={dM:{k:{keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"var":1,"new":1,"function":1,"do":1,"return":1,"void":1,"else":1,"break":1,"catch":1,"instanceof":1,"with":1,"throw":1,"case":1,"default":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1},literal:{"true":1,"false":1,"null":1}},c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM,hljs.CNM,{b:"("+hljs.RSR+"|case|return|throw)\\s*",k:{"return":1,"throw":1,"case":1},c:[hljs.CLCM,hljs.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",c:[{b:"\\\\/"}]}],r:0},{cN:"function",b:"\\bfunction\\b",e:"{",k:{"function":1},c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM]}]}]}};hljs.LANGUAGES.css=function(){var a={cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[hljs.NM,hljs.ASM,hljs.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[hljs.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:{"font-face":1,page:1}},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:{"import":1,page:1,media:1,charset:1},c:[a,hljs.ASM,hljs.QSM,hljs.NM]},{cN:"tag",b:hljs.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[hljs.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[a,hljs.NM,hljs.QSM,hljs.ASM,hljs.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}();hljs.LANGUAGES.xml=function(){var b="[A-Za-z0-9\\._:-]+";var a={eW:true,c:[{cN:"attribute",b:b,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style",e:">",k:{title:{style:1}},c:[a],starts:{cN:"css",e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script",e:">",k:{title:{script:1}},c:[a],starts:{cN:"javascript",e:"<\/script>",rE:true,sL:"javascript"}},{cN:"vbscript",b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:&q