test/sample-book/src/Rakefile in review-2.0.0.beta1 vs test/sample-book/src/Rakefile in review-2.0.0
- old
+ new
@@ -3,20 +3,21 @@
BOOK = "book"
BOOK_PDF = BOOK+".pdf"
BOOK_EPUB = BOOK+".epub"
CONFIG_FILE = "config.yml"
+WEBROOT = "webroot"
def build(mode, chapter)
sh "review-compile --target=#{mode} --footnotetext --stylesheet=style.css #{chapter} > tmp"
mode_ext = {"html" => "html", "latex" => "tex",
- "idgxml" => "xml", "inao" => "inao"}
+ "idgxml" => "xml"}
FileUtils.mv "tmp", chapter.gsub(/re\z/, mode_ext[mode])
end
def build_all(mode)
- sh "review-compile --all --target=#{mode} --footnotetext --stylesheet=style.css"
+ sh "review-compile --target=#{mode} --footnotetext --stylesheet=style.css"
end
task :default => :html_all
desc "build html (Usage: rake build re=target.re)"
@@ -37,10 +38,13 @@
task :all => [:pdf, :epub]
desc 'generate PDF file'
task :pdf => BOOK_PDF
+desc 'generate stagic HTML file for web'
+task :web => WEBROOT
+
desc 'generate EPUB file'
task :epub => BOOK_EPUB
SRC = FileList['*.re'] + [CONFIG_FILE]
@@ -52,6 +56,11 @@
file BOOK_EPUB => SRC do
FileUtils.rm_rf [BOOK_EPUB, BOOK, BOOK+"-epub"]
sh "review-epubmaker #{CONFIG_FILE}"
end
-CLEAN.include([BOOK, BOOK_PDF, BOOK_EPUB, BOOK+"-pdf", BOOK+"-epub"])
+file WEBROOT => SRC do
+ FileUtils.rm_rf [WEBROOT]
+ sh "review-webmaker #{CONFIG_FILE}"
+end
+
+CLEAN.include([BOOK, BOOK_PDF, BOOK_EPUB, BOOK+"-pdf", BOOK+"-epub", WEBROOT])