Skip to content

Commit

Permalink
Merge branch 'hotfix/fixing-inline-numbering-problem' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtis Rainbolt-Greene committed Jun 25, 2011
2 parents b107b60 + 1a4dc54 commit 9c57855
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 66 deletions.
2 changes: 1 addition & 1 deletion Rules
Expand Up @@ -10,7 +10,7 @@ end


compile '*' do compile '*' do
filter :redcarpet filter :redcarpet
filter :colorize_syntax, :coderay => { :line_numbers => :inline } filter :colorize_syntax, :coderay => { :line_numbers => :table }
layout 'default' layout 'default'
end end


Expand Down
17 changes: 15 additions & 2 deletions content/style/main.sass
Expand Up @@ -41,22 +41,35 @@ body
+outline(25px) +outline(25px)
+padding(0px) +padding(0px)
+round +round
+border(1px, solid, $dark_color)
background: $dark_color url(image/black_denim.png) repeat background: $dark_color url(image/black_denim.png) repeat
& code & code
color: $base_color color: $base_color
font-size: 14px font-size: 14px
& .no & tr td
+outline(0px)
& pre
+outline(0px)
+round(0px)
+border(0px)
padding-left: 5px
& .line_numbers pre
+margin(0px)
+padding +padding
color: $dark_color color: $dark_color
background: $base_color background: $base_color
white-space: pre-line text-align: right
& .i & .i
color: $bright_color color: $bright_color
font-weight: bold font-weight: bold
& .r & .r
color: $major_color color: $major_color
font-weight: bold font-weight: bold
& .dl & .dl
& .c
color: $dark_color + 15
& .ch
color: yellow
& .s & .s
color: $green color: $green
& footer & footer
Expand Down
195 changes: 133 additions & 62 deletions output/book/chapter/2/index.html
Expand Up @@ -4,7 +4,7 @@
<title>Values</title> <title>Values</title>
<meta charset='utf-8' /> <meta charset='utf-8' />
<meta content='en' name='language' /> <meta content='en' name='language' />
<meta content='2011-06-24 23:38:17 -0700' name='created' /> <meta content='2011-06-24 23:58:09 -0700' name='created' />
<meta content='Kurtis Rainbolt-Greene' name='author' /> <meta content='Kurtis Rainbolt-Greene' name='author' />
<meta content='A Book On How To Program With The Ruby Language' name='description' /> <meta content='A Book On How To Program With The Ruby Language' name='description' />
<meta content='ruby, programming, hacking, learning, tutorial, book, free' name='keywords' /> <meta content='ruby, programming, hacking, learning, tutorial, book, free' name='keywords' />
Expand Down Expand Up @@ -242,27 +242,49 @@ <h4>Ubuntu</h4>


<p><strong>Source Code</strong>: File <code>~/Repository/lytr/task-1.rb</code></p> <p><strong>Source Code</strong>: File <code>~/Repository/lytr/task-1.rb</code></p>


