<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/lib/highlight_spec.rb</filename>
    </added>
    <added>
      <filename>spec/lib/pygments_wrapper_spec.rb</filename>
    </added>
    <added>
      <filename>spec/lib/view_methods_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,20 +1,34 @@
 = Highlight
 
-Highlight is a simple syntax highlighting plugin for Ruby on Rails. It's basically a wrapper around the python project
-pygments (http://pygments.org/) that support various languages.
+Highlight is a simple syntax highlighting plugin for Ruby on Rails. It's basically a wrapper around the popular http://pygments.org
+highlighter that's written in Python and supports a huge number of languages.
 
-The plugin adds a new method available in all templates:
+Highlight provides a new method that's available in views:
 
-  highlight(language, code)
+  highlight(language, code = nil, &amp;block)
 
-where language can be either a symbol or a string (most file extensions should work for example)
++language+ may be either a Symbolor a String (see supported languages below). The code can be passed either as a string or inside
+a block, e.g.:
+
+	highlight(:ruby, 'class Test; end')
+
+or
+
+	highlight(:ruby) do
+		&lt;&lt;-EOF
+			class Test
+			end
+		EOF
+	end
 
 To perform the highlighting, the code is first written to a file in /tmp, e.g.:
 
   /tmp/highlight_1225993290.70882
 
-Since writing that file, passing its contents on to pygments etc. takes a while, all highlighted source code should be cached
-of course, e.g.:
+This file is the passed to pygments that returns the HTML and so on...
+
+Since writing that file, passing its contents on to pygments, retrieve the result etc. takes a while, all highlighted source
+code should be cached of course, e.g.:
 
   &lt;% cache do %&gt;
     &lt;%= highlight(:ruby, 'class Test; end') -%&gt;
@@ -24,7 +38,7 @@ of course, e.g.:
 == Supported Languages
 
 The following languages are supported. All of the paranthesized identifiers may be used as parameters for highlight to denote the
-language the source code to highlight is written in.
+language the source code to highlight is written in (use either Symbols or Strings).
 
   * Actionscript (as, as3, actionscript)
   * Applescript (applescript)
@@ -84,9 +98,9 @@ At the moment there are neither TODOs nor future plans. If you want ot suggest a
 
 == Author
 
-Copyright (c) 2008 Marco Otte-Witte (http://simplabs.com/#projects), released under the MIT license
+Copyright (c) 2008-2009 Marco Otte-Witte (http://simplabs.com), released under the MIT license
 
 
 == Acknowledgements
 
-The actual highlighting is done by Pygments (http://pygments.org/).
\ No newline at end of file
+The actual highlighting is done by Pygments (http://pygments.org).
\ No newline at end of file</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require 'simplabs/highlight'
 
-if IO::popen(&quot;which pygmentize&quot;).read == ''
-  puts &quot; ** [Highlight] pygments cannot be found, highlighting code won't work!&quot;
+if `which pygmentize`.blank?
+  puts &quot;*** [Highlight] pygments cannot be found, highlighting code won't work!&quot;
   Simplabs::Highlight.initialized = false
 else
   Simplabs::Highlight.initialized = true</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,27 +1,9 @@
 module Simplabs
 
-  # Highlight is a simple source code highlighting plugin for Ruby on Rails. It's basically a wrapper around the python project
-  # pygments (http://pygments.org/) that support various languages.
+  # = Highlight
   #
-  # The plugin adds a new method available in all templates:
-  #
-  #  highlight(language, code)
-  #
-  # where language can be either a symbol or a string (most file extensions should work for example)
-  #
-  # To perform the highlighting, the code is first written to a file in /tmp, e.g.:
-  #
-  #  /tmp/highlight_1225993290.70882
-  #
-  # Since writing that file, passing its contents on to pygments etc. takes a while, all highlighted source code should be cached
-  # of course, e.g.:
-  #
-  #  &lt;% cache do %&gt;
-  #    &lt;%= highlight(:ruby) do -%&gt;
-  #      class Test
-  #      end
-  #    &lt;% end -%&gt;
-  #  &lt;% end %&gt;
+  # Highlight is a simple syntax highlighting plugin for Ruby on Rails. It's basically a wrapper around the popular http://pygments.org
+  # highlighter that's written in Python and supports a huge number of languages.
   module Highlight
 
     mattr_accessor :initialized
@@ -60,6 +42,76 @@ module Simplabs
       :yaml          =&gt; ['yaml', 'yml']
     }
 
+    # Highlights the passed +code+ with the appropriate rules according to the specified +language+.
+    #
+    # &lt;b&gt;Supported Languages&lt;/b&gt;
+    #
+    # The following languages are supported. All of the paranthesized identifiers may be used as parameters for highlight to denote the
+    # language the source code to highlight is written in (use either Symbols or Strings).
+    #
+    # * Actionscript (as, as3, actionscript)
+    # * Applescript (applescript)
+    # * bash (bash, sh)
+    # * C (c, h)
+    # * Clojure (clojure)
+    # * C++ (c++, cpp, hpp)
+    # * C# (c#, csharp, cs)
+    # * CSS (css)
+    # * diff (diff)
+    # * Dylan (dylan)
+    # * Erlang (erlang, erl, er)
+    # * HTML (html, htm)
+    # * Java (java)
+    # * JavaScript (javascript, js, jscript)
+    # * JSP (jsp)
+    # * Make (make, basemake, makefile)
+    # * Objective-C (objective-c)
+    # * OCaml (ocaml)
+    # * Perl (perl, pl)
+    # * PHP (php)
+    # * Python (python, (py)
+    # * RHTML (erb, rhtml)
+    # * Ruby (ruby, rb)
+    # * Scala (scala)
+    # * Scheme (scheme)
+    # * Smalltalk (smalltalk)
+    # * Smarty (smarty)
+    # * SQL (sql)
+    # * XML (xml, xsd)
+    # * XSLT (xslt)
+    # * YAML (yaml, yml)
+    def self.highlight(language, code)
+      return CGI.escapeHTML(code) unless Simplabs::Highlight.initialized
+      Simplabs::Highlight::PygmentsWrapper.highlight(code, language)
+    end
+
+    # Highlight view methods
+    module ViewMethods
+
+      # Highlights the passed +code+ with the appropriate rules according to the specified +language+. The code can
+      # be specified either as a string or as result f a block.
+      #
+      # &lt;b&gt;Examples:&lt;/b&gt;
+      #
+      #  highlight(:ruby, 'class Test; end')
+      #
+      #  highlight(:ruby) do
+    	#	   &lt;&lt;-EOF
+    	#		   class Test
+      #			 end
+    	#	   EOF
+    	#  end 
+    	#
+    	# Also see Simplabs::Highlight.highlight
+      def highlight(language, code = nil, &amp;block)
+        raise ArgumentError.new('Either pass a srting containing the code or a block, not both!') if !code.nil? &amp;&amp; block_given?
+        raise ArgumentError.new('Pass a srting containing the code or a block!') if code.nil? &amp;&amp; !block_given?
+        code ||= yield
+        Simplabs::Highlight.highlight(language, code)
+      end
+
+    end
+
   end
 
 end</diff>
      <filename>lib/simplabs/highlight.rb</filename>
    </modified>
    <modified>
      <diff>@@ -63,10 +63,6 @@
                 lib/simplabs/highlight/pygments_wrapper.rb
                 &lt;/a&gt;
         &lt;br /&gt;
-                &lt;a href=&quot;../files/lib/simplabs/highlight/view_methods_rb.html&quot;&gt;
-                lib/simplabs/highlight/view_methods.rb
-                &lt;/a&gt;
-        &lt;br /&gt;
                 &lt;a href=&quot;../files/lib/simplabs/highlight_rb.html&quot;&gt;
                 lib/simplabs/highlight.rb
                 &lt;/a&gt;</diff>
      <filename>rdoc/classes/Simplabs.html</filename>
    </modified>
    <modified>
      <diff>@@ -63,10 +63,6 @@
                 lib/simplabs/highlight/pygments_wrapper.rb
                 &lt;/a&gt;
         &lt;br /&gt;
-                &lt;a href=&quot;../../files/lib/simplabs/highlight/view_methods_rb.html&quot;&gt;
-                lib/simplabs/highlight/view_methods.rb
-                &lt;/a&gt;
-        &lt;br /&gt;
                 &lt;a href=&quot;../../files/lib/simplabs/highlight_rb.html&quot;&gt;
                 lib/simplabs/highlight.rb
                 &lt;/a&gt;
@@ -85,47 +81,26 @@
   &lt;div id=&quot;contextContent&quot;&gt;
 
     &lt;div id=&quot;description&quot;&gt;
-      &lt;p&gt;
-&lt;a href=&quot;Highlight.html&quot;&gt;Highlight&lt;/a&gt; is a simple source code highlighting
-plugin for Ruby on Rails. It&amp;#8216;s basically a wrapper around the python
-project pygments (&lt;a href=&quot;http://pygments.org&quot;&gt;pygments.org&lt;/a&gt;/) that
-support various languages.
-&lt;/p&gt;
-&lt;p&gt;
-The plugin adds a new method available in all templates:
-&lt;/p&gt;
-&lt;pre&gt;
- highlight(language, code)
-&lt;/pre&gt;
-&lt;p&gt;
-where language can be either a symbol or a string (most file extensions
-should work for example)
-&lt;/p&gt;
-&lt;p&gt;
-To perform the highlighting, the code is first written to a file in /tmp,
-e.g.:
-&lt;/p&gt;
-&lt;pre&gt;
- /tmp/highlight_1225993290.70882
-&lt;/pre&gt;
+      &lt;h1&gt;&lt;a href=&quot;Highlight.html&quot;&gt;Highlight&lt;/a&gt;&lt;/h1&gt;
 &lt;p&gt;
-Since writing that file, passing its contents on to pygments etc. takes a
-while, all highlighted source code should be cached of course, e.g.:
+&lt;a href=&quot;Highlight.html&quot;&gt;Highlight&lt;/a&gt; is a simple syntax highlighting
+plugin for Ruby on Rails. It&amp;#8216;s basically a wrapper around the popular
+&lt;a href=&quot;http://pygments.org&quot;&gt;pygments.org&lt;/a&gt; highlighter that&amp;#8216;s
+written in Python and supports a huge number of languages.
 &lt;/p&gt;
-&lt;pre&gt;
- &amp;lt;% cache do %&amp;gt;
-   &amp;lt;%= highlight(:ruby) do -%&amp;gt;
-     class Test
-     end
-   &amp;lt;% end -%&amp;gt;
- &amp;lt;% end %&amp;gt;
-&lt;/pre&gt;
 
     &lt;/div&gt;
 
 
    &lt;/div&gt;
 
+    &lt;div id=&quot;method-list&quot;&gt;
+      &lt;h3 class=&quot;section-bar&quot;&gt;Methods&lt;/h3&gt;
+
+      &lt;div class=&quot;name-list&quot;&gt;
+      &lt;a href=&quot;#M000001&quot;&gt;highlight&lt;/a&gt;&amp;nbsp;&amp;nbsp;
+      &lt;/div&gt;
+    &lt;/div&gt;
 
   &lt;/div&gt;
 
@@ -162,6 +137,144 @@ Class &lt;a href=&quot;Highlight/HighlightException.html&quot; class=&quot;link&quot;&gt;Simplabs::Highlig
 
 
     &lt;!-- if method_list --&gt;
+    &lt;div id=&quot;methods&quot;&gt;
+      &lt;h3 class=&quot;section-bar&quot;&gt;Public Class methods&lt;/h3&gt;
+
+      &lt;div id=&quot;method-M000001&quot; class=&quot;method-detail&quot;&gt;
+        &lt;a name=&quot;M000001&quot;&gt;&lt;/a&gt;
+
+        &lt;div class=&quot;method-heading&quot;&gt;
+          &lt;a href=&quot;#M000001&quot; class=&quot;method-signature&quot;&gt;
+          &lt;span class=&quot;method-name&quot;&gt;highlight&lt;/span&gt;&lt;span class=&quot;method-args&quot;&gt;(language, code)&lt;/span&gt;
+          &lt;/a&gt;
+        &lt;/div&gt;
+      
+        &lt;div class=&quot;method-description&quot;&gt;
+          &lt;p&gt;
+Highlights the passed &lt;tt&gt;code&lt;/tt&gt; with the appropriate rules according to
+the specified &lt;tt&gt;language&lt;/tt&gt;.
+&lt;/p&gt;
+&lt;p&gt;
+&lt;b&gt;Supported Languages&lt;/b&gt;
+&lt;/p&gt;
+&lt;p&gt;
+The following languages are supported. All of the paranthesized identifiers
+may be used as parameters for &lt;a
+href=&quot;Highlight.html#M000001&quot;&gt;highlight&lt;/a&gt; to denote the language the
+source code to &lt;a href=&quot;Highlight.html#M000001&quot;&gt;highlight&lt;/a&gt; is written in
+(use either Symbols or Strings).
+&lt;/p&gt;
+&lt;ul&gt;
+&lt;li&gt;Actionscript (as, as3, actionscript)
+
+&lt;/li&gt;
+&lt;li&gt;Applescript (applescript)
+
+&lt;/li&gt;
+&lt;li&gt;bash (bash, sh)
+
+&lt;/li&gt;
+&lt;li&gt;C (c, h)
+
+&lt;/li&gt;
+&lt;li&gt;Clojure (clojure)
+
+&lt;/li&gt;
+&lt;li&gt;C++ (c++, cpp, hpp)
+
+&lt;/li&gt;
+&lt;li&gt;C# (c#, csharp, cs)
+
+&lt;/li&gt;
+&lt;li&gt;CSS (css)
+
+&lt;/li&gt;
+&lt;li&gt;diff (diff)
+
+&lt;/li&gt;
+&lt;li&gt;Dylan (dylan)
+
+&lt;/li&gt;
+&lt;li&gt;Erlang (erlang, erl, er)
+
+&lt;/li&gt;
+&lt;li&gt;HTML (html, htm)
+
+&lt;/li&gt;
+&lt;li&gt;Java (java)
+
+&lt;/li&gt;
+&lt;li&gt;JavaScript (javascript, js, jscript)
+
+&lt;/li&gt;
+&lt;li&gt;JSP (jsp)
+
+&lt;/li&gt;
+&lt;li&gt;Make (make, basemake, makefile)
+
+&lt;/li&gt;
+&lt;li&gt;Objective-C (objective-c)
+
+&lt;/li&gt;
+&lt;li&gt;OCaml (ocaml)
+
+&lt;/li&gt;
+&lt;li&gt;Perl (perl, pl)
+
+&lt;/li&gt;
+&lt;li&gt;PHP (php)
+
+&lt;/li&gt;
+&lt;li&gt;Python (python, (py)
+
+&lt;/li&gt;
+&lt;li&gt;RHTML (erb, rhtml)
+
+&lt;/li&gt;
+&lt;li&gt;Ruby (ruby, rb)
+
+&lt;/li&gt;
+&lt;li&gt;Scala (scala)
+
+&lt;/li&gt;
+&lt;li&gt;Scheme (scheme)
+
+&lt;/li&gt;
+&lt;li&gt;Smalltalk (smalltalk)
+
+&lt;/li&gt;
+&lt;li&gt;Smarty (smarty)
+
+&lt;/li&gt;
+&lt;li&gt;SQL (sql)
+
+&lt;/li&gt;
+&lt;li&gt;XML (xml, xsd)
+
+&lt;/li&gt;
+&lt;li&gt;XSLT (xslt)
+
+&lt;/li&gt;
+&lt;li&gt;YAML (yaml, yml)
+
+&lt;/li&gt;
+&lt;/ul&gt;
+          &lt;p&gt;&lt;a class=&quot;source-toggle&quot; href=&quot;#&quot;
+            onclick=&quot;toggleCode('M000001-source');return false;&quot;&gt;[Source]&lt;/a&gt;&lt;/p&gt;
+          &lt;div class=&quot;method-source-code&quot; id=&quot;M000001-source&quot;&gt;
+&lt;pre&gt;
+    &lt;span class=&quot;ruby-comment cmt&quot;&gt;# File lib/simplabs/highlight.rb, line 83&lt;/span&gt;
+83:     &lt;span class=&quot;ruby-keyword kw&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;ruby-keyword kw&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;highlight&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;language&lt;/span&gt;, &lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;)
+84:       &lt;span class=&quot;ruby-keyword kw&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;ruby-constant&quot;&gt;CGI&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;escapeHTML&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;) &lt;span class=&quot;ruby-keyword kw&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;ruby-constant&quot;&gt;Simplabs&lt;/span&gt;&lt;span class=&quot;ruby-operator&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ruby-constant&quot;&gt;Highlight&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;initialized&lt;/span&gt;
+85:       &lt;span class=&quot;ruby-constant&quot;&gt;Simplabs&lt;/span&gt;&lt;span class=&quot;ruby-operator&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ruby-constant&quot;&gt;Highlight&lt;/span&gt;&lt;span class=&quot;ruby-operator&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ruby-constant&quot;&gt;PygmentsWrapper&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;highlight&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;, &lt;span class=&quot;ruby-identifier&quot;&gt;language&lt;/span&gt;)
+86:     &lt;span class=&quot;ruby-keyword kw&quot;&gt;end&lt;/span&gt;
+&lt;/pre&gt;
+          &lt;/div&gt;
+        &lt;/div&gt;
+      &lt;/div&gt;
+
+
+    &lt;/div&gt;
 
 
   &lt;/div&gt;</diff>
      <filename>rdoc/classes/Simplabs/Highlight.html</filename>
    </modified>
    <modified>
      <diff>@@ -55,8 +55,8 @@
         &lt;tr class=&quot;top-aligned-row&quot;&gt;
             &lt;td&gt;&lt;strong&gt;In:&lt;/strong&gt;&lt;/td&gt;
             &lt;td&gt;
-                &lt;a href=&quot;../../../files/lib/simplabs/highlight/view_methods_rb.html&quot;&gt;
-                lib/simplabs/highlight/view_methods.rb
+                &lt;a href=&quot;../../../files/lib/simplabs/highlight_rb.html&quot;&gt;
+                lib/simplabs/highlight.rb
                 &lt;/a&gt;
         &lt;br /&gt;
             &lt;/td&gt;
@@ -74,7 +74,7 @@
 
     &lt;div id=&quot;description&quot;&gt;
       &lt;p&gt;
-Defines methods for highlighting source code in templates
+&lt;a href=&quot;../Highlight.html&quot;&gt;Highlight&lt;/a&gt; view methods
 &lt;/p&gt;
 
     &lt;/div&gt;
@@ -86,7 +86,7 @@ Defines methods for highlighting source code in templates
       &lt;h3 class=&quot;section-bar&quot;&gt;Methods&lt;/h3&gt;
 
       &lt;div class=&quot;name-list&quot;&gt;
-      &lt;a href=&quot;#M000001&quot;&gt;highlight&lt;/a&gt;&amp;nbsp;&amp;nbsp;
+      &lt;a href=&quot;#M000002&quot;&gt;highlight&lt;/a&gt;&amp;nbsp;&amp;nbsp;
       &lt;/div&gt;
     &lt;/div&gt;
 
@@ -108,28 +108,49 @@ Defines methods for highlighting source code in templates
     &lt;div id=&quot;methods&quot;&gt;
       &lt;h3 class=&quot;section-bar&quot;&gt;Public Instance methods&lt;/h3&gt;
 
-      &lt;div id=&quot;method-M000001&quot; class=&quot;method-detail&quot;&gt;
-        &lt;a name=&quot;M000001&quot;&gt;&lt;/a&gt;
+      &lt;div id=&quot;method-M000002&quot; class=&quot;method-detail&quot;&gt;
+        &lt;a name=&quot;M000002&quot;&gt;&lt;/a&gt;
 
         &lt;div class=&quot;method-heading&quot;&gt;
-          &lt;a href=&quot;#M000001&quot; class=&quot;method-signature&quot;&gt;
-          &lt;span class=&quot;method-name&quot;&gt;highlight&lt;/span&gt;&lt;span class=&quot;method-args&quot;&gt;(language, code)&lt;/span&gt;
+          &lt;a href=&quot;#M000002&quot; class=&quot;method-signature&quot;&gt;
+          &lt;span class=&quot;method-name&quot;&gt;highlight&lt;/span&gt;&lt;span class=&quot;method-args&quot;&gt;(language, code = nil) {|| ...}&lt;/span&gt;
           &lt;/a&gt;
         &lt;/div&gt;
       
         &lt;div class=&quot;method-description&quot;&gt;
           &lt;p&gt;
-Highlights &lt;tt&gt;code&lt;/tt&gt; according to the syntax of &lt;tt&gt;language&lt;/tt&gt;
+Highlights the passed &lt;tt&gt;code&lt;/tt&gt; with the appropriate rules according to
+the specified &lt;tt&gt;language&lt;/tt&gt;. The code can be specified either as a
+string or as result f a block.
+&lt;/p&gt;
+&lt;p&gt;
+&lt;b&gt;Examples:&lt;/b&gt;
+&lt;/p&gt;
+&lt;pre&gt;
+ highlight(:ruby, 'class Test; end')
+
+ highlight(:ruby) do
+    &amp;lt;&amp;lt;-EOF
+            class Test
+                 end
+    EOF
+ end
+&lt;/pre&gt;
+&lt;p&gt;
+Also see &lt;a
+href=&quot;../Highlight.html#M000001&quot;&gt;Simplabs::Highlight.highlight&lt;/a&gt;
 &lt;/p&gt;
           &lt;p&gt;&lt;a class=&quot;source-toggle&quot; href=&quot;#&quot;
-            onclick=&quot;toggleCode('M000001-source');return false;&quot;&gt;[Source]&lt;/a&gt;&lt;/p&gt;
-          &lt;div class=&quot;method-source-code&quot; id=&quot;M000001-source&quot;&gt;
+            onclick=&quot;toggleCode('M000002-source');return false;&quot;&gt;[Source]&lt;/a&gt;&lt;/p&gt;
+          &lt;div class=&quot;method-source-code&quot; id=&quot;M000002-source&quot;&gt;
 &lt;pre&gt;
-    &lt;span class=&quot;ruby-comment cmt&quot;&gt;# File lib/simplabs/highlight/view_methods.rb, line 9&lt;/span&gt;
- 9:       &lt;span class=&quot;ruby-keyword kw&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;ruby-identifier&quot;&gt;highlight&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;language&lt;/span&gt;, &lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;)
-10:         &lt;span class=&quot;ruby-keyword kw&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;ruby-constant&quot;&gt;CGI&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;escapeHTML&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;) &lt;span class=&quot;ruby-keyword kw&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;ruby-constant&quot;&gt;Simplabs&lt;/span&gt;&lt;span class=&quot;ruby-operator&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ruby-constant&quot;&gt;Highlight&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;initialized&lt;/span&gt;
-11:         &lt;span class=&quot;ruby-constant&quot;&gt;Simplabs&lt;/span&gt;&lt;span class=&quot;ruby-operator&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ruby-constant&quot;&gt;Highlight&lt;/span&gt;&lt;span class=&quot;ruby-operator&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ruby-constant&quot;&gt;PygmentsWrapper&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;highlight&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;, &lt;span class=&quot;ruby-identifier&quot;&gt;language&lt;/span&gt;)
-12:       &lt;span class=&quot;ruby-keyword kw&quot;&gt;end&lt;/span&gt;
+     &lt;span class=&quot;ruby-comment cmt&quot;&gt;# File lib/simplabs/highlight.rb, line 106&lt;/span&gt;
+106:       &lt;span class=&quot;ruby-keyword kw&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;ruby-identifier&quot;&gt;highlight&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;language&lt;/span&gt;, &lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt; = &lt;span class=&quot;ruby-keyword kw&quot;&gt;nil&lt;/span&gt;, &lt;span class=&quot;ruby-operator&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;ruby-identifier&quot;&gt;block&lt;/span&gt;)
+107:         &lt;span class=&quot;ruby-identifier&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;ruby-constant&quot;&gt;ArgumentError&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;ruby-value str&quot;&gt;'Either pass a srting containing the code or a block, not both!'&lt;/span&gt;) &lt;span class=&quot;ruby-keyword kw&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;ruby-operator&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;nil?&lt;/span&gt; &lt;span class=&quot;ruby-operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;ruby-identifier&quot;&gt;block_given?&lt;/span&gt;
+108:         &lt;span class=&quot;ruby-identifier&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;ruby-constant&quot;&gt;ArgumentError&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;ruby-value str&quot;&gt;'Pass a srting containing the code or a block!'&lt;/span&gt;) &lt;span class=&quot;ruby-keyword kw&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;nil?&lt;/span&gt; &lt;span class=&quot;ruby-operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;ruby-operator&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;ruby-identifier&quot;&gt;block_given?&lt;/span&gt;
+109:         &lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt; &lt;span class=&quot;ruby-operator&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;ruby-keyword kw&quot;&gt;yield&lt;/span&gt;
+110:         &lt;span class=&quot;ruby-constant&quot;&gt;Simplabs&lt;/span&gt;&lt;span class=&quot;ruby-operator&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ruby-constant&quot;&gt;Highlight&lt;/span&gt;.&lt;span class=&quot;ruby-identifier&quot;&gt;highlight&lt;/span&gt;(&lt;span class=&quot;ruby-identifier&quot;&gt;language&lt;/span&gt;, &lt;span class=&quot;ruby-identifier&quot;&gt;code&lt;/span&gt;)
+111:       &lt;span class=&quot;ruby-keyword kw&quot;&gt;end&lt;/span&gt;
 &lt;/pre&gt;
           &lt;/div&gt;
         &lt;/div&gt;</diff>
      <filename>rdoc/classes/Simplabs/Highlight/ViewMethods.html</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-Thu, 06 Nov 2008 20:00:18 +0100
