-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
37 lines (31 loc) · 1.24 KB
/
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
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 Book_template_top.asc -o My_book.html`
puts " -- HTML output at My_book.html"
puts "Converting to PDF... (this one takes a while)"
`bundle exec asciidoctor-pdf Book_template_top.asc -o My_book.pdf`
puts " -- PDF output at My_book.pdf"
end
desc 'build html book formats'
task :build_html => :prebuild do
puts "Converting to HTML..."
`bundle exec asciidoctor Book_template_top.asc -o My_book.html`
puts " -- HTML output at My_book.html"
end
desc 'build html with github stylesheet'
task :build_html_gitcss => :prebuild do
puts "Converting to HTML with github stylesheet..."
`bundle exec asciidoctor Book_template_top.asc -a stylesheet=github.css -a stylesdir=./stylesheets -o My_book_github_style.html`
puts " -- HTML output at My_book_github_style.html"
end
end
task :default => "book:build"