mizuho 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +1 -1
- data/README.markdown +14 -25
- data/asciidoc/stylesheets/flask.css +25 -11
- data/bin/mizuho +27 -11
- data/lib/mizuho.rb +25 -4
- data/lib/mizuho/fuzzystringmatch.rb +100 -0
- data/lib/mizuho/generator.rb +185 -83
- data/lib/mizuho/id_map.rb +224 -0
- data/lib/mizuho/source_highlight.rb +20 -0
- data/templates/arrow-up.png +0 -0
- data/templates/balloon.png +0 -0
- data/templates/balloon.svg +177 -0
- data/templates/jquery-1.6.1.min.js +18 -0
- data/templates/jquery-1.7.1.min.js +4 -0
- data/templates/jquery.hashchange-1.0.0.js +121 -0
- data/templates/juvia.js +140 -0
- data/templates/mizuho.css +122 -0
- data/templates/mizuho.js +199 -0
- data/templates/topbar.css +116 -0
- data/templates/topbar.html +7 -0
- data/templates/topbar.js +175 -0
- data/test/id_map_spec.rb +188 -0
- metadata +22 -16
- data/lib/mizuho/chapter.rb +0 -54
- data/lib/mizuho/heading.rb +0 -46
- data/lib/mizuho/parser.rb +0 -103
- data/lib/mizuho/template.rb +0 -50
- data/templates/asciidoc.css +0 -358
- data/templates/asciidoc.html.erb +0 -86
- data/templates/manualsonrails.css +0 -165
- data/templates/manualsonrails.html.erb +0 -97
data/templates/asciidoc.html.erb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
# Template based on Asciidoc's default layout. This isn't
|
3
|
-
def visit_heading(heading, max_levels = 2, result = "")
|
4
|
-
if multi_page?
|
5
|
-
result << %Q{
|
6
|
-
<div class="toclevel#{heading.level - 1}">
|
7
|
-
<a href="#{h heading.basename}#{h heading.anchor}">#{heading.title}</a>
|
8
|
-
</div>
|
9
|
-
}.strip
|
10
|
-
else
|
11
|
-
result << %Q{
|
12
|
-
<div class="toclevel#{heading.level - 1}">
|
13
|
-
<a href="#{h heading.anchor}">#{heading.title}</a>
|
14
|
-
</div>
|
15
|
-
}.strip
|
16
|
-
end
|
17
|
-
if heading.level <= max_levels
|
18
|
-
heading.children.each do |h|
|
19
|
-
visit_heading(h, max_levels, result)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
return result
|
23
|
-
end
|
24
|
-
|
25
|
-
def current_heading
|
26
|
-
return table_of_contents.find do |h|
|
27
|
-
h.title == current_chapter.title
|
28
|
-
end
|
29
|
-
end
|
30
|
-
%>
|
31
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
32
|
-
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
33
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
34
|
-
<head>
|
35
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
36
|
-
<meta name="generator" content="AsciiDoc 8.2.7" />
|
37
|
-
<style type="text/css">
|
38
|
-
<%= include_file('asciidoc.css') %>
|
39
|
-
</style>
|
40
|
-
<title><% if multi_page? && !is_preamble? %><%=h current_chapter.title_without_numbers %> :: <% end %><%=h title %></title>
|
41
|
-
</head>
|
42
|
-
<body>
|
43
|
-
<h1><%=h title %></h1>
|
44
|
-
<% if multi_page? && is_preamble? %>
|
45
|
-
<%= contents %>
|
46
|
-
<% end %>
|
47
|
-
<div id="toc">
|
48
|
-
<% if !multi_page? || is_preamble? %>
|
49
|
-
<h2>Table of contents</h2>
|
50
|
-
<%- for heading in table_of_contents -%>
|
51
|
-
<%= visit_heading(heading) %>
|
52
|
-
<%- end -%>
|
53
|
-
<% else %>
|
54
|
-
<div class="toclevel1 return_to_table_of_contents">
|
55
|
-
<a href="<%=h chapters.first.basename %>">« Return to table of contents</a>
|
56
|
-
</div>
|
57
|
-
<%= visit_heading(current_heading, 3) %>
|
58
|
-
<% end %>
|
59
|
-
</div>
|
60
|
-
<% if !multi_page? || !is_preamble? %>
|
61
|
-
<% if multi_page? %><h2><%=h current_chapter.title %></h2><% end %>
|
62
|
-
<%= contents %>
|
63
|
-
<% end %>
|
64
|
-
<%- if multi_page? -%>
|
65
|
-
<table id="chapter_navigation">
|
66
|
-
<tr>
|
67
|
-
<td class="left-floaty">
|
68
|
-
<% if prev_chapter %>
|
69
|
-
<a href="<%=h prev_chapter.basename %>">« <%= prev_chapter.title %></a>
|
70
|
-
<% end %>
|
71
|
-
</td>
|
72
|
-
<td class="center">
|
73
|
-
<% if !is_preamble? %>
|
74
|
-
<a href="<%=h chapters.first.basename %>">Table of contents</a>
|
75
|
-
<% end %>
|
76
|
-
</td>
|
77
|
-
<td class="right-floaty">
|
78
|
-
<% if next_chapter %>
|
79
|
-
<a href="<%=h next_chapter.basename %>"><%= next_chapter.title %> »</a>
|
80
|
-
<% end %>
|
81
|
-
</td>
|
82
|
-
</tr>
|
83
|
-
</table>
|
84
|
-
<%- end -%>
|
85
|
-
</body>
|
86
|
-
</html>
|
@@ -1,165 +0,0 @@
|
|
1
|
-
div#container {
|
2
|
-
max-width: 900px;
|
3
|
-
padding-bottom: 3em;
|
4
|
-
}
|
5
|
-
|
6
|
-
div#content {
|
7
|
-
margin-left: 200px;
|
8
|
-
}
|
9
|
-
|
10
|
-
div#container.notoc {
|
11
|
-
max-width: 600px;
|
12
|
-
}
|
13
|
-
|
14
|
-
.notoc div#content {
|
15
|
-
margin-left: 0;
|
16
|
-
}
|
17
|
-
|
18
|
-
pre {
|
19
|
-
line-height: 1.4em;
|
20
|
-
}
|
21
|
-
|
22
|
-
#content p tt {
|
23
|
-
background: #eeeeee;
|
24
|
-
border: solid 1px #cccccc;
|
25
|
-
padding: 3px;
|
26
|
-
}
|
27
|
-
|
28
|
-
dt {
|
29
|
-
font-weight: bold;
|
30
|
-
}
|
31
|
-
|
32
|
-
#content dt tt {
|
33
|
-
font-size: 10pt;
|
34
|
-
}
|
35
|
-
|
36
|
-
dd {
|
37
|
-
margin-left: 3em;
|
38
|
-
}
|
39
|
-
|
40
|
-
#content dt tt, #content pre tt {
|
41
|
-
background: none;
|
42
|
-
padding: 0;
|
43
|
-
border: 0;
|
44
|
-
}
|
45
|
-
|
46
|
-
#content .olist ol {
|
47
|
-
margin-left: 2em;
|
48
|
-
}
|
49
|
-
|
50
|
-
#header {
|
51
|
-
position: relative;
|
52
|
-
max-width: 840px;
|
53
|
-
margin-left: auto;
|
54
|
-
margin-right: auto;
|
55
|
-
}
|
56
|
-
|
57
|
-
#header.notoc {
|
58
|
-
max-width: 580px;
|
59
|
-
}
|
60
|
-
|
61
|
-
#logo {
|
62
|
-
position: absolute;
|
63
|
-
left: 10px;
|
64
|
-
top: 10px;
|
65
|
-
width: 110px;
|
66
|
-
height: 140px;
|
67
|
-
}
|
68
|
-
|
69
|
-
div#header h1#site_title {
|
70
|
-
background: url('http://web.rubyonrails.com/images/ruby_on_rails_by_mike_rundle2.gif') top left no-repeat;
|
71
|
-
position: absolute;
|
72
|
-
width: 392px;
|
73
|
-
height: 55px;
|
74
|
-
left: 145px;
|
75
|
-
top: 20px;
|
76
|
-
margin: 0;
|
77
|
-
padding: 0;
|
78
|
-
}
|
79
|
-
|
80
|
-
#site_title span {
|
81
|
-
display: none;
|
82
|
-
}
|
83
|
-
|
84
|
-
#site_title_tagline {
|
85
|
-
display: none;
|
86
|
-
}
|
87
|
-
|
88
|
-
ul#navMain {
|
89
|
-
position: absolute;
|
90
|
-
margin: 0;
|
91
|
-
padding: 0;
|
92
|
-
top: 97px;
|
93
|
-
left: 145px;
|
94
|
-
}
|
95
|
-
|
96
|
-
.left-floaty, .right-floaty {
|
97
|
-
padding: 15px;
|
98
|
-
}
|
99
|
-
|
100
|
-
.admonitionblock,
|
101
|
-
.tableblock {
|
102
|
-
margin-left: 1em;
|
103
|
-
margin-right: 1em;
|
104
|
-
margin-top: 0.25em;
|
105
|
-
margin-bottom: 1em;
|
106
|
-
}
|
107
|
-
|
108
|
-
.admonitionblock .icon {
|
109
|
-
padding-right: 8px;
|
110
|
-
}
|
111
|
-
|
112
|
-
.admonitionblock .content {
|
113
|
-
border: solid 1px #ffda78;
|
114
|
-
background: #fffebd;
|
115
|
-
padding: 10px;
|
116
|
-
padding-top: 8px;
|
117
|
-
padding-bottom: 8px;
|
118
|
-
}
|
119
|
-
|
120
|
-
.admonitionblock .title {
|
121
|
-
font-size: 140%;
|
122
|
-
margin-bottom: 0.5em;
|
123
|
-
}
|
124
|
-
|
125
|
-
.tableblock table {
|
126
|
-
border: solid 1px #aaaaff;
|
127
|
-
background: #f0f0ff;
|
128
|
-
}
|
129
|
-
|
130
|
-
.tableblock th {
|
131
|
-
background: #e0e0e0;
|
132
|
-
}
|
133
|
-
|
134
|
-
.tableblock th,
|
135
|
-
.tableblock td {
|
136
|
-
padding: 3px;
|
137
|
-
padding-left: 5px;
|
138
|
-
padding-right: 5px;
|
139
|
-
}
|
140
|
-
|
141
|
-
.sidebarblock {
|
142
|
-
margin-top: 0.25em;
|
143
|
-
margin: 1em;
|
144
|
-
border: solid 1px #ccccbb;
|
145
|
-
padding: 8px;
|
146
|
-
background: #ffffe0;
|
147
|
-
}
|
148
|
-
|
149
|
-
.sidebarblock .sidebar-title {
|
150
|
-
font-size: 140%;
|
151
|
-
font-weight: 600;
|
152
|
-
margin-bottom: 0.3em;
|
153
|
-
}
|
154
|
-
|
155
|
-
.sidebarblock .sidebar-content > .para:last-child > p {
|
156
|
-
margin-bottom: 0;
|
157
|
-
}
|
158
|
-
|
159
|
-
.sidebarblock .sidebar-title a {
|
160
|
-
text-decoration: none;
|
161
|
-
}
|
162
|
-
|
163
|
-
.sidebarblock .sidebar-title a:hover {
|
164
|
-
text-decoration: underline;
|
165
|
-
}
|
@@ -1,97 +0,0 @@
|
|
1
|
-
<%-
|
2
|
-
manuals_index_url = ENV['MANUALSONRAILS_INDEX_URL'] || "http://manuals.rubyonrails.org/"
|
3
|
-
show_toc = ENV['MANUALSONRAILS_TOC'] != 'no'
|
4
|
-
-%>
|
5
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
7
|
-
<head>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
9
|
-
<title><%- if multi_page? && !is_preamble? -%><%=h current_chapter.plain_title %> :: <% end %><%=h title %></title>
|
10
|
-
<!--[if lt IE 8]>
|
11
|
-
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
|
12
|
-
<![endif]-->
|
13
|
-
<link href="http://manuals.rubyonrails.org/stylesheets/base.css" media="screen" rel="Stylesheet" type="text/css" />
|
14
|
-
<link href="http://manuals.rubyonrails.org/stylesheets/forms.css" media="screen" rel="Stylesheet" type="text/css" />
|
15
|
-
<link href="http://manuals.rubyonrails.org/stylesheets/more.css" media="screen" rel="Stylesheet" type="text/css" />
|
16
|
-
<style type="text/css">
|
17
|
-
<%= include_file('manualsonrails.css') %>
|
18
|
-
</style>
|
19
|
-
</head>
|
20
|
-
<body>
|
21
|
-
<div id="header" <% if !show_toc %> class="notoc"<% end %>>
|
22
|
-
<div id="logo">
|
23
|
-
<a href="http://www.rubyonrails.org/" title="Ruby on Rails"><img src="http://web.rubyonrails.com/images/rails_logo_remix.gif" alt="Rails" height="140" width="110" /></a>
|
24
|
-
</div>
|
25
|
-
|
26
|
-
<h1 id="site_title"><span>Ruby on Rails</span></h1>
|
27
|
-
<h2 id="site_title_tagline">Sustainable productivity for web-application development</h2>
|
28
|
-
|
29
|
-
<ul id="navMain">
|
30
|
-
<li class="first-child"><a href="http://www.rubyonrails.org/" title="Ruby on Rails" class="ruby_on_rails">Ruby on Rails</a></li>
|
31
|
-
<li><a class="manuals" href="<%=h manuals_index_url %>" title="Manuals Index">Manuals Index</a></li>
|
32
|
-
</ul>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="container"<% if !show_toc %> class="notoc"<% end %>>
|
36
|
-
<% if show_toc %>
|
37
|
-
<div id="sidebar">
|
38
|
-
<h2>Chapters</h2>
|
39
|
-
<%- if multi_page? -%>
|
40
|
-
<a href="<%=h chapters.first.basename %>">Preamble</a>
|
41
|
-
<%- end -%>
|
42
|
-
<ol>
|
43
|
-
<%- if multi_page? -%>
|
44
|
-
<%- for heading in table_of_contents -%>
|
45
|
-
<li>
|
46
|
-
<a href="<%=h heading.basename %>"><%= heading.title_without_numbers %></a>
|
47
|
-
<%- if !heading.children.empty? -%>
|
48
|
-
<ul>
|
49
|
-
<% for h in heading.children %>
|
50
|
-
<li><a href="<%=h h.basename %><%=h h.anchor %>"><%= h.title_without_numbers %></a></li>
|
51
|
-
<% end %>
|
52
|
-
</ul>
|
53
|
-
<%- end -%>
|
54
|
-
</li>
|
55
|
-
<%- end -%>
|
56
|
-
<%- else -%>
|
57
|
-
<%- for heading in table_of_contents -%>
|
58
|
-
<li>
|
59
|
-
<a href="<%=h heading.anchor %>"><%= heading.title_without_numbers %></a>
|
60
|
-
<%- if !heading.children.empty? -%>
|
61
|
-
<ul>
|
62
|
-
<% for h in heading.children %>
|
63
|
-
<li><a href="<%=h h.anchor %>"><%= h.title_without_numbers %></a></li>
|
64
|
-
<% end %>
|
65
|
-
</ul>
|
66
|
-
<%- end -%>
|
67
|
-
</li>
|
68
|
-
<%- end -%>
|
69
|
-
<%- end -%>
|
70
|
-
</ol>
|
71
|
-
</div>
|
72
|
-
<% end %>
|
73
|
-
<div id="content">
|
74
|
-
<%- if multi_page? && !is_preamble? -%>
|
75
|
-
<h2 id="<%=h current_chapter.anchor_id %>"><%= current_chapter.title %></h2>
|
76
|
-
<%- else -%>
|
77
|
-
<h1><%=h title %></h1>
|
78
|
-
<%- end -%>
|
79
|
-
<%= contents %>
|
80
|
-
<%- if multi_page? -%>
|
81
|
-
<div id="chapter_navigation">
|
82
|
-
<%- if prev_chapter -%>
|
83
|
-
<div class="left-floaty">
|
84
|
-
<a href="<%=h prev_chapter.basename %>">« <%= prev_chapter.title %></a>
|
85
|
-
</div>
|
86
|
-
<%- end -%>
|
87
|
-
<%- if next_chapter -%>
|
88
|
-
<div class="right-floaty">
|
89
|
-
<a href="<%=h next_chapter.basename %>"><%= next_chapter.title %> »</a>
|
90
|
-
</div>
|
91
|
-
<%- end -%>
|
92
|
-
</div>
|
93
|
-
<%- end -%>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
</body>
|
97
|
-
</html>
|