Skip to content

Fix most errors reported by epubcheck #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta charset="utf-8"/>
<title> {% if page.title %} {{ page.title }} | {% endif %} Ruby Hacking Guide </title>
<link rel="stylesheet" href="/css/styles.css" />
</head>
Expand All @@ -11,7 +11,7 @@

<header>
<h1><a href="/">Ruby Hacking Guide</a></h1>
<header>
</header>

<nav role="navigation">
<ul>
Expand Down
2 changes: 1 addition & 1 deletion load.textile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Loading
---
Translated by Vincent ISAMBART

h1. Chapter 18: Loading
h1(#chapter). Chapter 18: Loading

h2. Outline

Expand Down
2 changes: 1 addition & 1 deletion minimum.textile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: A Minimal Introduction to Ruby
---
Translated by Sebastian Krause

h1. Chapter 1: Introduction
h1(#chapter). Chapter 1: Introduction

h2. A Minimal Introduction to Ruby

Expand Down
20 changes: 11 additions & 9 deletions script/publish
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ end
Dir["#{ORIGINAL_DIR}/*.html"].each do |f|
old = File.read(f)
new = old.gsub(%r("/css/styles.css"), %q("css/styles.css"))
.gsub(%r(<br>), %q(<br/>))
.gsub(%r(<hr>), %q(<hr/>))
.gsub(%r(<img([^>]*?)>), %q(<img\1/>))
File.write("#{TEMP_DIR}/#{File.basename(f)}", new)
end

navigation = [
{:label => "Preface", :content => "preface.html"},
{:label => "Introduction - translation in progress", :content => "intro.html"},
{:label => "Part 1: Objects", :content => "minimum.html", :nav => [
{:label => "Introduction", :content => "intro.html"},
{:label => "Part 1: Objects", :content => "minimum.html#chapter", :nav => [
{:label => "Chapter 1: A Minimal Introduction to Ruby", :content => "minimum.html"},
{:label => "Chapter 2: Objects", :content => "object.html"},
{:label => "Chapter 3: Names and name tables", :content => "name.html"},
Expand All @@ -52,33 +55,33 @@ navigation = [
{:label => "Chapter 6: Variables and constants", :content => "variable.html"},
{:label => "Chapter 7: Security", :content => "security.html"}
]},
{:label => "Part 2: Syntax analysis", :content => "spec.html", :nav => [
{:label => "Part 2: Syntax analysis", :content => "spec.html#chapter", :nav => [
{:label => "Chapter 8: Ruby Language Details", :content => "spec.html"},
{:label => "Chapter 9: yacc crash course", :content => "yacc.html"},
{:label => "Chapter 10: Parser", :content => "parser.html"},
{:label => "Chapter 11: Finite-state scanner", :content => "contextual.html"},
{:label => "Chapter 12: Syntax tree construction", :content => "syntree.html"}
]},
{:label => "Part 3: Evaluation", :content => "evaluator.html", :nav => [
{:label => "Part 3: Evaluation", :content => "evaluator.html#chapter", :nav => [
{:label => "Chapter 13: Structure of the evaluator", :content => "evaluator.html"},
{:label => "Chapter 14: Context", :content => "module.html"},
{:label => "Chapter 15: Methods", :content => "method.html"},
{:label => "Chapter 16: Blocks", :content => "iterator.html"},
{:label => "Chapter 17: Dynamic evaluation", :content => "anyeval.html"}
]},
{:label => "Part 4: Around the evaluator", :content => "load.html", :nav => [
{:label => "Part 4: Around the evaluator", :content => "load.html#chapter", :nav => [
{:label => "Chapter 18: Loading", :content => "load.html"},
{:label => "Chapter 19: Threads", :content => "thread.html"}
]},
{:label => "Final chapter: Ruby's future - translation unstarted", :content => "fin.html"}
{:label => "Final chapter: Ruby's future", :content => "fin.html"}
]

file_list = Dir["#{TEMP_DIR}/images/*"].map{|f| {f => "images"}}
file_list.push("#{TEMP_DIR}/css/styles.css" => "css")

def scan_navigation(nav, acc)
nav.each do |n|
if n[:content]
if n[:content] && n[:content] !~ /#.*$/
acc.push("#{TEMP_DIR}/#{n[:content]}")
end
if n[:nav]
Expand All @@ -94,8 +97,7 @@ epub = EeePub.make do
creator 'Minero AOKI, Vincent ISAMBART, Clifford Escobar CAOILE'
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'
date today
identifier 'http://ruby-hacking-guide.github.io/', :scheme => 'URL'
uid 'http://ruby-hacking-guide.github.io/'
identifier 'http://ruby-hacking-guide.github.io/', :scheme => 'URL', :id => 'ruby-hacking-guide.github.io'
cover "images/book_cover.jpg"

files file_list
Expand Down