Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

adding an example

  • Loading branch information...
commit 60a713aad678dd2d34081e2682f231be028abb1e 1 parent 36abde7
@danielpietzsch authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 example.html
26 example.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<html lang="en">
+ <meta charset="utf-8">
+ <title>CodeRay Stylesheet Example</title>
+ <link rel="stylesheet" href="coderay.css" type="text/css">
+ <h1>Example</h1>
+ <p>Here's a Ruby code snippet that was scanned with CodeRay like this:</p>
+ <p><code>CodeRay.scan("class Hello\n def say_hello_to(name = \"Joe\")\n puts \"Hello \#\{name\}\"\n end\nend\n\nh =\nh.say_hello_to(\"Jane\")\n# => Hello Jane", :ruby).div(:css => :class)</code></p>
+<div class="CodeRay">
+ <div class="code"><pre><span class="keyword">class</span> <span class="class">Hello</span>
+ <span class="keyword">def</span> <span class="function">say_hello_to</span>(name = <span class="string"><span class="delimiter">&quot;</span><span class="content">Joe</span><span class="delimiter">&quot;</span></span>)
+ puts <span class="string"><span class="delimiter">&quot;</span><span class="content">Hello </span><span class="inline"><span class="inline-delimiter">#{</span>name<span class="inline-delimiter">}</span></span><span class="delimiter">&quot;</span></span>
+ <span class="keyword">end</span>
+<span class="keyword">end</span>
+h = <span class="constant">Hello</span>.new
+h.say_hello_to(<span class="string"><span class="delimiter">&quot;</span><span class="content">Jane</span><span class="delimiter">&quot;</span></span>)
+<span class="comment"># =&gt; Hello Jane</span></pre></div>
Please sign in to comment.
Something went wrong with that request. Please try again.