[as2api-dev] [CVS trunk] New --sources option adds syntax-highlighted source code to the documentation

David Holroyd dave at badgers-in-foil.co.uk
Mon, 04 Jul 2005 00:20:57 +0000


<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">api_loader.rb</a></tt></td><td align="right" id="added">+1</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_loader.rb?rev=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_loader.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_loader.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">api_model.rb</a></tt></td><td align="right" id="added">+13</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_model.rb?rev=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_model.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_model.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></td></tr>
<tr><td><tt><a href="#file3">html_output.rb</a></tt></td><td align="right" id="added">+221</td><td align="right" id="removed">-12</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></td></tr>
<tr class="alt"><td><tt>ui/<a href="#file4">cli.rb</a></tt></td><td align="right" id="added">+9</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/ui/cli.rb?rev=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/ui/cli.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/ui/cli.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></td></tr>
<tr><td></td><td align="right" id="added">+244</td><td align="right" id="removed">-20</td><td></td></tr>
</table>
<small id="info">4 modified files</small><br />
<pre class="comment">
New --sources option adds syntax-highlighted source code to the documentation
</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>api_loader.rb</b></big> <small id="info"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_loader.rb?rev=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_loader.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_loader.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/api_loader.rb	2005-07-03 20:17:44 UTC (rev 183)
+++ trunk/as2api/api_loader.rb	2005-07-04 00:20:55 UTC (rev 184)
@@ -25,8 +25,7 @@
</small></pre><pre class="diff" id="context">     begin
       is_utf8 = detect_bom?(io)
       type = simple_parse(io)
</pre><pre class="diff" id="removed">-      type.input_filename = file.suffix
-      type.sourcepath_location(File.dirname(file.suffix))
</pre><pre class="diff" id="added">+      type.input_file = file
</pre><pre class="diff" id="context">       type.source_utf8 = is_utf8
       return type
     rescue =&gt;e
</pre></div>
<hr /><a name="file2" /><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>api_model.rb</b></big> <small id="info"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_model.rb?rev=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_model.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/api_model.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/api_model.rb	2005-07-03 20:17:44 UTC (rev 183)
+++ trunk/as2api/api_model.rb	2005-07-04 00:20:55 UTC (rev 184)
@@ -25,12 +25,23 @@
</small></pre><pre class="diff" id="context">     @comment = nil
     @type_resolver = nil
     @import_manager = nil
</pre><pre class="diff" id="removed">-    @input_file<span id="removedchars">name</span> = nil
</pre><pre class="diff" id="added">+    @input_file = nil
</pre><pre class="diff" id="context">     @document = true
   end
 
</pre><pre class="diff" id="removed">-  attr_accessor :package, :extends, :comment, :source_utf8, :type_resolver, :import_manager, :in<span id="removedchars">put_filename,&nbsp;:in</span>trinsic, :constructor
</pre><pre class="diff" id="added">+  attr_accessor :package, :extends, :comment, :source_utf8, :type_resolver, :import_manager, :intrinsic, :constructor
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="added">+  def input_filename
+    @input_file.suffix
+  end
+
+  def input_file=(file)
+    @input_file = file
+    sourcepath_location = file
+  end
+
+  attr_reader :input_file
+
</pre><pre class="diff" id="context">   def add_method(method)
     @methods &lt;&lt; method
   end
</pre></div>
<hr /><a name="file3" /><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=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/html_output.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/html_output.rb	2005-07-03 20:17:44 UTC (rev 183)
+++ trunk/as2api/html_output.rb	2005-07-04 00:20:55 UTC (rev 184)
@@ -121,6 +121,20 @@
</small></pre><pre class="diff" id="context"> .diagram {
 	text-align: center;
 }
</pre><pre class="diff" id="added">+
+
+/* Source highlighting rules */
+
+.lineno {
+  color: gray;
+  background-color:lightgray;
+  border-right: 1px solid gray;
+  margin-right: .5em;
+}
+.comment { color: green; }
+.comment.doc { color: 4466ff; }
+.str_const, .num_const { color: blue; }
+.key { font-weight: bolder; color: purple; }
</pre><pre class="diff" id="context">     HERE
   end
 end