<pre><code class="language-ruby"><span class="no">1</span> puts <span class="s"><span class="dl">"</span><span class="k">A Boy And His Lucky Dog</span><span class="dl">"</span></span> <pre><code class="language-ruby"><table class="CodeRay"><tr>
<span class="no">2</span> puts <span class="s"><span class="dl">"</span><span class="k">=================</span><span class="dl">"</span></span> <td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1<tt>
<span class="no">3</span> puts <span class="s"><span class="dl">"</span><span class="k">It was a cold winter morning in the Forgotten Valley.</span><span class="dl">"</span></span> </tt>2<tt>
<span class="no">4</span> puts <span class="s"><span class="dl">'</span><span class="k">The boy looked to his dog and said, "Look there, Lucky!"</span><span class="dl">'</span></span> </tt>3<tt>
<span class="no">5</span> puts <span class="s"><span class="dl">'</span><span class="k">"The Temple of Golden Arches!" The dog glumly barked.</span><span class="dl">'</span></span> </tt>4<tt>
<span class="no">6</span> puts <span class="s"><span class="dl">"</span><span class="k">Venturing forth they climb down from the mountainside.</span><span class="dl">"</span></span> </tt>5<tt>
<span class="no">7</span> puts <span class="s"><span class="dl">'</span><span class="k">"We are sure to find lost treasure!"</span><span class="dl">'</span></span> </tt>6<tt>
<span class="no">8</span> puts <span class="s"><span class="dl">'</span><span class="k">The abandoned temple to the Golden Arches awaited.</span><span class="dl">'</span></span> </tt>7<tt>
</code></pre> </tt>8<tt>
</tt></pre></td>
<td class="code"><pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">puts <span class="s"><span class="dl">"</span><span class="k">A Boy And His Lucky Dog</span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">=================</span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">It was a cold winter morning in the Forgotten Valley.</span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">'</span><span class="k">The boy looked to his dog and said, "Look there, Lucky!"</span><span class="dl">'</span></span><tt>
</tt>puts <span class="s"><span class="dl">'</span><span class="k">"The Temple of Golden Arches!" The dog glumly barked.</span><span class="dl">'</span></span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">Venturing forth they climb down from the mountainside.</span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">'</span><span class="k">"We are sure to find lost treasure!"</span><span class="dl">'</span></span><tt>
</tt>puts <span class="s"><span class="dl">'</span><span class="k">The abandoned temple to the Golden Arches awaited.</span><span class="dl">'</span></span><tt>
</tt></pre></td>
</tr></table></code></pre>


<p><strong>Results</strong>: Run <code>ruby task-1.rb</code></p> <p><strong>Results</strong>: Run <code>ruby task-1.rb</code></p>


<pre><code class="language-terminal"><span class="no">1</span> A Boy And His Lucky Dog <pre><code class="language-terminal"><table class="CodeRay"><tr>
<span class="no">2</span> ================= <td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1<tt>
<span class="no">3</span> It was a cold winter morning in the Forgotten Valley. </tt>2<tt>
<span class="no">4</span> The boy looked to his dog and said, "Look there, Lucky!" </tt>3<tt>
<span class="no">5</span> "The Temple of Golden Arches!" The dog glumly barked. </tt>4<tt>
<span class="no">6</span> Venturing forth they climb down from the mountainside. </tt>5<tt>
<span class="no">7</span> "We are sure to find lost treasure!" </tt>6<tt>
<span class="no">8</span> The abandoned temple to the Golden Arches awaited. </tt>7<tt>
</code></pre> </tt>8<tt>
</tt></pre></td>
<td class="code"><pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">A Boy And His Lucky Dog<tt>
</tt>=================<tt>
</tt>It was a cold winter morning in the Forgotten Valley.<tt>
</tt>The boy looked to his dog and said, "Look there, Lucky!"<tt>
</tt>"The Temple of Golden Arches!" The dog glumly barked.<tt>
</tt>Venturing forth they climb down from the mountainside.<tt>
</tt>"We are sure to find lost treasure!"<tt>
</tt>The abandoned temple to the Golden Arches awaited.<tt>
</tt></pre></td>
</tr></table></code></pre>


<p><strong>Details</strong></p> <p><strong>Details</strong></p>


Expand Down Expand Up @@ -318,45 +340,85 @@ <h4>Ubuntu</h4>


<p><strong>Source Code</strong>: File <code>~/Repository/lytr/task-2.rb</code></p> <p><strong>Source Code</strong>: File <code>~/Repository/lytr/task-2.rb</code></p>


