3737Dir [ "#{ ORIGINAL_DIR } /*.html" ] . each do |f |
3838 old = File . read ( f )
3939 new = old . gsub ( %r("/css/styles.css") , %q("css/styles.css") )
40+ . gsub ( %r(<br>) , %q(<br/>) )
41+ . gsub ( %r(<hr>) , %q(<hr/>) )
42+ . gsub ( %r(<img([^>]*?)>) , %q(<img\1/>) )
4043 File . write ( "#{ TEMP_DIR } /#{ File . basename ( f ) } " , new )
4144end
4245
4346navigation = [
4447 { :label => "Preface" , :content => "preface.html" } ,
45- { :label => "Introduction - translation in progress " , :content => "intro.html" } ,
46- { :label => "Part 1: Objects" , :content => "minimum.html" , :nav => [
48+ { :label => "Introduction" , :content => "intro.html" } ,
49+ { :label => "Part 1: Objects" , :content => "minimum.html#chapter " , :nav => [
4750 { :label => "Chapter 1: A Minimal Introduction to Ruby" , :content => "minimum.html" } ,
4851 { :label => "Chapter 2: Objects" , :content => "object.html" } ,
4952 { :label => "Chapter 3: Names and name tables" , :content => "name.html" } ,
@@ -52,33 +55,33 @@ navigation = [
5255 { :label => "Chapter 6: Variables and constants" , :content => "variable.html" } ,
5356 { :label => "Chapter 7: Security" , :content => "security.html" }
5457 ] } ,
55- { :label => "Part 2: Syntax analysis" , :content => "spec.html" , :nav => [
58+ { :label => "Part 2: Syntax analysis" , :content => "spec.html#chapter " , :nav => [
5659 { :label => "Chapter 8: Ruby Language Details" , :content => "spec.html" } ,
5760 { :label => "Chapter 9: yacc crash course" , :content => "yacc.html" } ,
5861 { :label => "Chapter 10: Parser" , :content => "parser.html" } ,
5962 { :label => "Chapter 11: Finite-state scanner" , :content => "contextual.html" } ,
6063 { :label => "Chapter 12: Syntax tree construction" , :content => "syntree.html" }
6164 ] } ,
62- { :label => "Part 3: Evaluation" , :content => "evaluator.html" , :nav => [
65+ { :label => "Part 3: Evaluation" , :content => "evaluator.html#chapter " , :nav => [
6366 { :label => "Chapter 13: Structure of the evaluator" , :content => "evaluator.html" } ,
6467 { :label => "Chapter 14: Context" , :content => "module.html" } ,
6568 { :label => "Chapter 15: Methods" , :content => "method.html" } ,
6669 { :label => "Chapter 16: Blocks" , :content => "iterator.html" } ,
6770 { :label => "Chapter 17: Dynamic evaluation" , :content => "anyeval.html" }
6871 ] } ,
69- { :label => "Part 4: Around the evaluator" , :content => "load.html" , :nav => [
72+ { :label => "Part 4: Around the evaluator" , :content => "load.html#chapter " , :nav => [
7073 { :label => "Chapter 18: Loading" , :content => "load.html" } ,
7174 { :label => "Chapter 19: Threads" , :content => "thread.html" }
7275 ] } ,
73- { :label => "Final chapter: Ruby's future - translation unstarted " , :content => "fin.html" }
76+ { :label => "Final chapter: Ruby's future" , :content => "fin.html" }
7477]
7578
7679file_list = Dir [ "#{ TEMP_DIR } /images/*" ] . map { |f | { f => "images" } }
7780file_list . push ( "#{ TEMP_DIR } /css/styles.css" => "css" )
7881
7982def scan_navigation ( nav , acc )
8083 nav . each do |n |
81- if n [ :content ]
84+ if n [ :content ] && n [ :content ] !~ /#.*$/
8285 acc . push ( "#{ TEMP_DIR } /#{ n [ :content ] } " )
8386 end
8487 if n [ :nav ]
@@ -94,8 +97,7 @@ epub = EeePub.make do
9497 creator 'Minero AOKI, Vincent ISAMBART, Clifford Escobar CAOILE'
9598 rights 'The original work is Copyright © 2002 - 2004 Minero AOKI. Translated by Vincent ISAMBART and Clifford Escobar CAOILE This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike2.5 License'
9699 date today
97- identifier 'http://ruby-hacking-guide.github.io/' , :scheme => 'URL'
98- uid 'http://ruby-hacking-guide.github.io/'
100+ identifier 'http://ruby-hacking-guide.github.io/' , :scheme => 'URL' , :id => 'ruby-hacking-guide.github.io'
99101 cover "images/book_cover.jpg"
100102
101103 files file_list
0 commit comments