</pre><pre class="diff"><small id="info">@@ -391,8 +405,9 @@
</small></pre><pre class="diff" id="context"> end
 
 class BasicPage &lt; Page
</pre><pre class="diff" id="removed">-  def initialize(base_name, path_name=nil)
</pre><pre class="diff" id="added">+  def initialize(<span id="addedchars">conf,&nbsp;</span>base_name, path_name=nil)
</pre><pre class="diff" id="context">     super(base_name, path_name)
</pre><pre class="diff" id="added">+    @conf = conf
</pre><pre class="diff" id="context">     @type = nil
   end
 
</pre><pre class="diff"><small id="info">@@ -485,9 +500,9 @@
</small></pre><pre class="diff" id="context"> 
 class TypePage &lt; BasicPage
 
</pre><pre class="diff" id="removed">-  def initialize(type)
</pre><pre class="diff" id="added">+  def initialize(<span id="addedchars">conf,&nbsp;</span>type)
</pre><pre class="diff" id="context">     dir = type.package_name.gsub(/\./, "/")
</pre><pre class="diff" id="removed">-    super(type.unqualified_name, dir)
</pre><pre class="diff" id="added">+    super(<span id="addedchars">conf,&nbsp;</span>type.unqualified_name, dir)
</pre><pre class="diff" id="context">     @type = type
     if @type.source_utf8
       @encoding = "utf-8"
</pre><pre class="diff"><small id="info">@@ -555,6 +570,11 @@
</small></pre><pre class="diff" id="context">       html_li do
 	html_span("Class", {"class"=&gt;"nav_current"})
       end
</pre><pre class="diff" id="added">+      if @conf.sources
+	html_li do
+	  html_a("Source", {"href"=&gt;@type.unqualified_name+".as.html"})
+	end
+      end
</pre><pre class="diff" id="context">       html_li do
 	html_a("Index", {"href"=&gt;base_path("index-files/index.html")})
       end
</pre><pre class="diff"><small id="info">@@ -1072,10 +1092,9 @@
</small></pre><pre class="diff" id="context"> 
   def initialize(conf, package)
     dir = package_dir_for(package)
</pre><pre class="diff" id="removed">-    super("package-summary", dir)
</pre><pre class="diff" id="added">+    super(<span id="addedchars">conf,&nbsp;</span>"package-summary", dir)
</pre><pre class="diff" id="context">     @package = package
     @title = "#{package_description_for(@package)} API Documentation"
</pre><pre class="diff" id="removed">-    @conf = conf
</pre><pre class="diff" id="context">     @prev_package = nil
     @next_package = nil
   end
</pre><pre class="diff"><small id="info">@@ -1143,6 +1162,11 @@
</small></pre><pre class="diff" id="context">       html_li do
 	html_span("Class")
       end
</pre><pre class="diff" id="added">+      if @conf.sources
+	html_li do
+	  html_span("Source")
+	end
+      end
</pre><pre class="diff" id="context">       html_li do
 	html_a("Index", {"href"=&gt;base_path("index-files/index.html")})
       end
</pre><pre class="diff"><small id="info">@@ -1341,8 +1365,8 @@
</small></pre><pre class="diff" id="context"> end
 
 class OverviewPage &lt; BasicPage
</pre><pre class="diff" id="removed">-  def initialize(type_agregator)
-    super("overview-summary")
</pre><pre class="diff" id="added">+  def initialize(conf, type_agregator)
+    super(conf, "overview-summary")
</pre><pre class="diff" id="context">     @type_agregator = type_agregator
     @title = "API Overview"
   end
</pre><pre class="diff"><small id="info">@@ -1378,6 +1402,11 @@
</small></pre><pre class="diff" id="context">       html_li do
 	html_span("Class")
       end
</pre><pre class="diff" id="added">+      if @conf.sources
+	html_li do
+	  html_span("Source")
+	end
+      end
</pre><pre class="diff" id="context">       html_li do
 	html_a("Index", {"href"=&gt;"index-files/index.html"})
       end
