Skip to content

Commit

Permalink
add-md2review
Browse files Browse the repository at this point in the history
  • Loading branch information
masarakki committed Jul 24, 2024
1 parent a790c22 commit 13a1c9f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ source 'https://rubygems.org'

gem 'rake'
gem 'review'
gem 'md2review'
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ GEM
remote: https://rubygems.org/
specs:
image_size (3.4.0)
md2review (1.12.1)
redcarpet (> 2.0.0)
pastel (0.8.0)
tty-color (~> 0.5)
rake (13.2.1)
redcarpet (3.6.0)
review (5.9.0)
image_size
rexml
Expand All @@ -25,6 +28,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
md2review
rake
review

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# まえがき
3 changes: 1 addition & 2 deletions catalog.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
PREDEF:

- README.re
CHAPS:
-

APPENDIX:

Expand Down
10 changes: 8 additions & 2 deletions lib/tasks/review.rake
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@ task epub: BOOK_EPUB

IMAGES = FileList['images/**/*']
OTHERS = ENV['REVIEW_DEPS'] || []
SRC = FileList['./**/*.re', '*.rb'] + [CONFIG_FILE, CATALOG_FILE] + IMAGES + FileList[OTHERS]
MDS = FileList['*.md']
RES = MDS.ext('re')
SRC = RES + [CONFIG_FILE, CATALOG_FILE] + IMAGES + FileList[OTHERS]
SRC_EPUB = FileList['*.css']
SRC_PDF = FileList['layouts/*.erb', 'sty/**/*.sty']

rule '.re' => '.md' do |t|
sh "md2review --render-link-in-footnote #{t.source} > #{t.name}"
end

file BOOK_PDF => SRC + SRC_PDF do
FileUtils.rm_rf([BOOK_PDF, BOOK, BOOK + '-pdf'])
sh "review-pdfmaker #{PDF_OPTIONS} #{CONFIG_FILE}"
Expand Down Expand Up @@ -143,4 +149,4 @@ end
desc 'build with vivliostyle'
task vivliostyle: 'vivliostyle:build'

CLEAN.include([BOOK, BOOK_PDF, BOOK_EPUB, BOOK + '-pdf', BOOK + '-epub', WEBROOT, 'images/_review_math', 'images/_review_math_text', TEXTROOT, IDGXMLROOT])
CLEAN.include([BOOK, BOOK_PDF, BOOK_EPUB, BOOK + '-pdf', BOOK + '-epub', WEBROOT, 'images/_review_math', 'images/_review_math_text', TEXTROOT, IDGXMLROOT, RES])

0 comments on commit 13a1c9f

Please sign in to comment.