This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #19 from randomecho/markup

Show title of next/previous page for a better heads up
  • Loading branch information...
matthewmccullough committed Dec 3, 2012
2 parents 19d698d + 59a244d commit fe529c3c4c0bd6262fdc88342749c9beeff2ddd7
Showing with 16 additions and 13 deletions.
  1. +10 −7 Rakefile
  2. +1 −1 p/branching.html
  3. +1 −1 p/intro.html
  4. +1 −1 p/log.html
  5. +1 −1 p/normal.html
  6. +1 −1 p/remotes.html
  7. +1 −1 p/setup.html
View
@@ -39,15 +39,15 @@ def generate_page(page_data)
@pcontent += '</div>'
@pcontent += "<div class=\"span-10\">"
- if n = @nextlast[:last][page]
- @pcontent += "<a href=\"#{n}.html\">&laquo; previous</a>"
+ if (n = @nextlast[:last][page]) && (nname = @nextlast[:lastname][page])
+ @pcontent += "<a href=\"#{n}.html\">&laquo; #{nname}</a>"
else
@pcontent += "&nbsp;"
end
@pcontent += "</div>"
- if n = @nextlast[:next][page]
- @pcontent += "<div style=\"text-align:right\" class=\"span-11 last\"><a href=\"#{n}.html\">next &raquo;</a></div>"
+ if (n = @nextlast[:next][page]) && (nname = @nextlast[:nextname][page])
+ @pcontent += "<div style=\"text-align:right\" class=\"span-11 last\"><a href=\"#{n}.html\">#{nname} &raquo;</a></div>"
end
@pcontent += '<div class="span-24 last">&nbsp;</div><hr/>'
@@ -65,14 +65,17 @@ task :gensite do
@content = ''
# finding the next and last pages
- last = nil
- @nextlast = {:last => {}, :next => {}}
+ last = lastname = nil
+ @nextlast = {:last => {}, :lastname => {}, :next => {}, :nextname => {}}
ep['episodes'].each do |section|
section['values'].each do |episode|
- if p = episode['page']
+ if (p = episode['page']) && (pname = episode['name'])
@nextlast[:last][p] = last
+ @nextlast[:lastname][p] = lastname
@nextlast[:next][last] = p
+ @nextlast[:nextname][last] = pname
last = p
+ lastname = pname
end
end
end
View
@@ -182,7 +182,7 @@ <h3 id='merging_multiple_times'>merging multiple times</h3>
<p>So, that is basic branching and merging in Git and should give you a good baseline for being able to effectively use this powerful and ultimately pretty simple tool.</p>
-<p>For more information on branching and merging in Git, you can read <a href='http://progit.org/book/ch3-0.html'>Chapter 3</a> of the Pro Git book.</p><br/><br/><hr/></div><div class="span-10"><a href="normal.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="remotes.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>For more information on branching and merging in Git, you can read <a href='http://progit.org/book/ch3-0.html'>Chapter 3</a> of the Pro Git book.</p><br/><br/><hr/></div><div class="span-10"><a href="normal.html">&laquo; Normal Workflow</a></div><div style="text-align:right" class="span-11 last"><a href="remotes.html">Distributed Git &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -150,7 +150,7 @@ <h3 id='installing_git'>installing git</h3>
<h3 id='resources'>resources</h3>
-<p>For more information on Git, the homepage is at <a href='http://git-scm.com'>git-scm.com</a>. We will also be referring heavily to the CC-licenced <a href='http://progit.org'>Pro Git Book</a> for more information on each of these sections.</p><br/><br/><hr/></div><div class="span-10">&nbsp;</div><div style="text-align:right" class="span-11 last"><a href="setup.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>For more information on Git, the homepage is at <a href='http://git-scm.com'>git-scm.com</a>. We will also be referring heavily to the CC-licenced <a href='http://progit.org'>Pro Git Book</a> for more information on each of these sections.</p><br/><br/><hr/></div><div class="span-10">&nbsp;</div><div style="text-align:right" class="span-11 last"><a href="setup.html">Setup and Initialization &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -380,7 +380,7 @@ <h4 id='other_useful_options'>Other Useful Options</h4>
<pre><code>$ git log master.. --pretty=oneline</code></pre>
-<p>Very useful commands. We&#8217;ll explain why this works fully in a later section, but for now it&#8217;s useful to just remember that it does that.</p><br/><br/><hr/></div><div class="span-10"><a href="remotes.html">&laquo; previous</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>Very useful commands. We&#8217;ll explain why this works fully in a later section, but for now it&#8217;s useful to just remember that it does that.</p><br/><br/><hr/></div><div class="span-10"><a href="remotes.html">&laquo; Distributed Git</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -238,7 +238,7 @@ <h3 id='changes_that_are_staged_but_not_committed'>changes that are staged but n
<p>OK, now we&#8217;ve seen how to modify, stage and commit changes to files. Next we&#8217;ll look at one of the killer features of Git, its branching model.</p>
-<p>For more information on basic Git usage, you can read <a href='http://git-scm.com/book/en/Git-Basics'>Chapter 2</a> of the Pro Git book.</p><br/><br/><hr/></div><div class="span-10"><a href="setup.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="branching.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>For more information on basic Git usage, you can read <a href='http://git-scm.com/book/en/Git-Basics'>Chapter 2</a> of the Pro Git book.</p><br/><br/><hr/></div><div class="span-10"><a href="setup.html">&laquo; Setup and Initialization</a></div><div style="text-align:right" class="span-11 last"><a href="branching.html">Branching and Merging &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -102,7 +102,7 @@ <h3 id='pushing_to_remotes'>pushing to remotes</h3>
<pre><code>$ git push writey master</code></pre>
-<p>That pushes my <code>master</code> branch to the <code>writey</code> aliased server.</p><br/><br/><hr/></div><div class="span-10"><a href="branching.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="log.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>That pushes my <code>master</code> branch to the <code>writey</code> aliased server.</p><br/><br/><hr/></div><div class="span-10"><a href="branching.html">&laquo; Branching and Merging</a></div><div style="text-align:right" class="span-11 last"><a href="log.html">Git History &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -102,7 +102,7 @@ <h3 id='cloning_a_git_repo'>cloning a git repo</h3>
<pre><code>$ git clone http://github.com/schacon/munger.git</code></pre>
-<p>This is only available if the server has enabled it - if you are hosting your repository on GitHub, both git:// and http:// access are enabled.</p><br/><br/><hr/></div><div class="span-10"><a href="intro.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="normal.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>This is only available if the server has enabled it - if you are hosting your repository on GitHub, both git:// and http:// access are enabled.</p><br/><br/><hr/></div><div class="span-10"><a href="intro.html">&laquo; Introduction To Git</a></div><div style="text-align:right" class="span-11 last"><a href="normal.html">Normal Workflow &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">

0 comments on commit fe529c3

Please sign in to comment.