generate in-page TOCs on demand

This commit is contained in:
Mark Pilgrim
2009-03-19 01:42:12 -04:00
parent cfeee5d73d
commit 3b9c6c67e9
8 changed files with 29 additions and 189 deletions
+1 -7
View File
@@ -13,13 +13,7 @@ body{counter-reset:h1 7}
<blockquote class=q>
<p><span>&#x275D;</span> Certitude is not the test of certainty. We have been cocksure of many things that were not so. <span>&#x275E;</span><br>&mdash; <cite>Oliver Wendell Holmes, Jr.</cite>
</blockquote>
<ol>
<li><a href=#divingin>(Not) diving in</a>
<li><a href=#romantest1>A single question</a>
<li><a href=#romantest2>&#8220;Halt and catch fire&#8221;</a>
<li><a href=#romantest3>More halting, more fire</a>
<li>...
</ol>
<p id=toc>&nbsp;
<h2 id=divingin>(Not) diving in</h2>
<p class=f>How do you know that the code you wrote yesterday still works after the changes you made today? Every seasoned programmer has war stories of an &#8220;innocent&#8221; change that couldn't <em>possibly</em> have affected that other &#8220;unrelated&#8221; module&hellip; If this sounds familiar, this chapter is for you.
<p>In this chapter, you're going to write and debug a set of utility functions to convert to and from Roman numerals. You saw the mechanics of constructing and validating Roman numerals in <a href="regular-expressions.html#romannumerals">&#8220;Case study: roman numerals&#8221;</a>. Now step back and consider what it would take to expand that into a two-way utility.