+Sat, 14 Mar 2009 18:50:10 +0100</diff>
      <filename>rdoc/created.rid</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@
     &lt;/tr&gt;
     &lt;tr class=&quot;top-aligned-row&quot;&gt;
       &lt;td&gt;&lt;strong&gt;Last Update:&lt;/strong&gt;&lt;/td&gt;
-      &lt;td&gt;Thu Nov 06 19:59:36 +0100 2008&lt;/td&gt;
+      &lt;td&gt;Sat Mar 14 18:42:35 +0100 2009&lt;/td&gt;
     &lt;/tr&gt;
     &lt;/table&gt;
   &lt;/div&gt;
@@ -71,21 +71,36 @@
     &lt;div id=&quot;description&quot;&gt;
       &lt;h1&gt;Highlight&lt;/h1&gt;
 &lt;p&gt;
-Highlight is a simple source code highlighting plugin for Ruby on Rails.
-It&amp;#8216;s basically a wrapper around the python project pygments (&lt;a
-href=&quot;http://pygments.org&quot;&gt;pygments.org&lt;/a&gt;/) that support various
-languages.
+Highlight is a simple syntax highlighting plugin for Ruby on Rails.
+It&amp;#8216;s basically a wrapper around the popular &lt;a
+href=&quot;http://pygments.org&quot;&gt;pygments.org&lt;/a&gt; highlighter that&amp;#8216;s
+written in Python and supports a huge number of languages.
 &lt;/p&gt;
 &lt;p&gt;