</pre><pre class="diff"><small id="info">@@ -1550,8 +1579,8 @@
</small></pre><pre class="diff" id="context"> end
 
 class IndexPage &lt; BasicPage
</pre><pre class="diff" id="removed">-  def initialize(type_agregator)
-    super("index", "index-files")
</pre><pre class="diff" id="added">+  def initialize(conf, type_agregator)
+    super(conf, "index", "index-files")
</pre><pre class="diff" id="context">     @type_agregator = type_agregator
     @title = "Alphabetical Index"
   end
</pre><pre class="diff"><small id="info">@@ -1601,6 +1630,11 @@
</small></pre><pre class="diff" id="context">       html_li do
 	html_span("Class")
       end
</pre><pre class="diff" id="added">+      if @conf.sources
+	html_li do
+	  html_span("Source")
+	end
+      end
</pre><pre class="diff" id="context">       html_li do
 	html_span("Index", {"class"=&gt;"nav_current"})
       end
</pre><pre class="diff"><small id="info">@@ -1612,11 +1646,185 @@
</small></pre><pre class="diff" id="context">   end
 end
 
</pre><pre class="diff" id="added">+
+class SourcePage &lt; BasicPage
+
+  def initialize(conf, type)
+    dir = type.package_name.gsub(/\./, "/")
+    super(conf, type.unqualified_name+".as", dir)
+    @type = type
+  end
+
+  def generate_body_content
+    html_pre do
+      file = @type.input_file
+      parse(File.join(file.prefix, file.suffix))
+    end
+  end
+
+  def parse(file)
+    File.open(File.join(file)) do |io|
+      begin
+	is_utf8 = detect_bom?(io)
+	as_io = ASIO.new(io)
+	lex = ActionScript::Parse::SkipASLexer.new(HighlightASLexer.new(self, as_io))
+	parse = HighlightASParser.new(lex)
+	parse.handler = ActionScript::Parse::ASHandler.new
+	parse.parse_compilation_unit
+      rescue =&gt;e
+	$stderr.puts "#{file}: #{e.message}\n#{e.backtrace.join("\n")}"
+      end
+    end
+  end
+
+  class HighlightASParser &lt; ActionScript::Parse::ASParser
+
+  end
+
+  Keywords = [
+    ActionScript::Parse::AsToken,
+    ActionScript::Parse::BreakToken,
+    ActionScript::Parse::CaseToken,
+    ActionScript::Parse::CatchToken,
+    ActionScript::Parse::ClassToken,
+    ActionScript::Parse::ConstToken,
+    ActionScript::Parse::ContinueToken,
+    ActionScript::Parse::DefaultToken,
+    ActionScript::Parse::DynamicToken,
+    ActionScript::Parse::DeleteToken,
+    ActionScript::Parse::DoToken,
+    ActionScript::Parse::ElseToken,
+    ActionScript::Parse::ExtendsToken,
+    ActionScript::Parse::FalseToken,
+    ActionScript::Parse::FinallyToken,
+    ActionScript::Parse::ForToken,
+    ActionScript::Parse::FunctionToken,
+    ActionScript::Parse::IfToken,
+    ActionScript::Parse::ImplementsToken,
+    ActionScript::Parse::ImportToken,
+    ActionScript::Parse::InToken,
+    ActionScript::Parse::InstanceofToken,
+    ActionScript::Parse::InterfaceToken,
+    ActionScript::Parse::IntrinsicToken,
+    ActionScript::Parse::NewToken,
+    ActionScript::Parse::NullToken,
+    ActionScript::Parse::PackageToken,
+    ActionScript::Parse::PrivateToken,
+    ActionScript::Parse::PublicToken,
+    ActionScript::Parse::ReturnToken,
+    ActionScript::Parse::StaticToken,
+    ActionScript::Parse::SuperToken,
+    ActionScript::Parse::SwitchToken,
+    ActionScript::Parse::ThisToken,
+    ActionScript::Parse::ThrowToken,
+    ActionScript::Parse::TrueToken,
+    ActionScript::Parse::TryToken,
+    ActionScript::Parse::TypeofToken,
+    ActionScript::Parse::UseToken,
+    ActionScript::Parse::VarToken,
+    ActionScript::Parse::VoidToken,
+    ActionScript::Parse::WhileToken,
+    ActionScript::Parse::WithToken
+  ]
+
+  class HighlightASLexer &lt; ActionScript::Parse::ASLexer
+    def initialize(out, io)
+      super(io)
+      @lineno = 0
+      @out = out
+    end
+
+    def get_next
+      tok = super
+      out(tok)
+      tok
+    end
+
+    def out(tok)
+      mark_lineno if @lineno == 0
+      if Keywords.include?(tok.class)
+	pp_tok(tok, "key")
+	return
+      end
+      
+      case tok
+	when ActionScript::Parse::MultiLineCommentToken
+	  if tok.body[0] == "*"[0]
+	    pp_tok(tok, "comment doc")
+	  else
+	    pp_tok(tok, "comment")
+	  end
+	when ActionScript::Parse::SingleLineCommentToken
+	  pp_tok(tok, "comment")
+	when ActionScript::Parse::StringToken
+	  pp_tok(tok, "str_const")
+	when ActionScript::Parse::NumberToken
+	  pp_tok(tok, "num_const")
+	else
+	  p_tok(tok)
+      end
+    end
+
+    def pp_tok(tok, clazz)
+      @out.html_span("class"=&gt;clazz) do
+	p_tok(tok)
+      end
+    end
+    def p_tok(tok)
+      txt = StringScanner.new(tok.to_s)
+      until txt.eos?
+	if match = txt.scan_until(/\r\n|\n|\r/)
+	  p_str(match)
+	  mark_lineno
+	else
+	  p_str(txt.rest)
+	  txt.terminate
+	end
+      end
+    end
+
+    def mark_lineno
+      @lineno += 1
+      @out.html_span("id"=&gt;@lineno.to_s, "class"=&gt;"lineno") do
+	@out.pcdata("%6d  " % [@lineno])
+      end
+    end
+
+    def p_str(str)
+      @out.pcdata(str)
+    end
+  end
+
+  def navigation
+    html_ul("class"=&gt;"main_nav") do
+      html_li do
+	html_a("Overview", {"href"=&gt;base_path("overview-summary.html")})
+      end
+      html_li do
+	html_a("Package", {"href"=&gt;"package-summary.html"})
+      end
+      html_li do
+	html_a("Class", {"href"=&gt;@type.unqualified_name+".html"})
+      end
+      html_li do
+	html_span("Source", {"class"=&gt;"nav_current"})
+      end
+      html_li do
+	html_a("Index", {"href"=&gt;base_path("index-files/index.html")})
+      end
+    end
+  end
+
+  def link_top
+    yield "Overview", base_path("overview-summary.html")
+  end
+end
+
</pre><pre class="diff" id="context"> def make_page_list(conf, type_agregator)
   list = []
 
   list &lt;&lt; FramesetPage.new()
