mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
25 lines
578 B
Ruby
25 lines
578 B
Ruby
require 'fileutils'
|
|
require 'erb'
|
|
|
|
task :generate do
|
|
require 'rdiscount'
|
|
`rm -rf output`
|
|
FileUtils.mkdir("output")
|
|
`cat text/*.markdown > output/UserManual.markdown`
|
|
`cp -r assets output`
|
|
|
|
source = Dir.glob("text/**/*.markdown").map do |file|
|
|
File.read(file)
|
|
end.join("\n")
|
|
body = Markdown.new(source).to_html
|
|
template = ERB.new(File.read("template.html"))
|
|
|
|
File.open("output/UserManual.html", "w") do |f|
|
|
f.puts template.result(binding)
|
|
end
|
|
`open output/UserManual.html`
|
|
end
|
|
|
|
task :upload do
|
|
`rsync -a output/ sydney:public_html/gitx/`
|
|
end |