-The plugin adds a new method available in all templates:
+Highlight provides a new method that&amp;#8216;s available in views:
 &lt;/p&gt;
 &lt;pre&gt;
-  highlight(language, code)
+  highlight(language, code = nil, &amp;amp;block)
 &lt;/pre&gt;
 &lt;p&gt;
-where language can be either a symbol or a string (most file extensions
-should work for example)
+&lt;tt&gt;language&lt;/tt&gt; may be either a Symbolor a String (see supported
+languages below). The code can be passed either as a string or inside a
+block, e.g.:
 &lt;/p&gt;
+&lt;pre&gt;
+        highlight(:ruby, 'class Test; end')
+&lt;/pre&gt;
+&lt;p&gt;
+or
+&lt;/p&gt;
+&lt;pre&gt;
+        highlight(:ruby) do
+                &amp;lt;&amp;lt;-EOF
+                        class Test
+                        end
+                EOF
+        end
+&lt;/pre&gt;
 &lt;p&gt;
 To perform the highlighting, the code is first written to a file in /tmp,
 e.g.:
@@ -94,8 +109,12 @@ e.g.:
   /tmp/highlight_1225993290.70882
 &lt;/pre&gt;
 &lt;p&gt;
-Since writing that file, passing its contents on to pygments etc. takes a
-while, all highlighted source code should be cached of course, e.g.:
+This file is the passed to pygments that returns the HTML and so on&amp;#8230;
+&lt;/p&gt;
+&lt;p&gt;
+Since writing that file, passing its contents on to pygments, retrieve the
+result etc. takes a while, all highlighted source code should be cached of
+course, e.g.:
 &lt;/p&gt;
 &lt;pre&gt;
   &amp;lt;% cache do %&amp;gt;