</pre><pre class="diff" id="removed">-  list &lt;&lt; OverviewPage.new(type_agregator)
</pre><pre class="diff" id="added">+  list &lt;&lt; OverviewPage.new(<span id="addedchars">conf,&nbsp;</span>type_agregator)
</pre><pre class="diff" id="context">   list &lt;&lt; OverviewFramePage.new(type_agregator)
   list &lt;&lt; AllTypesFramePage.new(type_agregator)
 
</pre><pre class="diff"><small id="info">@@ -1641,8 +1849,9 @@
</small></pre><pre class="diff" id="context">   last_type_page = nil
   type_agregator.each_type do |type|
     if type.document?
</pre><pre class="diff" id="removed">-      type_page = TypePage.new(type)
</pre><pre class="diff" id="added">+      type_page = TypePage.new(<span id="addedchars">conf,&nbsp;</span>type)
</pre><pre class="diff" id="context">       list &lt;&lt; type_page
</pre><pre class="diff" id="added">+      list &lt;&lt; SourcePage.new(conf, type) if conf.sources
</pre><pre class="diff" id="context"> 
       if last_type
 	type_page.prev_type = last_type
</pre><pre class="diff"><small id="info">@@ -1654,7 +1863,7 @@
</small></pre><pre class="diff" id="context">     end
   end
 
