# vim: syntax=ruby
require 'bluecloth'
htmlfiles = []
CLEAN = []
FileList['**/*.page'].each do |src|
name = src.sub(".page", ".html")
htmlfiles << name
CLEAN << name
file name => [src, "Rakefile"] do
File.open(name, "w") do |f|
text = File.read(src).sub(/\A^---[^-]+^---$/, '')
f.puts BlueCloth.new( text ).to_html
end
end
end
task :clean do
CLEAN.each do |file|
if FileTest.directory?(file)
sh %{rm -rf #{file}}
elsif FileTest.exists?(file)
File.unlink(file)
end
end
end
task :html => htmlfiles
task :default => :html
task :docs do
sh %{puppetdoc --arguments > documentation/configref.page}
sh %{puppetdoc --types > documentation/typedocs.page}
end