<pre><code class="language-ruby"><span class="no"> 1</span> <span class="c"># This line is a comment. A comment is used to</span> <pre><code class="language-ruby"><table class="CodeRay"><tr>
<span class="no"> 2</span> <span class="c"># document source code. This makes it easier to</span> <td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1<tt>
<span class="no"> 3</span> <span class="c"># read for others, and yourself.</span> </tt>2<tt>
<span class="no"> 4</span> </tt>3<tt>
<span class="no"> 5</span> puts <span class="s"><span class="dl">"</span><span class="k">The Wealthiest Merchant And His Daughter</span><span class="dl">"</span></span> </tt>4<tt>
<span class="no"> 6</span> puts <span class="s"><span class="dl">"</span><span class="k">========================================</span><span class="dl">"</span></span> </tt>5<tt>
<span class="no"> 7</span> </tt>6<tt>
<span class="no"> 8</span> <span class="c"># Any part of a line after the pound sign is a comment, and not interpreted.</span> </tt>7<tt>
<span class="no"> 9</span> </tt>8<tt>
<span class="no"><strong>10</strong></span> puts <span class="s"><span class="dl">"</span><span class="k">The boy and his lucky dog travelled along the wasteland together.</span><span class="dl">"</span></span> <span class="c"># Like this.</span> </tt>9<tt>
<span class="no">11</span> puts <span class="s"><span class="dl">"</span><span class="k">They saw many things, but mostly trash and death.</span><span class="dl">"</span></span> <span class="c"># These are comments</span> </tt><strong>10</strong><tt>
<span class="no">12</span> puts <span class="s"><span class="dl">"</span><span class="k">The adventurous two wandered through abandoned cities and towns.</span><span class="dl">"</span></span> </tt>11<tt>
<span class="no">13</span> </tt>12<tt>
<span class="no">14</span> <span class="c"># puts "Avoiding raiders and wastelanders." # This is line is a comment.</span> </tt>13<tt>
<span class="no">15</span> </tt>14<tt>
<span class="no">16</span> print <span class="s"><span class="dl">"</span><span class="k">One time the two happened on a small village named </span><span class="dl">"</span></span> </tt>15<tt>
<span class="no">17</span> puts <span class="s"><span class="dl">'</span><span class="k">"Wall Mart Town"</span><span class="dl">'</span></span> </tt>16<tt>
<span class="no">18</span> </tt>17<tt>
<span class="no">19</span> <span class="c">### You can put multiple pound signs, but it doesn't read anything after the</span> </tt>18<tt>
<span class="no"><strong>20</strong></span> <span class="c">## first pound sign. ##</span> </tt>19<tt>
<span class="no">21</span> <span class="c"># You can even indent the comments!</span> </tt><strong>20</strong><tt>
<span class="no">22</span> </tt>21<tt>
<span class="no">23</span> print <span class="s"><span class="dl">"</span><span class="ch">\"</span><span class="k">Hey Lucky,</span><span class="ch">\"</span><span class="k"> the boy says</span><span class="dl">"</span></span> </tt>22<tt>
<span class="no">24</span> print <span class="s"><span class="dl">"</span><span class="k"> </span><span class="dl">"</span></span> </tt>23<tt>
<span class="no">25</span> puts <span class="s"><span class="dl">"</span><span class="ch">\"</span><span class="k">Lets check this place out!</span><span class="ch">\"</span><span class="dl">"</span></span> </tt>24<tt>
<span class="no">26</span> puts <span class="s"><span class="dl">"</span><span class="k">The dog didn't think this was a good idea.</span><span class="dl">"</span></span> </tt>25<tt>
</code></pre> </tt>26<tt>
</tt></pre></td>
<td class="code"><pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span class="c"># This line is a comment. A comment is used to</span><tt>
</tt><span class="c"># document source code. This makes it easier to</span><tt>
</tt><span class="c"># read for others, and yourself.</span><tt>
</tt><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">The Wealthiest Merchant And His Daughter</span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">========================================</span><span class="dl">"</span></span><tt>
</tt><tt>
</tt><span class="c"># Any part of a line after the pound sign is a comment, and not interpreted.</span><tt>
</tt><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">The boy and his lucky dog travelled along the wasteland together.</span><span class="dl">"</span></span> <span class="c"># Like this.</span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">They saw many things, but mostly trash and death.</span><span class="dl">"</span></span> <span class="c"># These are comments</span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">The adventurous two wandered through abandoned cities and towns.</span><span class="dl">"</span></span><tt>
</tt><tt>
</tt><span class="c"># puts "Avoiding raiders and wastelanders." # This is line is a comment.</span><tt>
</tt><tt>
</tt>print <span class="s"><span class="dl">"</span><span class="k">One time the two happened on a small village named </span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">'</span><span class="k">"Wall Mart Town"</span><span class="dl">'</span></span><tt>
</tt><tt>
</tt><span class="c">### You can put multiple pound signs, but it doesn't read anything after the</span><tt>
</tt><span class="c">## first pound sign. ##</span><tt>
</tt> <span class="c"># You can even indent the comments!</span><tt>
</tt><tt>
</tt>print <span class="s"><span class="dl">"</span><span class="ch">\"</span><span class="k">Hey Lucky,</span><span class="ch">\"</span><span class="k"> the boy says</span><span class="dl">"</span></span><tt>
</tt>print <span class="s"><span class="dl">"</span><span class="k"> </span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="ch">\"</span><span class="k">Lets check this place out!</span><span class="ch">\"</span><span class="dl">"</span></span><tt>
</tt>puts <span class="s"><span class="dl">"</span><span class="k">The dog didn't think this was a good idea.</span><span class="dl">"</span></span><tt>
</tt></pre></td>
</tr></table></code></pre>


