test/sample-book/src/Rakefile in review-2.4.0 vs test/sample-book/src/Rakefile in review-2.5.0

- old
+ new

@@ -4,14 +4,16 @@ BOOK = 'book' BOOK_PDF = BOOK + '.pdf' BOOK_EPUB = BOOK + '.epub' CONFIG_FILE = 'config.yml' WEBROOT = 'webroot' +TEXTROOT = BOOK + '-text' +TOPROOT = BOOK + '-text' def build(mode, chapter) sh "review-compile --target=#{mode} --footnotetext --stylesheet=style.css #{chapter} > tmp" - mode_ext = { 'html' => 'html', 'latex' => 'tex', 'idgxml' => 'xml' } + mode_ext = { 'html' => 'html', 'latex' => 'tex', 'idgxml' => 'xml', 'top' => 'txt', 'plaintext' => 'txt' } FileUtils.mv 'tmp', chapter.gsub(/re\z/, mode_ext[mode]) end def build_all(mode) sh "review-compile --target=#{mode} --footnotetext --stylesheet=style.css" @@ -44,13 +46,23 @@ task all: %i[pdf epub] desc 'generate PDF file' task pdf: BOOK_PDF -desc 'generate stagic HTML file for web' +desc 'generate static HTML file for web' task web: WEBROOT +desc 'generate text file (without decoration)' +task plaintext: TEXTROOT do + sh "review-textmaker -n #{CONFIG_FILE}" +end + +desc 'generate (decorated) text file' +task text: TOPROOT do + sh "review-textmaker #{CONFIG_FILE}" +end + desc 'generate EPUB file' task epub: BOOK_EPUB SRC = FileList['*.re'] + [CONFIG_FILE] @@ -67,6 +79,10 @@ 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, 'images/_review_math']) +file TEXTROOT => SRC do + FileUtils.rm_rf [TEXTROOT] +end + +CLEAN.include([BOOK, BOOK_PDF, BOOK_EPUB, BOOK + '-pdf', BOOK + '-epub', WEBROOT, 'images/_review_math', TEXTROOT])