From 806a8d01c49895b8e9c4322a3cf253f601b4c5a9 Mon Sep 17 00:00:00 2001 From: Michael Hanson Date: Fri, 30 Sep 2011 22:04:45 -0700 Subject: [PATCH 1/2] Add support for a ':stylesheet' option --- lib/guard/rocco.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/guard/rocco.rb b/lib/guard/rocco.rb index 4b6cbc1..ff8ee4f 100644 --- a/lib/guard/rocco.rb +++ b/lib/guard/rocco.rb @@ -28,7 +28,9 @@ module Guard target ||= filename_to_target(path) puts "rocco: #{path} -> #{target}" FileUtils.mkdir_p File.split(target).first - File.open(target, 'wb') { |fh| fh.print ::Rocco.new(path, all_paths).to_html } + File.open(target, 'wb') do |fh| + fh.print ::Rocco.new(path, all_paths, rocco_options).to_html + end end def all_paths @@ -38,6 +40,10 @@ module Guard def filename_to_target(path) File.join(@options[:dir], path).gsub(%r{\.[^\.]+$}, '.html') end + + def rocco_options + @options[:stylesheet] ? {stylesheet: @options[:stylesheet]} : {} + end end end -- 2.45.2 From 9cfb15d187cd2bcac742508f4ff7f395e476f22e Mon Sep 17 00:00:00 2001 From: Michael Hanson Date: Sat, 1 Oct 2011 12:56:09 -0700 Subject: [PATCH 2/2] Add ':stylesheet' option to README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 60feaff..b34c01c 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ It's a [Guard](http://github.com/guard/guard) for the [Rocco](http://github.com/ watch(%r{^lib/.*\.rb$}) end -Only one option for now: +Options: * `:dir` specifies the output dir (default `doc`) +* `:stylesheet` specifies a custom stylesheet to use (default is + http://jashkenas.github.com/docco/resources/docco.css) `gem install guard-rocco` or Bundle it up with `gem 'guard-rocco'`. Then `guard init rocco`. Yeah! -- 2.45.2