@@ -106,7 +125,7 @@ while, all highlighted source code should be cached of course, e.g.:
 &lt;p&gt;
 The following languages are supported. All of the paranthesized identifiers
 may be used as parameters for highlight to denote the language the source
-code to highlight is written in.
+code to highlight is written in (use either Symbols or Strings).
 &lt;/p&gt;
 &lt;pre&gt;
   * Actionscript (as, as3, actionscript)
@@ -149,12 +168,21 @@ Installation is as easy as (for Rails &amp;gt; 2.1):
   ./script/plugin install git@github.com:marcoow/highlight.git
 &lt;/pre&gt;
 &lt;p&gt;
+The hightlight.css stylesheet that contains the neccessary style
+definitions should be copied to your public/stylesheets directory
+automagically.
+&lt;/p&gt;
+&lt;p&gt;
 If you are on Rails &amp;lt; 2.1, do this from your RAILS_ROOT
 &lt;/p&gt;
 &lt;pre&gt;
   git clone git@github.com:marcoow/highlight.git vendor/plugins/highlight
 &lt;/pre&gt;
 &lt;p&gt;
+In this case you would have to copy the hightlight.css stylesheets manually
+from vendor/plugins/highlight/assets/stylesheets/.
+&lt;/p&gt;
+&lt;p&gt;
 If you don&amp;#8216;t have python and pygments installed, you will need that
 too. For instructions on installing pygments, refer to &lt;a
 href=&quot;http://pygments.org/docs/installation&quot;&gt;pygments.org/docs/installation&lt;/a&gt;/
