Created
June 5, 2012 15:51
-
-
Save robharper/2875876 to your computer and use it in GitHub Desktop.
Rocco (Docco) rake-pipeline filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rocco" | |
# | |
# Run rocco to generate documentation on provided files | |
# | |
class RoccoFilter < Rake::Pipeline::Filter | |
def initialize(options={}, &block) | |
super(&block) | |
@sources = options.delete(:sources) | |
@options = options | |
end | |
def generate_output(inputs, output) | |
inputs.each do |input| | |
rocco = Rocco.new(input.fullpath, @sources, @options) do | |
input.read | |
end | |
output.write rocco.to_html | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This simple filter ingests source files and runs them through Rocco, the Docco Ruby port. Options can be passed directly to Rocco and additional html files may be linked via the
:sources
options.