buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toulm...@apache.org
Subject svn commit: r985788 - in /buildr/trunk: buildr.gemspec rakelib/doc.rake rakelib/jekylltask.rb
Date Mon, 16 Aug 2010 05:16:22 GMT
Author: toulmean
Date: Mon Aug 16 05:16:22 2010
New Revision: 985788

URL: http://svn.apache.org/viewvc?rev=985788&view=rev
Log:
remove our custom code to generate the website, using jekylltask instead

Removed:
    buildr/trunk/rakelib/jekylltask.rb
Modified:
    buildr/trunk/buildr.gemspec
    buildr/trunk/rakelib/doc.rake

Modified: buildr/trunk/buildr.gemspec
URL: http://svn.apache.org/viewvc/buildr/trunk/buildr.gemspec?rev=985788&r1=985787&r2=985788&view=diff
==============================================================================
--- buildr/trunk/buildr.gemspec (original)
+++ buildr/trunk/buildr.gemspec Mon Aug 16 05:16:22 2010
@@ -70,4 +70,5 @@ for those one-off tasks, with a language
   spec.add_development_dependency 'sdoc'
   spec.add_development_dependency 'rcov', '~>0.8'
   spec.add_development_dependency 'win32console' if spec.platform.to_s == 'x86-mswin32'
+  spec.add_development_dependency 'jekylltask', '>= 1.0.2'
 end

Modified: buildr/trunk/rakelib/doc.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/doc.rake?rev=985788&r1=985787&r2=985788&view=diff
==============================================================================
--- buildr/trunk/rakelib/doc.rake (original)
+++ buildr/trunk/rakelib/doc.rake Mon Aug 16 05:16:22 2010
@@ -36,7 +36,17 @@ end
 
 
 begin
-  require 'rakelib/jekylltask'
+  require 'jekylltask'
+  module TocFilter
+    def toc(input)
+      input.scan(/<(h2)(?:>|\s+(.*?)>)([^<]*)<\/\1\s*>/mi).inject(%{<ol
class="toc">}) { |toc, entry|
+        id = entry[1][/^id=(['"])(.*)\1$/, 2]
+        title = entry[2].gsub(/<(\w*).*?>(.*?)<\/\1\s*>/m, '\2').strip
+        toc << %{<li><a href="##{id}">#{title}</a></li>}
+      } << "</ol>"
+    end
+  end
+  Liquid::Template.register_filter(TocFilter)
 
   desc "Generate Buildr documentation in _site/"
   JekyllTask.new :jekyll do |task|



Mime
View raw message