@@ -167,14 +195,14 @@ href=&quot;http://simplabs.lighthouseapp.com/projects/19387-highlight/overview&quot;&gt;simpl
 &lt;/p&gt;
 &lt;h2&gt;Author&lt;/h2&gt;
 &lt;p&gt;
-Copyright (c) 2008 Marco Otte-Witte (&lt;a
-href=&quot;http://simplabs.com/#projects&quot;&gt;simplabs.com/#projects&lt;/a&gt;), released
-under the MIT license
+Copyright (c) 2008-2009 Marco Otte-Witte (&lt;a
+href=&quot;http://simplabs.com&quot;&gt;simplabs.com&lt;/a&gt;), released under the MIT
+license
 &lt;/p&gt;
 &lt;h2&gt;Acknowledgements&lt;/h2&gt;
 &lt;p&gt;
 The actual highlighting is done by Pygments (&lt;a
-href=&quot;http://pygments.org&quot;&gt;pygments.org&lt;/a&gt;/).
+href=&quot;http://pygments.org&quot;&gt;pygments.org&lt;/a&gt;).
 &lt;/p&gt;
 
     &lt;/div&gt;</diff>
      <filename>rdoc/files/README_rdoc.html</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@
     &lt;/tr&gt;
     &lt;tr class=&quot;top-aligned-row&quot;&gt;
       &lt;td&gt;&lt;strong&gt;Last Update:&lt;/strong&gt;&lt;/td&gt;
-      &lt;td&gt;Thu Nov 06 20:00:02 +0100 2008&lt;/td&gt;
+      &lt;td&gt;Sat Mar 14 18:50:07 +0100 2009&lt;/td&gt;
     &lt;/tr&gt;
     &lt;/table&gt;
   &lt;/div&gt;</diff>
      <filename>rdoc/files/lib/simplabs/highlight_rb.html</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,6 @@
     &lt;a href=&quot;files/lib/simplabs/highlight_rb.html&quot;&gt;lib/simplabs/highlight.rb&lt;/a&gt;&lt;br /&gt;
     &lt;a href=&quot;files/lib/simplabs/highlight/highlight_exception_rb.html&quot;&gt;lib/simplabs/highlight/highlight_exception.rb&lt;/a&gt;&lt;br /&gt;
     &lt;a href=&quot;files/lib/simplabs/highlight/pygments_wrapper_rb.html&quot;&gt;lib/simplabs/highlight/pygments_wrapper.rb&lt;/a&gt;&lt;br /&gt;
-    &lt;a href=&quot;files/lib/simplabs/highlight/view_methods_rb.html&quot;&gt;lib/simplabs/highlight/view_methods.rb&lt;/a&gt;&lt;br /&gt;
   &lt;/div&gt;
 &lt;/div&gt;
 &lt;/body&gt;</diff>
      <filename>rdoc/fr_file_index.html</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,8 @@
 &lt;div id=&quot;index&quot;&gt;
   &lt;h1 class=&quot;section-bar&quot;&gt;Methods&lt;/h1&gt;
   &lt;div id=&quot;index-entries&quot;&gt;
-    &lt;a href=&quot;classes/Simplabs/Highlight/ViewMethods.html#M000001&quot;&gt;highlight (Simplabs::Highlight::ViewMethods)&lt;/a&gt;&lt;br /&gt;
+    &lt;a href=&quot;classes/Simplabs/Highlight.html#M000001&quot;&gt;highlight (Simplabs::Highlight)&lt;/a&gt;&lt;br /&gt;
+    &lt;a href=&quot;classes/Simplabs/Highlight/ViewMethods.html#M000002&quot;&gt;highlight (Simplabs::Highlight::ViewMethods)&lt;/a&gt;&lt;br /&gt;
   &lt;/div&gt;
 &lt;/div&gt;
 &lt;/body&gt;</diff>
      <filename>rdoc/fr_method_index.html</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/simplabs/highlight/highlight_exception.rb</filename>
    </removed>
    <removed>
      <filename>lib/simplabs/highlight/view_methods.rb</filename>
    </removed>
    <removed>
      <filename>rdoc/files/lib/simplabs/highlight/view_methods_rb.html</filename>
    </removed>
    <removed>
      <filename>spec/other/pygments_wrapper_spec.rb</filename>
    </removed>
    <removed>
      <filename>spec/other/view_methods_spec.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>8cdd126d2d129a366da0dd7428af8a39f1dff74e</id>
    </parent>
  </parents>
  <author>
    <name>Marco Otte-Witte</name>
    <email>marco.otte-witte@simplabs.com</email>
  </author>
  <url>http://github.com/marcoow/highlight/commit/56a40a2b731d0cbd47beab533f4726a4728aa2da</url>
  <id>56a40a2b731d0cbd47beab533f4726a4728aa2da</id>
  <committed-date>2009-03-14T10:52:34-07:00</committed-date>
  <authored-date>2009-03-14T10:52:34-07:00</authored-date>
  <message>some refactorings, updated README</message>
  <tree>3aadc177dd55a48f7ad543b3d38075f8fac84715</tree>
  <committer>
    <name>Marco Otte-Witte</name>
    <email>marco.otte-witte@simplabs.com</email>
  </committer>
</commit>
