Skip to content
Merged
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>
@@ -11,7 +11,7 @@

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

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

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

h2. Outline

2 changes: 1 addition & 1 deletion minimum.textile
Original file line number Diff line number Diff line change
@@ -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

20 changes: 11 additions & 9 deletions script/publish
Original file line number Diff line number Diff line change
@@ -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"},
@@ -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]
@@ -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