forked from whymirror/poignantguide
-
Notifications
You must be signed in to change notification settings - Fork 1
/
chapter.erb
79 lines (65 loc) · 2.38 KB
/
chapter.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<%
prevPage = chapter.index > 1 ? "chapter-#{ chapter.index - 1 }.html" : "index.html"
nextPage = chapter.index < book.chapters.length ? "chapter-#{ chapter.index + 1 }.html" : "index.html"
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%= book.title.to_html %> :: <%= chapter.index %>. <%= chapter.title.to_html %></title>
<link rel="stylesheet" type="text/css" href="guide.css" />
</head>
<body>
<div id="banner">
<div class="pager">
< <a class="pagebar" href="<%= prevPage %>">prev</a> | <a class="pagebar" href="<%= nextPage %>">next</a> >
</div>
<div class="title">
<h3>why’s <span class="hilite">(poignant)</span> guide to ruby</h3>
<a class="pagebar" href="http://whytheluckystiff.net/"><b>whytheluckystiff.net</b></a> > <a class="pagebar" href="index.html">Contents</a>
</div>
</div>
<div id="container">
<div class="page">
<div class="pageTitle">
<h3><%= chapter.index %>.</h3>
<h1><%= chapter.title.to_html %></h1>
<p><img src="i/chapter.poignant.guide-<%= chapter.index %>.jpg" alt="[o]" /></p>
</div>
<div class="content">
<% chapter.sections.each do |sect|
if sect.respond_to? :file_name %>
<img src="<%= sect.file_name %>" /><br />
<% elsif sect.respond_to? :header %>
<a name="section<%= sect.index %>" />
<h2><%= sect.index %>. <%= sect.header %></h2>
<%= sect.content.to_html %>
<% elsif sect.respond_to? :title %>
<div class="sidebar">
<h1>sidebar!</h1>
<% if sect.title %>
<h2><%= sect.title.to_html %></h2>
<% end %>
<%= sect.content.to_html %>
<h1>sidebar!</h1>
</div>
<% else %>
<%= RedCloth.new( sect ).to_html %>
<% end %>
<% end %>
<p style="text-align:right;">
<a href="<%= nextPage %>">Turn page.</a>
</p>
</div>
</div>
</div>
<div id="footer">
<div class="pager">
< <a href="<%= prevPage %>">prev</a> | <a href="<%= nextPage %>">next</a> >
</div>
<div class="title">
<h3>why's <span class="hilite">(poignant)</span> guide to ruby</h3>
</div>
</div>
</body>
</html>