Skip to content

Commit

Permalink
Updates examples in accordance with the previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
vonavi committed Jan 11, 2013
1 parent c29d00f commit 671f858
Show file tree
Hide file tree
Showing 45 changed files with 678 additions and 1,355 deletions.
66 changes: 22 additions & 44 deletions spec/html_code_syntax_highlight_examples/advanced-code-coderay.html
@@ -1,11 +1,7 @@
<p class="title">advanced-code-coderay.org
</p>
<p>Turns out there&#8217;s more way to do code than just BEGIN_EXAMPLE.
</p>
<h1><span class="heading-number heading-number-1">1 </span>Inline examples
</h1>
<p>This should work:
</p>
<p class="title">advanced-code-coderay.org</p>
<p>Turns out there&#8217;s more way to do code than just BEGIN_EXAMPLE.</p>
<h1><span class="heading-number heading-number-1">1 </span>Inline examples</h1>
<p>This should work:</p>
<pre class="example">
fixed width? how does this work?
...........
Expand All @@ -17,12 +13,9 @@ <h1><span class="heading-number heading-number-1">1 </span>Inline examples
. .
....
</pre>
<p>Two ASCII blobs.
</p>
<h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC
</h1>
<p>And this:
</p>
<p>Two ASCII blobs.</p>
<h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC</h1>
<p>And this:</p>
<pre class="src src-ruby">
<span style="color:#777"># Finds all emphasis matches in a string.</span>
<span style="color:#777"># Supply a block that will get the marker and body as parameters.</span>
Expand All @@ -32,8 +25,7 @@ <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC
<span style="color:#080;font-weight:bold">end</span>
<span style="color:#080;font-weight:bold">end</span>
</pre>
<p>Now let&#8217;s test case-insensitive code blocks.
</p>
<p>Now let&#8217;s test case-insensitive code blocks.</p>
<pre class="src src-ruby">
<span style="color:#777"># Finds all emphasis matches in a string.</span>
<span style="color:#777"># Supply a block that will get the marker and body as parameters.</span>
Expand All @@ -53,18 +45,15 @@ <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC
user&gt; (<span style="color:#080;font-weight:bold">take</span> <span style="color:#00D">20</span> fib-seq)
(<span style="color:#00D">0</span> <span style="color:#00D">1</span> <span style="color:#00D">1</span> <span style="color:#00D">2</span> <span style="color:#00D">3</span> <span style="color:#00D">5</span> <span style="color:#00D">8</span> <span style="color:#00D">13</span> <span style="color:#00D">21</span> <span style="color:#00D">34</span> <span style="color:#00D">55</span> <span style="color:#00D">89</span> <span style="color:#00D">144</span> <span style="color:#00D">233</span> <span style="color:#00D">377</span> <span style="color:#00D">610</span> <span style="color:#00D">987</span> <span style="color:#00D">1597</span> <span style="color:#00D">2584</span> <span style="color:#00D">4181</span>)
</pre>
<p>Even if no language is set, it is still wrapped in code tags but class is empty.
</p>
<p>Even if no language is set, it is still wrapped in code tags but class is empty.</p>
<pre class="src">
echo 'Defaults env_keeps=&quot;http_proxy https_proxy ftp_proxy&quot;' | sudo tee -a /etc/sudoers
</pre>
<h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example
</h1>
<h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example</h1>
<blockquote>
<p>I really love to write about
:symbols. They sure are the
best things in the world!
</p>
best things in the world!</p>
</blockquote>
<pre class="src src-ruby">
{
Expand All @@ -80,15 +69,12 @@ <h1><span class="heading-number heading-number-1">3 </span>It should be possible
<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="color:#D20">1.0-SNAPSHOT</span><span style="color:#710">&quot;</span></span>]]
<span style="color:#A60">:main</span> helloworld)
</pre>
<h1><span class="heading-number heading-number-1">4 </span>Code syntax highlight with Coderay
</h1>
<h2><span class="heading-number heading-number-2">4.1 </span>No language selected
</h2>
<h1><span class="heading-number heading-number-1">4 </span>Code syntax highlight with Coderay</h1>
<h2><span class="heading-number heading-number-2">4.1 </span>No language selected</h2>
<pre class="src">
Nothing to see here
</pre>
<h2><span class="heading-number heading-number-2">4.2 </span>CSS example
</h2>
<h2><span class="heading-number heading-number-2">4.2 </span>CSS example</h2>
<pre class="src src-css">
<span style="color:#339;font-weight:bold">*</span> {
<span style="color:#777">/* apply a natural box layout model to all elements */</span>
Expand All @@ -97,8 +83,7 @@ <h2><span class="heading-number heading-number-2">4.2 </span>CSS example
<span style="color:#606">-webkit-box-sizing</span>: <span style="color:#088">border-box</span>;
}
</pre>
<h2><span class="heading-number heading-number-2">4.3 </span>HTML example
</h2>
<h2><span class="heading-number heading-number-2">4.3 </span>HTML example</h2>
<pre class="src src-html">
<span style="color:#070">&lt;html&gt;</span>
<span style="color:#070">&lt;head&gt;</span>
Expand All @@ -109,25 +94,22 @@ <h2><span class="heading-number heading-number-2">4.3 </span>HTML example
<span style="color:#070">&lt;/body&gt;</span>
<span style="color:#070">&lt;/html&gt;</span>
</pre>
<h2><span class="heading-number heading-number-2">4.4 </span>Ruby example
</h2>
<h2><span class="heading-number heading-number-2">4.4 </span>Ruby example</h2>
<pre class="src src-ruby">
<span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Post</span> &lt;&lt; <span style="color:#036;font-weight:bold">ActiveRecord</span>::<span style="color:#036;font-weight:bold">Base</span>
<span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">print_title</span>
puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span><span style="color:#069">self</span>.title<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">&quot;</span></span>
<span style="color:#080;font-weight:bold">end</span>
<span style="color:#080;font-weight:bold">end</span>
</pre>
<h2><span class="heading-number heading-number-2">4.5 </span>Python example
</h2>
<h2><span class="heading-number heading-number-2">4.5 </span>Python example</h2>
<pre class="src src-python">
<span style="color:#080;font-weight:bold">import</span> <span style="color:#B44;font-weight:bold">mapnik</span>

