Skip to content

Commit 9eb3ccf

Browse files
committed
remove-gitbook
1 parent c90547e commit 9eb3ccf

File tree

4 files changed

+14
-34
lines changed

4 files changed

+14
-34
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
_book
21
.bundle
3-
catalog.yml
42
*.re
53
*.pdf
64
*.html

SUMMARY.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

catalog.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
PREDEF:
3+
- README.re
4+
CHAPS:
5+
- purpose.re
6+
- first-experience.re
7+
- hello-world.re
8+
- transfer-learning.re
9+
- evaluation.re
10+
- first-step-rawtherapee.re
11+
- generator.re
12+
POSTDEF:
13+
- postdef.re

lib/tasks/review.rake

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ require 'yaml'
55
BOOK = 'book'
66
BOOK_PDF = BOOK + '.pdf'
77
BOOK_EPUB = BOOK + '.epub'
8-
CATALOG_FILE = 'catalog.yml'
98
CONFIG_FILE = 'config.yml'
109
WEBROOT = 'webroot'
1110
TEXTROOT = BOOK + '-text'
@@ -21,22 +20,6 @@ def build_all(mode)
2120
sh "review-compile --target=#{mode} --footnotetext --stylesheet=style.css"
2221
end
2322

24-
def convert_summary
25-
catalog = Hash.new { |h, k| h[k] = [] }
26-
catalog['PREDEF'] = ['README.re']
27-
File.read("SUMMARY.md").scan(/\((.*.md)/).flatten.each do |file|
28-
case file
29-
when /appendix/
30-
catalog['APPENDIX'] << file.ext('.re')
31-
when /postdef/
32-
catalog['POSTDEF'] << file.ext('.re')
33-
else
34-
catalog['CHAPS'] << file.ext('.re')
35-
end
36-
end
37-
File.write(CATALOG_FILE, YAML.dump(catalog))
38-
end
39-
4023
task default: :html_all
4124

4225
desc 'build html (Usage: rake build re=target.re)'
@@ -83,17 +66,13 @@ desc 'generate EPUB file'
8366
task epub: BOOK_EPUB
8467

8568
SRC = FileList['*.md'] - %w(SUMMARY.md)
86-
OBJ = SRC.ext('re') + [CATALOG_FILE]
69+
OBJ = SRC.ext('re')
8770
INPUT = OBJ + [CONFIG_FILE, 'titlepage.tex']
8871

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

93-
file CATALOG_FILE => 'SUMMARY.md' do |t|
94-
convert_summary
95-
end
96-
9776
file BOOK_PDF => INPUT do
9877
FileUtils.rm_rf [BOOK_PDF, BOOK, BOOK + '-pdf']
9978
sh "review-pdfmaker #{CONFIG_FILE}"

0 commit comments

Comments
 (0)