Created
September 11, 2013 04:32
-
-
Save myronmarston/6519369 to your computer and use it in GitHub Desktop.
Alternate code for ruby tapas #131
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
source_files = Rake::FileList.new("**/*.md", "**/*.markdown") do |fl| | |
fl.exclude("~*") | |
fl.exclude(/^scratch\//) | |
fl.exclude do |f| | |
`git ls-files #{f}`.empty? | |
end | |
end | |
task :default => :html | |
task :html => source_files.ext(".html") | |
source_for_html = ->(html_file) do | |
source_files.detect{|f| f.ext('') == html_file.ext('')} | |
end | |
rule ".html" => source_for_html do |t| | |
sh "pandoc -o #{t.name} #{t.source}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment