erbook 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +13 -0
- data/README +14 -0
- data/Rakefile +77 -0
- data/bin/erbook +309 -0
- data/doc/HelloWorld.input +37 -0
- data/doc/HelloWorld.spec +62 -0
- data/doc/README +6 -0
- data/doc/api/classes/ERBook.html +164 -0
- data/doc/api/classes/RDoc.html +112 -0
- data/doc/api/classes/RDoc/AnyMethod.html +195 -0
- data/doc/api/classes/RDoc/AnyMethod.src/M000005.html +18 -0
- data/doc/api/classes/RDoc/AnyMethod.src/M000006.html +23 -0
- data/doc/api/classes/RDoc/AnyMethod.src/M000007.html +18 -0
- data/doc/api/classes/RDoc/AnyMethod.src/M000008.html +22 -0
- data/doc/api/classes/RDoc/TopLevel.html +250 -0
- data/doc/api/classes/RDoc/TopLevel.src/M000009.html +18 -0
- data/doc/api/classes/RDoc/TopLevel.src/M000010.html +18 -0
- data/doc/api/classes/RDoc/TopLevel.src/M000011.html +18 -0
- data/doc/api/classes/RDoc/TopLevel.src/M000012.html +29 -0
- data/doc/api/classes/RDoc/TopLevel.src/M000013.html +25 -0
- data/doc/api/classes/RDoc/TopLevel.src/M000014.html +18 -0
- data/doc/api/classes/String.html +261 -0
- data/doc/api/classes/String.src/M000001.html +18 -0
- data/doc/api/classes/String.src/M000002.html +34 -0
- data/doc/api/classes/String.src/M000003.html +20 -0
- data/doc/api/classes/String.src/M000004.html +26 -0
- data/doc/api/created.rid +1 -0
- data/doc/api/files/lib/erbook/html_rb.html +125 -0
- data/doc/api/files/lib/erbook/rdoc_rb.html +116 -0
- data/doc/api/files/lib/erbook_rb.html +107 -0
- data/doc/api/fr_class_index.html +31 -0
- data/doc/api/fr_file_index.html +29 -0
- data/doc/api/fr_method_index.html +40 -0
- data/doc/api/index.html +24 -0
- data/doc/api/rdoc-style.css +208 -0
- data/doc/erbook.png +0 -0
- data/doc/erbook.svg +349 -0
- data/doc/feed-icon-28x28.png +0 -0
- data/doc/index.html +2663 -0
- data/doc/manual.erb +769 -0
- data/fmt/html.icons/LICENSE +67 -0
- data/fmt/html.icons/README +31 -0
- data/fmt/html.icons/caution.png +0 -0
- data/fmt/html.icons/important.png +0 -0
- data/fmt/html.icons/note.png +0 -0
- data/fmt/html.icons/quote.png +0 -0
- data/fmt/html.icons/tip.png +0 -0
- data/fmt/html.icons/warning.png +0 -0
- data/fmt/html.yaml +1185 -0
- data/fmt/latex.yaml +2 -0
- data/fmt/man.yaml +2 -0
- data/fmt/text.yaml +2 -0
- data/lib/erbook.rb +13 -0
- data/lib/erbook/html.rb +145 -0
- data/lib/erbook/rdoc.rb +126 -0
- metadata +141 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>parse_file (RDoc::TopLevel)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/rdoc.rb, line 69</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse_file</span> <span class="ruby-identifier">aFileName</span>
|
15
|
+
<span class="ruby-identifier">parse</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">aFileName</span>), <span class="ruby-identifier">aFileName</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,261 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: String</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">String</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/erbook/html_rb.html">
|
59
|
+
lib/erbook/html.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000004">thru_coderay</a>
|
90
|
+
<a href="#M000003">thru_maruku</a>
|
91
|
+
<a href="#M000002">to_html</a>
|
92
|
+
<a href="#M000001">to_inline_html</a>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
<!-- if includes -->
|
100
|
+
|
101
|
+
<div id="section">
|
102
|
+
|
103
|
+
|
104
|
+
<div id="constants-list">
|
105
|
+
<h3 class="section-bar">Constants</h3>
|
106
|
+
|
107
|
+
<div class="name-list">
|
108
|
+
<table summary="Constants">
|
109
|
+
<tr class="top-aligned-row context-row">
|
110
|
+
<td class="context-item-name">PROTECTED_TAGS</td>
|
111
|
+
<td>=</td>
|
112
|
+
<td class="context-item-value">%w[tt code pre]</td>
|
113
|
+
<td width="3em"> </td>
|
114
|
+
<td class="context-item-desc">
|
115
|
+
The content of these HTML tags will be preserved while they are being
|
116
|
+
processed by Textile. By doing this, we avoid unwanted Textile
|
117
|
+
transformations, such as quotation marks becoming curly (&8192;), in
|
118
|
+
source code.
|
119
|
+
|
120
|
+
</td>
|
121
|
+
</tr>
|
122
|
+
<tr class="top-aligned-row context-row">
|
123
|
+
<td class="context-item-name">VERBATIM_TAGS</td>
|
124
|
+
<td>=</td>
|
125
|
+
<td class="context-item-value">%w[noformat]</td>
|
126
|
+
<td width="3em"> </td>
|
127
|
+
<td class="context-item-desc">
|
128
|
+
The content of these HTML tags will be preserved <b>verbatim</b> throughout
|
129
|
+
the text-to-HTML conversion process.
|
130
|
+
|
131
|
+
</td>
|
132
|
+
</tr>
|
133
|
+
</table>
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div id="aliases-list">
|
138
|
+
<h3 class="section-bar">External Aliases</h3>
|
139
|
+
|
140
|
+
<div class="name-list">
|
141
|
+
<table summary="aliases">
|
142
|
+
<tr class="top-aligned-row context-row">
|
143
|
+
<td class="context-item-name">to_html</td>
|
144
|
+
<td>-></td>
|
145
|
+
<td class="context-item-value">to_html_maruku</td>
|
146
|
+
</tr>
|
147
|
+
<tr class="top-aligned-row context-row">
|
148
|
+
<td> </td>
|
149
|
+
<td colspan="2" class="context-item-desc">
|
150
|
+
XXX: Maruku also defines <a href="String.html#M000002">String#to_html</a>
|
151
|
+
so we have to hack around it :-(
|
152
|
+
|
153
|
+
</td>
|
154
|
+
</tr>
|
155
|
+
</table>
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<!-- if method_list -->
|
164
|
+
<div id="methods">
|
165
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
166
|
+
|
167
|
+
<div id="method-M000004" class="method-detail">
|
168
|
+
<a name="M000004"></a>
|
169
|
+
|
170
|
+
<div class="method-heading">
|
171
|
+
<a href="String.src/M000004.html" target="Code" class="method-signature"
|
172
|
+
onclick="popupCode('String.src/M000004.html');return false;">
|
173
|
+
<span class="method-name">thru_coderay</span><span class="method-args">()</span>
|
174
|
+
</a>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
<p>
|
179
|
+
Adds syntax coloring to <code> elements in the given text. If the
|
180
|
+
<code> tag has an attribute lang="…", then that is
|
181
|
+
considered the programming language for which appropriate syntax coloring
|
182
|
+
should be applied. Otherwise, the programming language is assumed to be
|
183
|
+
ruby.
|
184
|
+
</p>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000003" class="method-detail">
|
189
|
+
<a name="M000003"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="String.src/M000003.html" target="Code" class="method-signature"
|
193
|
+
onclick="popupCode('String.src/M000003.html');return false;">
|
194
|
+
<span class="method-name">thru_maruku</span><span class="method-args">(aInline = false)</span>
|
195
|
+
</a>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div class="method-description">
|
199
|
+
<p>
|
200
|
+
Returns the result of running this string through Maruku.
|
201
|
+
</p>
|
202
|
+
<p>
|
203
|
+
If aInline is true, then the resulting HTML will <b>not</b> be wrapped in a
|
204
|
+
HTML paragraph element.
|
205
|
+
</p>
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
<div id="method-M000002" class="method-detail">
|
210
|
+
<a name="M000002"></a>
|
211
|
+
|
212
|
+
<div class="method-heading">
|
213
|
+
<a href="String.src/M000002.html" target="Code" class="method-signature"
|
214
|
+
onclick="popupCode('String.src/M000002.html');return false;">
|
215
|
+
<span class="method-name">to_html</span><span class="method-args">(aInline = false)</span>
|
216
|
+
</a>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div class="method-description">
|
220
|
+
<p>
|
221
|
+
Transforms this string into HTML while ensuring that the result contains
|
222
|
+
one or more block-level elements at the root.
|
223
|
+
</p>
|
224
|
+
<p>
|
225
|
+
If aInline is true, then the resulting HTML will be an <b>inline</b>
|
226
|
+
string.
|
227
|
+
</p>
|
228
|
+
</div>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div id="method-M000001" class="method-detail">
|
232
|
+
<a name="M000001"></a>
|
233
|
+
|
234
|
+
<div class="method-heading">
|
235
|
+
<a href="String.src/M000001.html" target="Code" class="method-signature"
|
236
|
+
onclick="popupCode('String.src/M000001.html');return false;">
|
237
|
+
<span class="method-name">to_inline_html</span><span class="method-args">()</span>
|
238
|
+
</a>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
<div class="method-description">
|
242
|
+
<p>
|
243
|
+
Transforms this string into an <b>inline</b> HTML string (one that does not
|
244
|
+
contain any block-level HTML elements at the root).
|
245
|
+
</p>
|
246
|
+
</div>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
<div id="validator-badges">
|
257
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
</body>
|
261
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_inline_html (String)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/html.rb, line 33</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_inline_html</span>
|
15
|
+
<span class="ruby-identifier">to_html</span> <span class="ruby-keyword kw">true</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_html (String)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/html.rb, line 45</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_html</span> <span class="ruby-identifier">aInline</span> = <span class="ruby-keyword kw">false</span>
|
15
|
+
<span class="ruby-comment cmt"># XXX: Maruku also defines String#to_html so we have to hack around it :-(</span>
|
16
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_html_maruku</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">detect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r'/lib/maruku/output/'</span> }
|
17
|
+
|
18
|
+
<span class="ruby-identifier">protect</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-constant">VERBATIM_TAGS</span>, <span class="ruby-keyword kw">true</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span><span class="ruby-operator">|</span>
|
19
|
+
<span class="ruby-identifier">html</span> = <span class="ruby-identifier">protect</span>(<span class="ruby-identifier">text</span>, <span class="ruby-constant">PROTECTED_TAGS</span>, <span class="ruby-keyword kw">false</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">thru_maruku</span> <span class="ruby-identifier">aInline</span> }
|
20
|
+
|
21
|
+
<span class="ruby-comment cmt"># Markdown's "code spans" should really be "pre spans"</span>
|
22
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{(<pre>)<code>(.*?)</code>(</pre>)}</span><span class="ruby-identifier">m</span>, <span class="ruby-value str">'\1\2\3'</span>
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
|
25
|
+
<span class="ruby-comment cmt"># ensure tables have a border: this *greatly* improves</span>
|
26
|
+
<span class="ruby-comment cmt"># readability in text-based web browsers like w3m and lynx</span>
|
27
|
+
<span class="ruby-identifier">html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r/<table\b/</span>, <span class="ruby-value str">'\& border="1"'</span>
|
28
|
+
|
29
|
+
<span class="ruby-comment cmt"># add syntax coloring</span>
|
30
|
+
<span class="ruby-identifier">html</span>.<span class="ruby-identifier">thru_coderay</span>
|
31
|
+
<span class="ruby-keyword kw">end</span>
|
32
|
+
<span class="ruby-keyword kw">end</span></pre>
|
33
|
+
</body>
|
34
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>thru_maruku (String)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/html.rb, line 70</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">thru_maruku</span> <span class="ruby-identifier">aInline</span> = <span class="ruby-keyword kw">false</span>
|
15
|
+
<span class="ruby-identifier">html</span> = <span class="ruby-constant">Maruku</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">to_html</span>
|
16
|
+
<span class="ruby-identifier">html</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-regexp re">%r{\A<p>(.*)</p>\Z}</span>, <span class="ruby-value str">'\1'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aInline</span>
|
17
|
+
<span class="ruby-identifier">html</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>thru_coderay (String)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/html.rb, line 80</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">thru_coderay</span>
|
15
|
+
<span class="ruby-identifier">gsub</span> <span class="ruby-regexp re">%r{<(code)(.*?)>(.*?)</\1>}</span><span class="ruby-identifier">m</span> <span class="ruby-keyword kw">do</span>
|
16
|
+
<span class="ruby-identifier">atts</span>, <span class="ruby-identifier">code</span> = <span class="ruby-identifier">$2</span>, <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">unescapeHTML</span>(<span class="ruby-identifier">$3</span>)
|
17
|
+
<span class="ruby-identifier">lang</span> = <span class="ruby-identifier">atts</span>[<span class="ruby-regexp re">/\blang=('|")(.*?)\1/i</span>, <span class="ruby-value">2</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">:ruby</span>
|
18
|
+
|
19
|
+
<span class="ruby-identifier">html</span> = <span class="ruby-constant">CodeRay</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">lang</span>).<span class="ruby-identifier">html</span>(<span class="ruby-identifier">:css</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:style</span>)
|
20
|
+
<span class="ruby-identifier">tag</span> = <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\n/</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">:pre</span> <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">:code</span> <span class="ruby-keyword kw">end</span>
|
21
|
+
|
22
|
+
<span class="ruby-node">%{<#{tag} class="code"#{atts}>#{html}</#{tag}>}</span>
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</html>
|
data/doc/api/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Sat, 15 Nov 2008 18:25:12 -0800
|
@@ -0,0 +1,125 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: html.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>html.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>lib/erbook/html.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Sat Nov 15 17:16:15 -0800 2008</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
This file defines the <a
|
74
|
+
href="../../../classes/String.html#M000002">String#to_html</a> and <a
|
75
|
+
href="../../../classes/String.html#M000001">String#to_inline_html</a>
|
76
|
+
methods, which are invoked to transform plain text into HTML.
|
77
|
+
</p>
|
78
|
+
<p>
|
79
|
+
This particular implementation features the Markdown formatting system via
|
80
|
+
Maruku, syntax coloring via CodeRay, and smart source code sizing (block
|
81
|
+
versus inline display).
|
82
|
+
</p>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<div id="requires-list">
|
87
|
+
<h3 class="section-bar">Required files</h3>
|
88
|
+
|
89
|
+
<div class="name-list">
|
90
|
+
cgi
|
91
|
+
rubygems
|
92
|
+
coderay
|
93
|
+
maruku
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if includes -->
|
104
|
+
|
105
|
+
<div id="section">
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<!-- if method_list -->
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
<div id="validator-badges">
|
121
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
</body>
|
125
|
+
</html>
|