m = mapnik.Map(<span style="color:#00D">600</span>, <span style="color:#00D">800</span>)
m.background = Map.Color(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">steelblue</span><span style="color:#710">'</span></span>)
</pre>
<h2><span class="heading-number heading-number-2">4.6 </span>Javascript example
</h2>
<h2><span class="heading-number heading-number-2">4.6 </span>Javascript example</h2>
<pre class="src src-javascript">
exports = <span style="color:#963">this</span>;

Expand All @@ -141,29 +123,25 @@ <h2><span class="heading-number heading-number-2">4.6 </span>Javascript example

})(jQuery);
</pre>
<h2><span class="heading-number heading-number-2">4.7 </span>JSON example
</h2>
<h2><span class="heading-number heading-number-2">4.7 </span>JSON example</h2>
<pre class="src src-json">
{ <span style="color:#F00;background-color:#FAA">n</span><span style="color:#F00;background-color:#FAA">a</span><span style="color:#F00;background-color:#FAA">m</span><span style="color:#F00;background-color:#FAA">e</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="color:#D20">Waldemar</span><span style="color:#710">&quot;</span></span>
, <span style="color:#F00;background-color:#FAA">s</span><span style="color:#F00;background-color:#FAA">u</span><span style="color:#F00;background-color:#FAA">r</span><span style="color:#F00;background-color:#FAA">n</span><span style="color:#F00;background-color:#FAA">a</span><span style="color:#F00;background-color:#FAA">m</span><span style="color:#F00;background-color:#FAA">e</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="color:#D20">Quevedo</span><span style="color:#710">&quot;</span></span>
}
</pre>
<h2><span class="heading-number heading-number-2">4.8 </span>PHP example
</h2>
<h2><span class="heading-number heading-number-2">4.8 </span>PHP example</h2>
<pre class="src src-php">
<span style="color:#369;font-weight:bold">echo</span> <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="color:#D20">Hello</span><span style="color:#710">&quot;</span></span>;
<span style="color:#369;font-weight:bold">phpinfo</span>();
<span style="color:#369;font-weight:bold">var_dump</span>(some_var);
</pre>
<h2><span class="heading-number heading-number-2">4.9 </span>Elisp example
</h2>
<h2><span class="heading-number heading-number-2">4.9 </span>Elisp example</h2>
<pre class="src src-emacs-lisp">
(defun hello()
(interactive)
(message &quot;hello&quot;))
</pre>
<h2><span class="heading-number heading-number-2">4.10 </span>Not supported language example
</h2>
<h2><span class="heading-number heading-number-2">4.10 </span>Not supported language example</h2>
<pre class="src src-notsupported">
!+!+++!++!++!++!+
</pre>
@@ -1,11 +1,7 @@
<p class="title">advanced-code.org
</p>
<p>Turns out there&#8217;s more way to do code than just BEGIN_EXAMPLE.
</p>
<h1><span class="heading-number heading-number-1">1 </span>Inline examples
</h1>
<p>This should work:
</p>
<p class="title">advanced-code.org</p>
<p>Turns out there&#8217;s more way to do code than just BEGIN_EXAMPLE.</p>
<h1><span class="heading-number heading-number-1">1 </span>Inline examples</h1>
<p>This should work:</p>
<pre class="example">
fixed width? how does this work?
...........
Expand All @@ -17,12 +13,9 @@ <h1><span class="heading-number heading-number-1">1 </span>Inline examples
. .
....
</pre>
<p>Two ASCII blobs.
</p>
<h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC
</h1>
<p>And this:
</p>
<p>Two ASCII blobs.</p>
<h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC</h1>
<p>And this:</p>
<pre class="src src-ruby">
# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
Expand All @@ -32,8 +25,7 @@ <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC
end
end
</pre>
<p>Now let&#8217;s test case-insensitive code blocks.
</p>
<p>Now let&#8217;s test case-insensitive code blocks.</p>
<pre class="src src-ruby">
# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
Expand All @@ -53,18 +45,15 @@ <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC
user&gt; (take 20 fib-seq)
(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)
</pre>
<p>Even if no language is set, it is still wrapped in code tags but class is empty.
</p>
<p>Even if no language is set, it is still wrapped in code tags but class is empty.</p>
<pre class="src">
echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers
</pre>
<h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example
</h1>
<h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example</h1>
<blockquote>
<p>I really love to write about
:symbols. They sure are the
best things in the world!
</p>
best things in the world!</p>
</blockquote>
<pre class="src src-ruby">
{
Expand Down

0 comments on commit 671f858

Please sign in to comment.