Created
August 1, 2018 05:12
-
-
Save kitwalker12/aab42ac84309af7fb3788029d7c1aaa7 to your computer and use it in GitHub Desktop.
Rake File Lists
This file contains 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") | |
rule ".html" => ".md" do |t| | |
sh "pandoc -o #{t.name} #{t.source}" | |
end | |
rule ".html" => ".markdown" 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