<p><strong>Results</strong>: Run <code>ruby task-2.rb</code></p> <p><strong>Results</strong>: Run <code>ruby task-2.rb</code></p>


<pre><code class="language-terminal"><span class="no">1</span> The Wealthiest Merchant And His Daughter <pre><code class="language-terminal"><table class="CodeRay"><tr>
<span class="no">2</span> ======================================== <td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1<tt>
<span class="no">3</span> The boy and his lucky dog travelled along the wasteland together. </tt>2<tt>
<span class="no">4</span> They saw many things, but mostly trash and death. </tt>3<tt>
<span class="no">5</span> The adventurous two wandered through abandoned cities and towns. </tt>4<tt>
<span class="no">6</span> One time the two happened on a small village named "Wall Mart Town" </tt>5<tt>
<span class="no">7</span> "Hey Lucky," the boy says "Lets check this place out!" </tt>6<tt>
<span class="no">8</span> The dog didn't think this was a good idea. </tt>7<tt>
</code></pre> </tt>8<tt>
</tt></pre></td>
<td class="code"><pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">The Wealthiest Merchant And His Daughter<tt>
</tt>========================================<tt>
</tt>The boy and his lucky dog travelled along the wasteland together.<tt>
</tt>They saw many things, but mostly trash and death.<tt>
</tt>The adventurous two wandered through abandoned cities and towns.<tt>
</tt>One time the two happened on a small village named "Wall Mart Town"<tt>
</tt>"Hey Lucky," the boy says "Lets check this place out!"<tt>
</tt>The dog didn't think this was a good idea.<tt>
</tt></pre></td>
</tr></table></code></pre>


<p><strong>Details</strong></p> <p><strong>Details</strong></p>


Expand Down Expand Up @@ -406,13 +468,22 @@ <h4>Ubuntu</h4>


<p><strong>Source Code</strong>: File <code>~/Repository/lytr/task-.rb</code></p> <p><strong>Source Code</strong>: File <code>~/Repository/lytr/task-.rb</code></p>


<pre><code class="language-ruby"><span class="no">1</span> <span class="s"><span class="dl">"</span><span class="k">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod <pre><code class="language-ruby"><table class="CodeRay"><tr>
<span class="no">2</span> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, <td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre>1<tt>
<span class="no">3</span> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo </tt>2<tt>
<span class="no">4</span> consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse </tt>3<tt>
<span class="no">5</span> cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non </tt>4<tt>
<span class="no">6</span> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span><span class="dl">"</span></span> </tt>5<tt>
</code></pre> </tt>6<tt>
</tt></pre></td>
<td class="code"><pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span class="s"><span class="dl">"</span><span class="k">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod<tt>
</tt>tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,<tt>
</tt>quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo<tt>
</tt>consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse<tt>
</tt>cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non<tt>
</tt>proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span><span class="dl">"</span></span><tt>
</tt></pre></td>
</tr></table></code></pre>


<p><strong>Results</strong>: Run <code>ruby task-.rb</code></p> <p><strong>Results</strong>: Run <code>ruby task-.rb</code></p>


Expand Down

0 comments on commit 9c57855

Please sign in to comment.