diff options
Diffstat (limited to 'sample/demo_html2.computed')
-rw-r--r-- | sample/demo_html2.computed | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/sample/demo_html2.computed b/sample/demo_html2.computed new file mode 100644 index 0000000..ead61b2 --- /dev/null +++ b/sample/demo_html2.computed @@ -0,0 +1,159 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>CodeRay HTML Encoder Example</title> + <style type="text/css"> +.CodeRay { + background-color: #f8f8f8; + border: 1px solid silver; + font-family: 'Courier New', 'Terminal', monospace; + color: #100; +} +.CodeRay pre { margin: 0px } + +div.CodeRay { } + +span.CodeRay { white-space: pre; border: 0px; padding: 2px } + +table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px } +table.CodeRay td { padding: 2px 4px; vertical-align: top } + +.CodeRay .line_numbers, .CodeRay .no { + background-color: #def; + color: gray; + text-align: right; +} +.CodeRay .line_numbers tt { font-weight: bold } +.CodeRay .no { padding: 0px 4px } +.CodeRay .code { width: 100% } + +ol.CodeRay { font-size: 10pt } +ol.CodeRay li { white-space: pre } + +.CodeRay .code pre { overflow: auto } + +.CodeRay .af { color:#00C } +.CodeRay .an { color:#007 } +.CodeRay .av { color:#700 } +.CodeRay .aw { color:#C00 } +.CodeRay .bi { color:#509; font-weight:bold } +.CodeRay .c { color:#888 } + +.CodeRay .ch { color:#04D } +.CodeRay .ch .k { color:#04D } +.CodeRay .ch .dl { color:#039 } + +.CodeRay .cl { color:#B06; font-weight:bold } +.CodeRay .co { color:#036; font-weight:bold } +.CodeRay .cr { color:#0A0 } +.CodeRay .cv { color:#369 } +.CodeRay .df { color:#099; font-weight:bold } +.CodeRay .di { color:#088; font-weight:bold } +.CodeRay .dl { color:black } +.CodeRay .do { color:#970 } +.CodeRay .ds { color:#D42; font-weight:bold } +.CodeRay .e { color:#666; font-weight:bold } +.CodeRay .en { color:#800; font-weight:bold } +.CodeRay .er { color:#F00; background-color:#FAA } +.CodeRay .ex { color:#F00; font-weight:bold } +.CodeRay .fl { color:#60E; font-weight:bold } +.CodeRay .fu { color:#06B; font-weight:bold } +.CodeRay .gv { color:#d70; font-weight:bold } +.CodeRay .hx { color:#058; font-weight:bold } +.CodeRay .i { color:#00D; font-weight:bold } +.CodeRay .ic { color:#B44; font-weight:bold } + +.CodeRay .il { background: #eee } +.CodeRay .il .il { background: #ddd } +.CodeRay .il .il .il { background: #ccc } +.CodeRay .il .dl { font-weight: bold ! important; color: #888 ! important } + +.CodeRay .in { color:#B2B; font-weight:bold } +.CodeRay .iv { color:#33B } +.CodeRay .la { color:#970; font-weight:bold } +.CodeRay .lv { color:#963 } +.CodeRay .oc { color:#40E; font-weight:bold } +.CodeRay .on { color:#000; font-weight:bold } +.CodeRay .op { } +.CodeRay .pc { color:#038; font-weight:bold } +.CodeRay .pd { color:#369; font-weight:bold } +.CodeRay .pp { color:#579 } +.CodeRay .pt { color:#339; font-weight:bold } +.CodeRay .r { color:#080; font-weight:bold } + +.CodeRay .rx { background-color:#fff0ff } +.CodeRay .rx .k { color:#808 } +.CodeRay .rx .dl { color:#404 } +.CodeRay .rx .mod { color:#C2C } +.CodeRay .rx .fu { color:#404; font-weight: bold } + +.CodeRay .s { background-color:#fff0f0 } +.CodeRay .s .s { background-color:#ffe0e0 } +.CodeRay .s .s .s { background-color:#ffd0d0 } +.CodeRay .s .k { color:#D20 } +.CodeRay .s .dl { color:#710 } + +.CodeRay .sh { background-color:#f0fff0 } +.CodeRay .sh .k { color:#2B2 } +.CodeRay .sh .dl { color:#161 } + +.CodeRay .sy { color:#A60 } +.CodeRay .sy .k { color:#A60 } +.CodeRay .sy .dl { color:#630 } + +.CodeRay .ta { color:#070 } +.CodeRay .tf { color:#070; font-weight:bold } +.CodeRay .ts { color:#D70; font-weight:bold } +.CodeRay .ty { color:#339; font-weight:bold } +.CodeRay .v { color:#036 } +.CodeRay .xt { color:#444 } + + </style> +</head> +<body style="background-color: white;"> + +<table class="CodeRay"><tr> + <td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1<tt> +</tt>2<tt> +</tt>3<tt> +</tt>4<tt> +</tt>5<tt> +</tt>6<tt> +</tt>7<tt> +</tt>8<tt> +</tt>9<tt> +</tt><strong>10</strong><tt> +</tt>11<tt> +</tt></pre></td> + <td class="code"><pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">coderay</span><span style="color:#710">'</span></span><tt> +</tt><tt> +</tt><span style="color:#888"># scan this file</span><tt> +</tt>tokens = <span style="color:#036; font-weight:bold">CodeRay</span>.scan(<span style="color:#036; font-weight:bold">File</span>.read(<span style="color:#d70; font-weight:bold">$0</span>) * <span style="color:#00D; font-weight:bold">1</span>, <span style="color:#A60">:ruby</span>)<tt> +</tt><tt> +</tt><span style="color:#888"># output it with two styles of line numbers</span><tt> +</tt>out = tokens.div(<span style="color:#A60">:line_numbers</span> => <span style="color:#A60">:table</span>)<tt> +</tt>out << <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20"><hr /></span><span style="color:#710">'</span></span><tt> +</tt>out << tokens.div(<span style="color:#A60">:line_numbers</span> => <span style="color:#A60">:inline</span>, <span style="color:#A60">:line_number_start</span> => <span style="color:#00D; font-weight:bold">8</span>)<tt> +</tt><tt> +</tt>puts out.page<tt> +</tt></pre></td> +</tr></table> +<hr /><div class="CodeRay"> + <div class="code"><pre><span class="no"> 8</span> require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">coderay</span><span style="color:#710">'</span></span> +<span class="no"> 9</span> +<span class="no"><strong>10</strong></span> <span style="color:#888"># scan this file</span> +<span class="no">11</span> tokens = <span style="color:#036; font-weight:bold">CodeRay</span>.scan(<span style="color:#036; font-weight:bold">File</span>.read(<span style="color:#d70; font-weight:bold">$0</span>) * <span style="color:#00D; font-weight:bold">1</span>, <span style="color:#A60">:ruby</span>) +<span class="no">12</span> +<span class="no">13</span> <span style="color:#888"># output it with two styles of line numbers</span> +<span class="no">14</span> out = tokens.div(<span style="color:#A60">:line_numbers</span> => <span style="color:#A60">:table</span>) +<span class="no">15</span> out << <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20"><hr /></span><span style="color:#710">'</span></span> +<span class="no">16</span> out << tokens.div(<span style="color:#A60">:line_numbers</span> => <span style="color:#A60">:inline</span>, <span style="color:#A60">:line_number_start</span> => <span style="color:#00D; font-weight:bold">8</span>) +<span class="no">17</span> +<span class="no">18</span> puts out.page +</pre></div> +</div> + +</body> +</html> |