<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>trunk/as2api</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">html_output.rb</a></tt></td><td align="right" id="added">+61</td><td align="right" id="removed">-36</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=234&amp;content-type=text/vnd.viewcvs-markup">234</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb.diff?r1=234&amp;r2=235">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=235&amp;content-type=text/vnd.viewcvs-markup">235</a></td></tr>
</table>
<pre class="comment">
Transform the make_page_list() function into a PageListBuilder class
to allow parts of it to be dynamically overridden / replaced in the future
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk">trunk</a>/<a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api">as2api</a></span><br />
<div class="fileheader"><big><b>html_output.rb</b></big> <small id="info"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=234&amp;content-type=text/vnd.viewcvs-markup">234</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb.diff?r1=234&amp;r2=235">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=235&amp;content-type=text/vnd.viewcvs-markup">235</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/html_output.rb        2005-08-17 23:14:14 UTC (rev 234)
+++ trunk/as2api/html_output.rb        2005-08-30 22:36:04 UTC (rev 235)
@@ -1881,54 +1881,78 @@
</small></pre><pre class="diff" id="context">   end
 end
 
</pre><pre class="diff" id="removed">-def make_page_list(conf, type_agregator)
-  list = []
</pre><pre class="diff" id="added">+class PageListBuilder
+  def initialize(conf, type_agregator)
+    @conf = conf
+    @type_agregator = type_agregator
+  end
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-  list &lt;&lt; FramesetPage.new()
-  list &lt;&lt; OverviewPage.new(conf, type_agregator)
-  list &lt;&lt; OverviewFramePage.new(type_agregator)
-  list &lt;&lt; AllTypesFramePage.new(type_agregator)
</pre><pre class="diff" id="added">+  def build_page_list
+    list = []
+    list &lt;&lt; OverviewPage.new(@conf, @type_agregator)
+    build_toplevel_frameset_pages(list)
+    build_all_package_pages(list)
+    build_all_type_pages(list)
+    build_all_index_pages(list)
+    list
+  end
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-  # packages..
-  last_package = nil
-  last_pkg_index = nil
-  type_agregator.each_package do |package|
-    pkg_index = PackageIndexPage.new(conf, package)
-    list &lt;&lt; pkg_index
-    list &lt;&lt; PackageFramePage.new(package)
</pre><pre class="diff" id="added">+  protected
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-    if last_package
-      pkg_index.prev_package = last_package
-      last_pkg_index.next_package = package
</pre><pre class="diff" id="added">+  def build_toplevel_frameset_pages(list)
+    list &lt;&lt; FramesetPage.new()
+    list &lt;&lt; OverviewFramePage.new(@type_agregator)
+    list &lt;&lt; AllTypesFramePage.new(@type_agregator)
+  end
+
+  def build_all_package_pages(list)
+    last_package = nil
+    last_pkg_index = nil
+    @type_agregator.each_package do |package|
+      pkg_index = PackageIndexPage.new(@conf, package)
+      list &lt;&lt; pkg_index
+      build_package_frameset_pages(list)
+
+      if last_package
+        pkg_index.prev_package = last_package
+        last_pkg_index.next_package = package
+      end
+      last_package = package
+      last_pkg_index = pkg_index
</pre><pre class="diff" id="context">     end
</pre><pre class="diff" id="removed">-    last_package = package
-    last_pkg_index = pkg_index
</pre><pre class="diff" id="context">   end
 
</pre><pre class="diff" id="removed">-  # types..
-  last_type = nil
-  last_type_page = nil
-  type_agregator.each_type do |type|
-    if type.document?
-      type_page = TypePage.new(conf, type)
-      list &lt;&lt; type_page
-      list &lt;&lt; SourcePage.new(conf, type) if conf.sources
</pre><pre class="diff" id="added">+  def build_toplevel_frameset_pages(list)
+    list &lt;&lt; PackageFramePage.new(package)
+  end
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-      if last_type
-        type_page.prev_type = last_type
-        last_type_page.next_type = type
</pre><pre class="diff" id="added">+  def build_all_type_pages(list)
+    last_type = nil
+    last_type_page = nil
+    @type_agregator.each_type do |type|
+      if type.document?
+        type_page = TypePage.new(@conf, type)
+        list &lt;&lt; type_page
+        list &lt;&lt; SourcePage.new(@conf, type) if @conf.sources
+
+        if last_type
+          type_page.prev_type = last_type
+          last_type_page.next_type = type
+        end
+
+        last_type = type
+        last_type_page = type_page
</pre><pre class="diff" id="context">       end
</pre><pre class="diff" id="removed">-
-      last_type = type
-      last_type_page = type_page
</pre><pre class="diff" id="context">     end
   end
 
</pre><pre class="diff" id="removed">-  list &lt;&lt; IndexPage.new(conf, type_agregator)
-
-  list
</pre><pre class="diff" id="added">+  def build_all_index_pages(list)
+    list &lt;&lt; IndexPage.new(@conf, @type_agregator)
+  end
</pre><pre class="diff" id="context"> end
 
</pre><pre class="diff" id="added">+# creates the pages in the given list by calling each object's #generate_page()
+# method
</pre><pre class="diff" id="context"> def create_all_pages(conf, list)
   conf.progress_listener.generating_pages(list.length) do
     list.each_with_index do |page, index|
</pre><pre class="diff"><small id="info">@@ -1940,8 +1964,9 @@
</small></pre><pre class="diff" id="context">   end
 end
 
</pre><pre class="diff" id="added">+# main entry point into the documentation generation process
</pre><pre class="diff" id="context"> def document_types(conf, type_agregator)
</pre><pre class="diff" id="removed">-  list = make_page_list(conf, type_agregator)
</pre><pre class="diff" id="added">+  list = PageListBuilder.new(conf, type_agregator).build_page_list
</pre><pre class="diff" id="context">   create_all_pages(conf, list)
   package_list(conf.output_dir, type_agregator)
   stylesheet(conf.output_dir)
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; email">CVSspam</a> 0.2.11</small></center>
</body></html>