forked from atom/flight-manual.atom.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
38 lines (33 loc) · 1022 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace :book do
desc 'prepare build'
task :prebuild do
Dir.mkdir 'images' unless Dir.exists? 'images'
Dir.glob("book/*/images/*").each do |image|
FileUtils.copy(image, "images/" + File.basename(image))
end
end
desc 'build basic book formats'
task :build => :prebuild do
puts "Converting to HTML..."
`bundle exec asciidoctor atom.asc`
puts " -- HTML output at atom.html"
puts "Converting to EPub..."
`bundle exec asciidoctor-epub3 atom.asc`
puts " -- Epub output at atom.epub"
puts "Converting to Mobi (kf8)..."
`bundle exec asciidoctor-epub3 -a ebook-format=kf8 atom.asc`
puts " -- Mobi output at atom.mobi"
puts "Converting to PDF... (this one takes a while)"
`bundle exec asciidoctor-pdf atom.asc 2>/dev/null`
puts " -- PDF output at atom.pdf"
end
desc 'clean out generated formats'
task :clean do
`rm atom.html`
`rm atom.epub`
`rm atom-kf8.epub`
`rm atom.mobi`
`rm atom.pdf`
`rm atom.pdfmarks`
end
end