</pre><pre class="diff" id="removed">-  list &lt;&lt; IndexPage.new(type_agregator)
</pre><pre class="diff" id="added">+  list &lt;&lt; IndexPage.new(<span id="addedchars">conf,&nbsp;</span>type_agregator)
</pre><pre class="diff" id="context"> 
   list
 end
</pre></div>
<hr /><a name="file4" /><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>/<a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/ui">ui</a></span><br />
<div class="fileheader"><big><b>cli.rb</b></big> <small id="info"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/ui/cli.rb?rev=183&amp;content-type=text/vnd.viewcvs-markup">183</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/ui/cli.rb.diff?r1=183&amp;r2=184">-&gt;</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/ui/cli.rb?rev=184&amp;content-type=text/vnd.viewcvs-markup">184</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/ui/cli.rb	2005-07-03 20:17:44 UTC (rev 183)
+++ trunk/as2api/ui/cli.rb	2005-07-04 00:20:55 UTC (rev 184)
@@ -10,7 +10,8 @@
</small></pre><pre class="diff" id="context"> 		  :progress_listener,
 		  :input_encoding,
 		  :draw_diagrams,
</pre><pre class="diff" id="removed">-		  :dot_exe<span id="removedchars">)</span>
</pre><pre class="diff" id="added">+		  :dot_exe<span id="addedchars">,</span>
+		  :sources)
</pre><pre class="diff" id="context"> 
 SourceFile = Struct.new(:prefix, :suffix)
 
</pre><pre class="diff"><small id="info">@@ -82,7 +83,8 @@
</small></pre><pre class="diff" id="context">       [ "--progress",         GetoptLong::NO_ARGUMENT ],
       [ "--encoding",         GetoptLong::REQUIRED_ARGUMENT ],
       [ "--draw-diagrams",    GetoptLong::NO_ARGUMENT ],
</pre><pre class="diff" id="removed">-      [ "--dot-exe",          GetoptLong::REQUIRED_ARGUMENT ]
</pre><pre class="diff" id="added">+      [ "--dot-exe",          GetoptLong::REQUIRED_ARGUMENT ]<span id="addedchars">,</span>
+      [ "--sources",          GetoptLong::NO_ARGUMENT ]
</pre><pre class="diff" id="context">     )
 
     conf = Conf.new
</pre><pre class="diff"><small id="info">@@ -110,6 +112,8 @@
</small></pre><pre class="diff" id="context"> 	  conf.draw_diagrams = true
 	when "--dot-exe"
 	  conf.dot_exe = arg
</pre><pre class="diff" id="added">+	when "--sources"
+	  conf.sources = true
</pre><pre class="diff" id="context">       end
     end
     if ARGV.empty?
</pre><pre class="diff"><small id="info">@@ -158,8 +162,7 @@
</small></pre><pre class="diff" id="context">       begin
 	is_utf8 = detect_bom?(io)
 	type = simple_parse(io)
</pre><pre class="diff" id="removed">-	type.input_filename = file.suffix
-	type.sourcepath_location(File.dirname(file.suffix))
</pre><pre class="diff" id="added">+	type.input_file = file
</pre><pre class="diff" id="context"> 	type.source_utf8 = is_utf8
 	type_agregator.add_type(type)
       rescue =&gt;e
</pre><pre class="diff"><small id="info">@@ -223,6 +226,8 @@
</small></pre><pre class="diff" id="context">   --dot-exe &lt;filename&gt;
         Specify the location of the 'dot' tool from Graphviz, if it is not
         available via the standard PATH.
</pre><pre class="diff" id="added">+  --sources
+        Generate an HTML page for the source code of each input file
</pre><pre class="diff" id="context">     END
   end
 
</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>