asciidoctor-latex 1.5.0.2.dev → 1.5.0.3.dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +17 -0
- data/README.adoc +18 -4
- data/doc/Asciidoctor.html +131 -0
- data/doc/Asciidoctor/Block.html +1700 -0
- data/doc/Asciidoctor/Converter/Html5Converter.html +120 -0
- data/doc/Asciidoctor/Document.html +327 -0
- data/doc/Asciidoctor/Inline.html +594 -0
- data/doc/Asciidoctor/LaTeX.html +167 -0
- data/doc/Asciidoctor/LaTeX/Chem.html +210 -0
- data/doc/Asciidoctor/LaTeX/ChemInlineMacro.html +194 -0
- data/doc/Asciidoctor/LaTeX/ClickBlock.html +344 -0
- data/doc/Asciidoctor/LaTeX/ClickStyleInsert.html +283 -0
- data/doc/Asciidoctor/LaTeX/Converter.html +321 -0
- data/doc/Asciidoctor/LaTeX/Dollar.html +203 -0
- data/doc/Asciidoctor/LaTeX/EntToUni.html +194 -0
- data/doc/Asciidoctor/LaTeX/EnvironmentBlock.html +420 -0
- data/doc/Asciidoctor/LaTeX/HTMLPostprocessor.html +204 -0
- data/doc/Asciidoctor/LaTeX/Html5ConverterExtensions.html +905 -0
- data/doc/Asciidoctor/LaTeX/InjectHTML.html +192 -0
- data/doc/Asciidoctor/LaTeX/MacroInsert.html +300 -0
- data/doc/Asciidoctor/LaTeX/TeXBlock.html +644 -0
- data/doc/Asciidoctor/LaTeX/TeXPostProcess.html +504 -0
- data/doc/Asciidoctor/LaTeX/TeXPreprocessor.html +287 -0
- data/doc/Asciidoctor/LaTeX/TexPostprocessor.html +209 -0
- data/doc/Asciidoctor/List.html +483 -0
- data/doc/Asciidoctor/Section.html +219 -0
- data/doc/Asciidoctor/Table.html +227 -0
- data/doc/PreambleProcessor.html +202 -0
- data/doc/String.html +587 -0
- data/doc/_index.html +382 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.LICENSE.html +96 -0
- data/doc/file.README.html +335 -0
- data/doc/file.manual.html +479 -0
- data/doc/file_list.html +63 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +335 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +549 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/asciidoctor/latex/converter.rb +2 -4
- data/lib/asciidoctor/latex/tex_preprocessor.rb +19 -4
- data/lib/asciidoctor/latex/version.rb +1 -1
- data/test/examples/adoc/exponent1.adoc +2 -0
- data/test/examples/adoc/exponent2.adoc +4 -0
- data/test/examples/adoc/macro_underscore.adoc +5 -0
- data/test/examples/adoc/math.adoc +2 -2
- metadata +51 -29
- data/rspec/README.adoc +0 -45
- data/rspec/a.rb +0 -79
- data/rspec/b.rb +0 -111
- data/rspec/c.rb +0 -121
- data/rspec/data/tex1 +0 -65
- data/rspec/data/tex2 +0 -5
- data/rspec/data/tex2.expect +0 -5
- data/rspec/transform.rb +0 -36
- data/spec/README.adoc +0 -45
- data/spec/a.rb +0 -79
- data/spec/b.rb +0 -111
- data/spec/c.rb +0 -121
- data/spec/data/foo +0 -1
- data/spec/data/lorem +0 -1
- data/spec/data/tex1 +0 -65
- data/spec/data/tex2 +0 -5
- data/spec/data/tex2.expect +0 -5
- data/spec/transform.rb +0 -36
@@ -0,0 +1,194 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Asciidoctor::LaTeX::EntToUni
|
8
|
+
|
9
|
+
— Asciidoctor LaTeX Documentation
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!Asciidoctor/LaTeX/EntToUni.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (E)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Asciidoctor.html" title="Asciidoctor (module)">Asciidoctor</a></span></span> » <span class='title'><span class='object_link'><a href="../LaTeX.html" title="Asciidoctor::LaTeX (module)">LaTeX</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">EntToUni</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Asciidoctor::LaTeX::EntToUni
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Extensions::Postprocessor</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Extensions::Postprocessor</li>
|
82
|
+
|
83
|
+
<li class="next">Asciidoctor::LaTeX::EntToUni</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/asciidoctor/latex/ent_to_uni.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>
|
113
|
+
Instance Method Summary
|
114
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
115
|
+
</h2>
|
116
|
+
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#process-instance_method" title="#process (instance method)">- (Object) <strong>process</strong>(document, output) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
</ul>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<div id="instance_method_details" class="method_details_list">
|
148
|
+
<h2>Instance Method Details</h2>
|
149
|
+
|
150
|
+
|
151
|
+
<div class="method_details first">
|
152
|
+
<h3 class="signature first" id="process-instance_method">
|
153
|
+
|
154
|
+
- (<tt>Object</tt>) <strong>process</strong>(document, output)
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</h3><table class="source_code">
|
161
|
+
<tr>
|
162
|
+
<td>
|
163
|
+
<pre class="lines">
|
164
|
+
|
165
|
+
|
166
|
+
11
|
167
|
+
12
|
168
|
+
13
|
169
|
+
14</pre>
|
170
|
+
</td>
|
171
|
+
<td>
|
172
|
+
<pre class="code"><span class="info file"># File 'lib/asciidoctor/latex/ent_to_uni.rb', line 11</span>
|
173
|
+
|
174
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span> <span class='id identifier rubyid_document'>document</span><span class='comma'>,</span> <span class='id identifier rubyid_output'>output</span>
|
175
|
+
<span class='id identifier rubyid_coder'>coder</span> <span class='op'>=</span> <span class='const'>HTMLEntities</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
176
|
+
<span class='id identifier rubyid_coder'>coder</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span> <span class='id identifier rubyid_output'>output</span>
|
177
|
+
<span class='kw'>end</span></pre>
|
178
|
+
</td>
|
179
|
+
</tr>
|
180
|
+
</table>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div id="footer">
|
188
|
+
Generated on Sun Apr 19 18:37:45 2015 by
|
189
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
190
|
+
0.8.7.6 (ruby-2.1.2).
|
191
|
+
</div>
|
192
|
+
|
193
|
+
</body>
|
194
|
+
</html>
|
@@ -0,0 +1,420 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Asciidoctor::LaTeX::EnvironmentBlock
|
8
|
+
|
9
|
+
— Asciidoctor LaTeX Documentation
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!Asciidoctor/LaTeX/EnvironmentBlock.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (E)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Asciidoctor.html" title="Asciidoctor (module)">Asciidoctor</a></span></span> » <span class='title'><span class='object_link'><a href="../LaTeX.html" title="Asciidoctor::LaTeX (module)">LaTeX</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">EnvironmentBlock</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Asciidoctor::LaTeX::EnvironmentBlock
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Extensions::BlockProcessor</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Extensions::BlockProcessor</li>
|
82
|
+
|
83
|
+
<li class="next">Asciidoctor::LaTeX::EnvironmentBlock</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/asciidoctor/latex/environment_block.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>
|
113
|
+
Instance Method Summary
|
114
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
115
|
+
</h2>
|
116
|
+
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#process-instance_method" title="#process (instance method)">- (Object) <strong>process</strong>(parent, reader, attrs) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'>
|
137
|
+
<p>parse_context_as :complex ^^^ The above line gave me an error.</p>
|
138
|
+
</div></span>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
</ul>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<div id="instance_method_details" class="method_details_list">
|
150
|
+
<h2>Instance Method Details</h2>
|
151
|
+
|
152
|
+
|
153
|
+
<div class="method_details first">
|
154
|
+
<h3 class="signature first" id="process-instance_method">
|
155
|
+
|
156
|
+
- (<tt>Object</tt>) <strong>process</strong>(parent, reader, attrs)
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</h3><div class="docstring">
|
163
|
+
<div class="discussion">
|
164
|
+
|
165
|
+
<p>parse_context_as :complex ^^^ The above line gave me an error. I'm not
|
166
|
+
sure what do to with it.</p>
|
167
|
+
|
168
|
+
|
169
|
+
</div>
|
170
|
+
</div>
|
171
|
+
<div class="tags">
|
172
|
+
|
173
|
+
|
174
|
+
</div><table class="source_code">
|
175
|
+
<tr>
|
176
|
+
<td>
|
177
|
+
<pre class="lines">
|
178
|
+
|
179
|
+
|
180
|
+
96
|
181
|
+
97
|
182
|
+
98
|
183
|
+
99
|
184
|
+
100
|
185
|
+
101
|
186
|
+
102
|
187
|
+
103
|
188
|
+
104
|
189
|
+
105
|
190
|
+
106
|
191
|
+
107
|
192
|
+
108
|
193
|
+
109
|
194
|
+
110
|
195
|
+
111
|
196
|
+
112
|
197
|
+
113
|
198
|
+
114
|
199
|
+
115
|
200
|
+
116
|
201
|
+
117
|
202
|
+
118
|
203
|
+
119
|
204
|
+
120
|
205
|
+
121
|
206
|
+
122
|
207
|
+
123
|
208
|
+
124
|
209
|
+
125
|
210
|
+
126
|
211
|
+
127
|
212
|
+
128
|
213
|
+
129
|
214
|
+
130
|
215
|
+
131
|
216
|
+
132
|
217
|
+
133
|
218
|
+
134
|
219
|
+
135
|
220
|
+
136
|
221
|
+
137
|
222
|
+
138
|
223
|
+
139
|
224
|
+
140
|
225
|
+
141
|
226
|
+
142
|
227
|
+
143
|
228
|
+
144
|
229
|
+
145
|
230
|
+
146
|
231
|
+
147
|
232
|
+
148
|
233
|
+
149
|
234
|
+
150
|
235
|
+
151
|
236
|
+
152
|
237
|
+
153
|
238
|
+
154
|
239
|
+
155
|
240
|
+
156
|
241
|
+
157
|
242
|
+
158
|
243
|
+
159
|
244
|
+
160
|
245
|
+
161
|
246
|
+
162
|
247
|
+
163
|
248
|
+
164
|
249
|
+
165
|
250
|
+
166
|
251
|
+
167
|
252
|
+
168
|
253
|
+
169
|
254
|
+
170
|
255
|
+
171
|
256
|
+
172
|
257
|
+
173
|
258
|
+
174
|
259
|
+
175
|
260
|
+
176
|
261
|
+
177
|
262
|
+
178
|
263
|
+
179
|
264
|
+
180
|
265
|
+
181
|
266
|
+
182
|
267
|
+
183
|
268
|
+
184
|
269
|
+
185
|
270
|
+
186
|
271
|
+
187
|
272
|
+
188
|
273
|
+
189
|
274
|
+
190
|
275
|
+
191
|
276
|
+
192
|
277
|
+
193
|
278
|
+
194
|
279
|
+
195
|
280
|
+
196
|
281
|
+
197
|
282
|
+
198
|
283
|
+
199
|
284
|
+
200
|
285
|
+
201
|
286
|
+
202
|
287
|
+
203
|
288
|
+
204
|
289
|
+
205</pre>
|
290
|
+
</td>
|
291
|
+
<td>
|
292
|
+
<pre class="code"><span class="info file"># File 'lib/asciidoctor/latex/environment_block.rb', line 96</span>
|
293
|
+
|
294
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span> <span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_reader'>reader</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span>
|
295
|
+
|
296
|
+
<span class='id identifier rubyid_original_title'>original_title</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
297
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>original_title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
298
|
+
|
299
|
+
<span class='comment'># Ensure that role is defined
|
300
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>role</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>nil</span>
|
301
|
+
<span class='id identifier rubyid_role'>role</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>item</span><span class='tstring_end'>'</span></span>
|
302
|
+
<span class='kw'>else</span>
|
303
|
+
<span class='id identifier rubyid_role'>role</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>role</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
304
|
+
<span class='kw'>end</span>
|
305
|
+
|
306
|
+
<span class='comment'># fixme: this should not be necessary
|
307
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>role</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\\</span><span class='regexp_end'>/</span></span>
|
308
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>role</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>role</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\\</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
309
|
+
<span class='kw'>end</span>
|
310
|
+
|
311
|
+
<span class='comment'># Determine whether the block is numbered
|
312
|
+
</span> <span class='comment'># Use the option set if present (numbered, no+_number) otherwise
|
313
|
+
</span> <span class='comment'># use a default value, e.g. 'box' is not numbered, the others are numbered
|
314
|
+
</span> <span class='kw'>if</span> <span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>options</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>no_number|numbered</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
315
|
+
<span class='kw'>if</span> <span class='qwords_beg'>%w(</span><span class='tstring_content'>box</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_role'>role</span>
|
316
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>options</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>no_number</span><span class='tstring_end'>'</span></span>
|
317
|
+
<span class='kw'>else</span>
|
318
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>options</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>numbered</span><span class='tstring_end'>'</span></span>
|
319
|
+
<span class='kw'>end</span>
|
320
|
+
<span class='kw'>end</span>
|
321
|
+
|
322
|
+
|
323
|
+
<span class='comment'># Adjust title according to environment name
|
324
|
+
</span> <span class='id identifier rubyid_env_name'>env_name</span> <span class='op'>=</span> <span class='id identifier rubyid_role'>role</span> <span class='comment'># roles.first # FIXME: roles.first is probably best
|
325
|
+
</span> <span class='kw'>if</span> <span class='qwords_beg'>%w(</span><span class='tstring_content'>equation</span><span class='words_sep'> </span><span class='tstring_content'>equationalign</span><span class='words_sep'> </span><span class='tstring_content'>chem</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_role'>role</span>
|
326
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_env_name'>env_name</span>
|
327
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_role'>role</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>code</span><span class='tstring_end'>'</span></span>
|
328
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Listing</span><span class='tstring_end'>'</span></span>
|
329
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_role'>role</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>jsxgraph</span><span class='tstring_end'>'</span></span>
|
330
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>JSXGraph</span><span class='tstring_end'>'</span></span>
|
331
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_role'>role</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>box</span><span class='tstring_end'>'</span></span>
|
332
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
333
|
+
<span class='kw'>else</span>
|
334
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_env_name'>env_name</span><span class='period'>.</span><span class='id identifier rubyid_capitalize'>capitalize</span>
|
335
|
+
<span class='kw'>end</span>
|
336
|
+
<span class='id identifier rubyid_env_title'>env_title</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
337
|
+
|
338
|
+
|
339
|
+
<span class='comment'># Creat the block
|
340
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>role</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>code</span><span class='tstring_end'>'</span></span>
|
341
|
+
<span class='id identifier rubyid_block'>block</span> <span class='op'>=</span> <span class='id identifier rubyid_create_block'>create_block</span> <span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='symbol'>:listing</span><span class='comma'>,</span> <span class='id identifier rubyid_reader'>reader</span><span class='period'>.</span><span class='id identifier rubyid_lines'>lines</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span>
|
342
|
+
<span class='kw'>else</span>
|
343
|
+
<span class='id identifier rubyid_block'>block</span> <span class='op'>=</span> <span class='id identifier rubyid_create_block'>create_block</span> <span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='symbol'>:environment</span><span class='comma'>,</span> <span class='id identifier rubyid_reader'>reader</span><span class='period'>.</span><span class='id identifier rubyid_lines'>lines</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span>
|
344
|
+
<span class='kw'>end</span>
|
345
|
+
|
346
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>options</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>numbered</span><span class='regexp_end'>/</span></span>
|
347
|
+
<span class='comment'># THE NUMBERED OPTION
|
348
|
+
</span> <span class='comment'># Use same prefix for cross referencing for the
|
349
|
+
</span> <span class='comment'># equation_align environment as for the equation
|
350
|
+
</span> <span class='comment'># environment so as not to have separate numbering
|
351
|
+
</span> <span class='comment'># sequences
|
352
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_env_name'>env_name</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>equationalign</span><span class='tstring_end'>'</span></span>
|
353
|
+
<span class='id identifier rubyid_env_ref_prefix'>env_ref_prefix</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>equation</span><span class='tstring_end'>'</span></span>
|
354
|
+
<span class='kw'>else</span>
|
355
|
+
<span class='id identifier rubyid_env_ref_prefix'>env_ref_prefix</span> <span class='op'>=</span> <span class='id identifier rubyid_env_name'>env_name</span>
|
356
|
+
<span class='kw'>end</span>
|
357
|
+
<span class='comment'># Define caption_num so that we can make references
|
358
|
+
</span> <span class='comment'># that display as "(17)", for example
|
359
|
+
</span> <span class='comment'># This is where we can set the caption number by hand
|
360
|
+
</span> <span class='comment'># once I figure out how to do so.
|
361
|
+
</span> <span class='id identifier rubyid_caption_num'>caption_num</span> <span class='op'>=</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_document'>document</span><span class='period'>.</span><span class='id identifier rubyid_counter_increment'>counter_increment</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_env_ref_prefix'>env_ref_prefix</span><span class='embexpr_end'>}</span><span class='tstring_content'>-number</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
362
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>caption-num</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_caption_num'>caption_num</span>
|
363
|
+
<span class='id identifier rubyid_caption'>caption</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_caption_num'>caption_num</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
364
|
+
<span class='comment'># Set the title, e.g., "Theorem 3: Pythagoras" or just "Theorem 3"
|
365
|
+
</span> <span class='comment'># depending on whether the user sets a title, .e.g, ".Pythgoras"
|
366
|
+
</span> <span class='comment'># in the line preceding "[env.theorem]"
|
367
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_original_title'>original_title</span>
|
368
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_env_title'>env_title</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_caption_num'>caption_num</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_original_title'>original_title</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
369
|
+
<span class='kw'>else</span>
|
370
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_env_title'>env_title</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_caption_num'>caption_num</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
371
|
+
<span class='kw'>end</span>
|
372
|
+
<span class='kw'>else</span>
|
373
|
+
<span class='comment'># THE NON-NUMBERED OPTION
|
374
|
+
</span> <span class='comment'># Set the title, e.g., "Pythagoras" or just "Theorem"
|
375
|
+
</span> <span class='comment'># depending on whether the user sets a title, .e.g, ".Pythgoras"
|
376
|
+
</span> <span class='comment'># in the line preceding "[env.theorem]"
|
377
|
+
</span> <span class='comment'># FIXME: this code is a tad spaghetti-like
|
378
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_original_title'>original_title</span>
|
379
|
+
<span class='kw'>if</span> <span class='qwords_beg'>%w(</span><span class='tstring_content'>box</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_role'>role</span>
|
380
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_original_title'>original_title</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
381
|
+
<span class='kw'>else</span>
|
382
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_env_title'>env_title</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_original_title'>original_title</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
383
|
+
<span class='kw'>end</span>
|
384
|
+
<span class='kw'>else</span>
|
385
|
+
<span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_env_title'>env_title</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
386
|
+
<span class='kw'>end</span>
|
387
|
+
<span class='kw'>end</span>
|
388
|
+
|
389
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>role</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>code</span><span class='tstring_end'>'</span></span>
|
390
|
+
<span class='id identifier rubyid_caption'>caption</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
391
|
+
<span class='kw'>end</span>
|
392
|
+
|
393
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_assign_caption'>assign_caption</span> <span class='id identifier rubyid_caption'>caption</span>
|
394
|
+
<span class='kw'>if</span> <span class='qwords_beg'>%w(</span><span class='tstring_content'>equation</span><span class='words_sep'> </span><span class='tstring_content'>equationalign</span><span class='words_sep'> </span><span class='tstring_content'>chem</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_role'>role</span>
|
395
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_caption_num'>caption_num</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
396
|
+
<span class='kw'>elsif</span> <span class='qwords_beg'>%w(</span><span class='tstring_content'>box</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_role'>role</span>
|
397
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
398
|
+
<span class='kw'>else</span>
|
399
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
400
|
+
<span class='kw'>end</span>
|
401
|
+
<span class='id identifier rubyid_block'>block</span>
|
402
|
+
|
403
|
+
<span class='kw'>end</span></pre>
|
404
|
+
</td>
|
405
|
+
</tr>
|
406
|
+
</table>
|
407
|
+
</div>
|
408
|
+
|
409
|
+
</div>
|
410
|
+
|
411
|
+
</div>
|
412
|
+
|
413
|
+
<div id="footer">
|
414
|
+
Generated on Sun Apr 19 18:37:45 2015 by
|
415
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
416
|
+
0.8.7.6 (ruby-2.1.2).
|
417
|
+
</div>
|
418
|
+
|
419
|
+
</body>
|
420
|
+
</html>
|