org-ruby 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +12 -0
- data/Rakefile +3 -5
- data/announcement.txt +24 -0
- data/doc/History_txt.html +272 -0
- data/doc/OrgRuby.html +149 -0
- data/doc/Orgmode.html +960 -0
- data/doc/Orgmode/Headline.html +522 -0
- data/doc/Orgmode/HtmlOutputBuffer.html +480 -0
- data/doc/Orgmode/Line.html +1251 -0
- data/doc/Orgmode/OutputBuffer.html +810 -0
- data/doc/Orgmode/Parser.html +852 -0
- data/doc/Orgmode/RegexpHelper.html +639 -0
- data/doc/Orgmode/TextileOutputBuffer.html +456 -0
- data/doc/README_rdoc.html +178 -0
- data/doc/announcement_txt.html +142 -0
- data/doc/bin/org-ruby.html +54 -0
- data/doc/created.rid +15 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +306 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/org-ruby/headline_rb.html +52 -0
- data/doc/lib/org-ruby/html_output_buffer_rb.html +52 -0
- data/doc/lib/org-ruby/html_symbol_replace_rb.html +54 -0
- data/doc/lib/org-ruby/line_rb.html +52 -0
- data/doc/lib/org-ruby/output_buffer_rb.html +54 -0
- data/doc/lib/org-ruby/parser_rb.html +56 -0
- data/doc/lib/org-ruby/regexp_helper_rb.html +54 -0
- data/doc/lib/org-ruby/textile_output_buffer_rb.html +54 -0
- data/doc/lib/org-ruby/textile_symbol_replace_rb.html +54 -0
- data/doc/lib/org-ruby_rb.html +52 -0
- data/doc/rdoc.css +763 -0
- data/lib/org-ruby.rb +1 -1
- data/lib/org-ruby/headline.rb +2 -2
- data/lib/org-ruby/html_output_buffer.rb +62 -5
- data/lib/org-ruby/html_symbol_replace.rb +345 -0
- data/lib/org-ruby/line.rb +20 -9
- data/lib/org-ruby/output_buffer.rb +8 -1
- data/lib/org-ruby/parser.rb +47 -19
- data/lib/org-ruby/regexp_helper.rb +16 -0
- data/lib/org-ruby/textile_output_buffer.rb +37 -2
- data/lib/org-ruby/textile_symbol_replace.rb +345 -0
- data/org-ruby.gemspec +41 -0
- data/spec/headline_spec.rb +5 -0
- data/spec/html_examples/advanced-code.html +10 -0
- data/spec/html_examples/advanced-code.org +13 -0
- data/spec/html_examples/blockcomment.html +3 -0
- data/spec/html_examples/blockcomment.org +15 -0
- data/spec/html_examples/center.html +6 -0
- data/spec/html_examples/center.org +7 -0
- data/spec/html_examples/deflist.html +6 -0
- data/spec/html_examples/deflist.org +6 -0
- data/spec/html_examples/footnotes.html +10 -0
- data/spec/html_examples/footnotes.org +7 -0
- data/spec/html_examples/inline-formatting.html +8 -0
- data/spec/html_examples/inline-formatting.org +10 -0
- data/spec/html_examples/inline-images.html +1 -1
- data/spec/html_examples/lists.html +4 -0
- data/spec/html_examples/lists.org +11 -0
- data/spec/html_examples/subsupscript-nil.html +3 -0
- data/spec/html_examples/subsupscript-nil.org +6 -0
- data/spec/html_examples/subsupscript.html +3 -0
- data/spec/html_examples/subsupscript.org +5 -0
- data/spec/html_examples/tables.html +15 -0
- data/spec/html_examples/tables.org +24 -0
- data/spec/line_spec.rb +17 -13
- data/spec/spec_helper.rb +1 -2
- data/spec/textile_examples/center.org +7 -0
- data/spec/textile_examples/center.textile +6 -0
- data/spec/textile_examples/footnotes.org +7 -0
- data/spec/textile_examples/footnotes.textile +8 -0
- data/spec/textile_examples/tables.org +24 -0
- data/spec/textile_examples/tables.textile +17 -0
- data/util/gen-special-replace.el +37 -0
- metadata +111 -19
- data/.gitignore +0 -1
@@ -0,0 +1,810 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: Orgmode::OutputBuffer</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="../index.html">Home</a>
|
25
|
+
<a href="../index.html#classes">Classes</a>
|
26
|
+
<a href="../index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="../lib/org-ruby/output_buffer_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/org-ruby/output_buffer.rb">lib/org-ruby/output_buffer.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link">Object</p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-c-new">::new</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-i-3C-3C">#<<</a></li>
|
71
|
+
|
72
|
+
<li><a href="#method-i-clear_accumulation_buffer-21">#clear_accumulation_buffer!</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-current_mode">#current_mode</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-current_mode_list-3F">#current_mode_list?</a></li>
|
77
|
+
|
78
|
+
<li><a href="#method-i-enter_table-3F">#enter_table?</a></li>
|
79
|
+
|
80
|
+
<li><a href="#method-i-exit_table-3F">#exit_table?</a></li>
|
81
|
+
|
82
|
+
<li><a href="#method-i-get_next_headline_number">#get_next_headline_number</a></li>
|
83
|
+
|
84
|
+
<li><a href="#method-i-list_indent_level">#list_indent_level</a></li>
|
85
|
+
|
86
|
+
<li><a href="#method-i-pop_mode">#pop_mode</a></li>
|
87
|
+
|
88
|
+
<li><a href="#method-i-prepare">#prepare</a></li>
|
89
|
+
|
90
|
+
<li><a href="#method-i-preserve_whitespace-3F">#preserve_whitespace?</a></li>
|
91
|
+
|
92
|
+
<li><a href="#method-i-push_mode">#push_mode</a></li>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<div id="project-metadata">
|
102
|
+
|
103
|
+
|
104
|
+
<div id="fileindex-section" class="section project-section">
|
105
|
+
<h3 class="section-header">Files</h3>
|
106
|
+
<ul>
|
107
|
+
|
108
|
+
<li class="file"><a href="../History_txt.html">History.txt</a></li>
|
109
|
+
|
110
|
+
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
111
|
+
|
112
|
+
<li class="file"><a href="../announcement_txt.html">announcement.txt</a></li>
|
113
|
+
|
114
|
+
</ul>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
<div id="classindex-section" class="section project-section">
|
119
|
+
<h3 class="section-header">Class/Module Index
|
120
|
+
<span class="search-toggle"><img src="../images/find.png"
|
121
|
+
height="16" width="16" alt="[+]"
|
122
|
+
title="show/hide quicksearch" /></span></h3>
|
123
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
124
|
+
<fieldset>
|
125
|
+
<legend>Quicksearch</legend>
|
126
|
+
<input type="text" name="quicksearch" value=""
|
127
|
+
class="quicksearch-field" />
|
128
|
+
</fieldset>
|
129
|
+
</form>
|
130
|
+
|
131
|
+
<ul class="link-list">
|
132
|
+
|
133
|
+
<li><a href="../Orgmode.html">Orgmode</a></li>
|
134
|
+
|
135
|
+
<li><a href="../Orgmode/Headline.html">Orgmode::Headline</a></li>
|
136
|
+
|
137
|
+
<li><a href="../Orgmode/HtmlOutputBuffer.html">Orgmode::HtmlOutputBuffer</a></li>
|
138
|
+
|
139
|
+
<li><a href="../Orgmode/Line.html">Orgmode::Line</a></li>
|
140
|
+
|
141
|
+
<li><a href="../Orgmode/OutputBuffer.html">Orgmode::OutputBuffer</a></li>
|
142
|
+
|
143
|
+
<li><a href="../Orgmode/Parser.html">Orgmode::Parser</a></li>
|
144
|
+
|
145
|
+
<li><a href="../Orgmode/RegexpHelper.html">Orgmode::RegexpHelper</a></li>
|
146
|
+
|
147
|
+
<li><a href="../Orgmode/TextileOutputBuffer.html">Orgmode::TextileOutputBuffer</a></li>
|
148
|
+
|
149
|
+
<li><a href="../OrgRuby.html">OrgRuby</a></li>
|
150
|
+
|
151
|
+
</ul>
|
152
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<div id="documentation">
|
160
|
+
<h1 class="class">Orgmode::OutputBuffer</h1>
|
161
|
+
|
162
|
+
<div id="description" class="description">
|
163
|
+
|
164
|
+
<p>The <a href="OutputBuffer.html">OutputBuffer</a> is used to accumulate
|
165
|
+
multiple lines of orgmode text, and then emit them to the output all in one
|
166
|
+
go. The class will do the final textile substitution for inline formatting
|
167
|
+
and add a newline character prior emitting the output.</p>
|
168
|
+
|
169
|
+
</div><!-- description -->
|
170
|
+
|
171
|
+
|
172
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<!-- Constants -->
|
179
|
+
<div id="constants-list" class="section">
|
180
|
+
<h3 class="section-header">Constants</h3>
|
181
|
+
<dl>
|
182
|
+
|
183
|
+
<dt><a name="Modes">Modes</a></dt>
|
184
|
+
|
185
|
+
<dd class="description"></dd>
|
186
|
+
|
187
|
+
|
188
|
+
</dl>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<!-- Attributes -->
|
194
|
+
<div id="attribute-method-details" class="method-section section">
|
195
|
+
<h3 class="section-header">Attributes</h3>
|
196
|
+
|
197
|
+
|
198
|
+
<div id="buffer-attribute-method" class="method-detail">
|
199
|
+
<a name="buffer"></a>
|
200
|
+
|
201
|
+
<div class="method-heading attribute-method-heading">
|
202
|
+
<span class="method-name">buffer</span><span
|
203
|
+
class="attribute-access-type">[R]</span>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-description">
|
207
|
+
|
208
|
+
<p>This is the accumulation buffer. It’s a holding pen so consecutive lines
|
209
|
+
of the right type can get stuck together without intervening newlines.</p>
|
210
|
+
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div id="buffer_mode-attribute-method" class="method-detail">
|
215
|
+
<a name="buffer_mode"></a>
|
216
|
+
|
217
|
+
<div class="method-heading attribute-method-heading">
|
218
|
+
<span class="method-name">buffer_mode</span><span
|
219
|
+
class="attribute-access-type">[R]</span>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div class="method-description">
|
223
|
+
|
224
|
+
<p>This is the output mode of the accumulation buffer.</p>
|
225
|
+
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
<div id="buffered_lines-attribute-method" class="method-detail">
|
230
|
+
<a name="buffered_lines"></a>
|
231
|
+
|
232
|
+
<div class="method-heading attribute-method-heading">
|
233
|
+
<span class="method-name">buffered_lines</span><span
|
234
|
+
class="attribute-access-type">[R]</span>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div class="method-description">
|
238
|
+
|
239
|
+
<p>These are the <a href="Line.html">Line</a> objects that are currently in
|
240
|
+
the accumulation buffer.</p>
|
241
|
+
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
<div id="headline_number_stack-attribute-method" class="method-detail">
|
246
|
+
<a name="headline_number_stack"></a>
|
247
|
+
|
248
|
+
<a name="headline_number_stack="></a>
|
249
|
+
|
250
|
+
<div class="method-heading attribute-method-heading">
|
251
|
+
<span class="method-name">headline_number_stack</span><span
|
252
|
+
class="attribute-access-type">[RW]</span>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
<div class="method-description">
|
256
|
+
|
257
|
+
<p>This stack is used to do proper outline numbering of headlines.</p>
|
258
|
+
|
259
|
+
</div>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div id="output-attribute-method" class="method-detail">
|
263
|
+
<a name="output"></a>
|
264
|
+
|
265
|
+
<div class="method-heading attribute-method-heading">
|
266
|
+
<span class="method-name">output</span><span
|
267
|
+
class="attribute-access-type">[R]</span>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
<div class="method-description">
|
271
|
+
|
272
|
+
<p>This is the overall output buffer</p>
|
273
|
+
|
274
|
+
</div>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div id="output_type-attribute-method" class="method-detail">
|
278
|
+
<a name="output_type"></a>
|
279
|
+
|
280
|
+
<a name="output_type="></a>
|
281
|
+
|
282
|
+
<div class="method-heading attribute-method-heading">
|
283
|
+
<span class="method-name">output_type</span><span
|
284
|
+
class="attribute-access-type">[RW]</span>
|
285
|
+
</div>
|
286
|
+
|
287
|
+
<div class="method-description">
|
288
|
+
|
289
|
+
<p>This is the current type of output being accumulated.</p>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
</div><!-- attribute-method-details -->
|
295
|
+
|
296
|
+
|
297
|
+
<!-- Methods -->
|
298
|
+
|
299
|
+
<div id="public-class-method-details" class="method-section section">
|
300
|
+
<h3 class="section-header">Public Class Methods</h3>
|
301
|
+
|
302
|
+
|
303
|
+
<div id="new-method" class="method-detail ">
|
304
|
+
<a name="method-c-new"></a>
|
305
|
+
|
306
|
+
|
307
|
+
<div class="method-heading">
|
308
|
+
<span class="method-name">new</span><span
|
309
|
+
class="method-args">(output)</span>
|
310
|
+
<span class="method-click-advice">click to toggle source</span>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
<div class="method-description">
|
315
|
+
|
316
|
+
<p>Creates a new <a href="OutputBuffer.html">OutputBuffer</a> object that is
|
317
|
+
bound to an output object. The output will get flushed to =output=.</p>
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
<div class="method-source-code" id="new-source">
|
322
|
+
<pre>
|
323
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 34</span>
|
324
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">output</span>)
|
325
|
+
<span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
|
326
|
+
<span class="ruby-ivar">@buffer</span> = <span class="ruby-string">""</span>
|
327
|
+
<span class="ruby-ivar">@buffered_lines</span> = []
|
328
|
+
<span class="ruby-ivar">@buffer_mode</span> = <span class="ruby-keyword">nil</span>
|
329
|
+
<span class="ruby-ivar">@output_type</span> = <span class="ruby-value">:start</span>
|
330
|
+
<span class="ruby-ivar">@list_indent_stack</span> = []
|
331
|
+
<span class="ruby-ivar">@paragraph_modifier</span> = <span class="ruby-keyword">nil</span>
|
332
|
+
<span class="ruby-ivar">@cancel_modifier</span> = <span class="ruby-keyword">false</span>
|
333
|
+
<span class="ruby-ivar">@mode_stack</span> = []
|
334
|
+
<span class="ruby-ivar">@headline_number_stack</span> = []
|
335
|
+
|
336
|
+
<span class="ruby-ivar">@logger</span> = <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">STDERR</span>)
|
337
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">'DEBUG'</span>] <span class="ruby-keyword">or</span> <span class="ruby-identifier">$DEBUG</span>
|
338
|
+
<span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
|
339
|
+
<span class="ruby-keyword">else</span>
|
340
|
+
<span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">WARN</span>
|
341
|
+
<span class="ruby-keyword">end</span>
|
342
|
+
|
343
|
+
<span class="ruby-ivar">@re_help</span> = <span class="ruby-constant">RegexpHelper</span>.<span class="ruby-identifier">new</span>
|
344
|
+
<span class="ruby-identifier">push_mode</span>(<span class="ruby-value">:normal</span>)
|
345
|
+
<span class="ruby-keyword">end</span></pre>
|
346
|
+
</div><!-- new-source -->
|
347
|
+
|
348
|
+
</div>
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
</div><!-- new-method -->
|
354
|
+
|
355
|
+
|
356
|
+
</div><!-- public-class-method-details -->
|
357
|
+
|
358
|
+
<div id="public-instance-method-details" class="method-section section">
|
359
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
360
|
+
|
361
|
+
|
362
|
+
<div id="3C-3C-method" class="method-detail ">
|
363
|
+
<a name="method-i-3C-3C"></a>
|
364
|
+
|
365
|
+
|
366
|
+
<div class="method-heading">
|
367
|
+
<span class="method-name"><<</span><span
|
368
|
+
class="method-args">(str)</span>
|
369
|
+
<span class="method-click-advice">click to toggle source</span>
|
370
|
+
</div>
|
371
|
+
|
372
|
+
|
373
|
+
<div class="method-description">
|
374
|
+
|
375
|
+
<p>Accumulate the string @str@.</p>
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
<div class="method-source-code" id="3C-3C-source">
|
380
|
+
<pre>
|
381
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 133</span>
|
382
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">str</span>)
|
383
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_mode</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@buffer_mode</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">current_mode</span> <span class="ruby-keyword">then</span>
|
384
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Accumulation buffer is mixing modes: @buffer_mode == #{@buffer_mode}, current_mode == #{current_mode}"</span>
|
385
|
+
<span class="ruby-keyword">else</span>
|
386
|
+
<span class="ruby-ivar">@buffer_mode</span> = <span class="ruby-identifier">current_mode</span>
|
387
|
+
<span class="ruby-keyword">end</span>
|
388
|
+
<span class="ruby-ivar">@buffer</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">str</span>
|
389
|
+
<span class="ruby-keyword">end</span></pre>
|
390
|
+
</div><!-- 3C-3C-source -->
|
391
|
+
|
392
|
+
</div>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
</div><!-- 3C-3C-method -->
|
398
|
+
|
399
|
+
|
400
|
+
<div id="clear_accumulation_buffer-21-method" class="method-detail ">
|
401
|
+
<a name="method-i-clear_accumulation_buffer-21"></a>
|
402
|
+
|
403
|
+
|
404
|
+
<div class="method-heading">
|
405
|
+
<span class="method-name">clear_accumulation_buffer!</span><span
|
406
|
+
class="method-args">()</span>
|
407
|
+
<span class="method-click-advice">click to toggle source</span>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
|
411
|
+
<div class="method-description">
|
412
|
+
|
413
|
+
<p>Flushes everything currently in the accumulation buffer into the output
|
414
|
+
buffer. Derived classes must override this to actually move content into
|
415
|
+
the output buffer with the appropriate markup. This method just does common
|
416
|
+
bookkeeping cleanup.</p>
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
<div class="method-source-code" id="clear_accumulation_buffer-21-source">
|
421
|
+
<pre>
|
422
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 98</span>
|
423
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">clear_accumulation_buffer!</span>
|
424
|
+
<span class="ruby-ivar">@buffer</span> = <span class="ruby-string">""</span>
|
425
|
+
<span class="ruby-ivar">@buffer_mode</span> = <span class="ruby-keyword">nil</span>
|
426
|
+
<span class="ruby-ivar">@buffered_lines</span> = []
|
427
|
+
<span class="ruby-keyword">end</span></pre>
|
428
|
+
</div><!-- clear_accumulation_buffer-21-source -->
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
</div><!-- clear_accumulation_buffer-21-method -->
|
436
|
+
|
437
|
+
|
438
|
+
<div id="current_mode-method" class="method-detail ">
|
439
|
+
<a name="method-i-current_mode"></a>
|
440
|
+
|
441
|
+
|
442
|
+
<div class="method-heading">
|
443
|
+
<span class="method-name">current_mode</span><span
|
444
|
+
class="method-args">()</span>
|
445
|
+
<span class="method-click-advice">click to toggle source</span>
|
446
|
+
</div>
|
447
|
+
|
448
|
+
|
449
|
+
<div class="method-description">
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
<div class="method-source-code" id="current_mode-source">
|
456
|
+
<pre>
|
457
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 59</span>
|
458
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">current_mode</span>
|
459
|
+
<span class="ruby-ivar">@mode_stack</span>.<span class="ruby-identifier">last</span>
|
460
|
+
<span class="ruby-keyword">end</span></pre>
|
461
|
+
</div><!-- current_mode-source -->
|
462
|
+
|
463
|
+
</div>
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
</div><!-- current_mode-method -->
|
469
|
+
|
470
|
+
|
471
|
+
<div id="current_mode_list-3F-method" class="method-detail ">
|
472
|
+
<a name="method-i-current_mode_list-3F"></a>
|
473
|
+
|
474
|
+
|
475
|
+
<div class="method-heading">
|
476
|
+
<span class="method-name">current_mode_list?</span><span
|
477
|
+
class="method-args">()</span>
|
478
|
+
<span class="method-click-advice">click to toggle source</span>
|
479
|
+
</div>
|
480
|
+
|
481
|
+
|
482
|
+
<div class="method-description">
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
<div class="method-source-code" id="current_mode_list-3F-source">
|
489
|
+
<pre>
|
490
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 63</span>
|
491
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">current_mode_list?</span>
|
492
|
+
(<span class="ruby-identifier">current_mode</span> <span class="ruby-operator">==</span> <span class="ruby-value">:ordered_list</span>) <span class="ruby-keyword">or</span> (<span class="ruby-identifier">current_mode</span> <span class="ruby-operator">==</span> <span class="ruby-value">:unordered_list</span>)
|
493
|
+
<span class="ruby-keyword">end</span></pre>
|
494
|
+
</div><!-- current_mode_list-3F-source -->
|
495
|
+
|
496
|
+
</div>
|
497
|
+
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
</div><!-- current_mode_list-3F-method -->
|
502
|
+
|
503
|
+
|
504
|
+
<div id="enter_table-3F-method" class="method-detail ">
|
505
|
+
<a name="method-i-enter_table-3F"></a>
|
506
|
+
|
507
|
+
|
508
|
+
<div class="method-heading">
|
509
|
+
<span class="method-name">enter_table?</span><span
|
510
|
+
class="method-args">()</span>
|
511
|
+
<span class="method-click-advice">click to toggle source</span>
|
512
|
+
</div>
|
513
|
+
|
514
|
+
|
515
|
+
<div class="method-description">
|
516
|
+
|
517
|
+
<p>Tests if we are entering a table mode.</p>
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
<div class="method-source-code" id="enter_table-3F-source">
|
522
|
+
<pre>
|
523
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 121</span>
|
524
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">enter_table?</span>
|
525
|
+
((<span class="ruby-ivar">@output_type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:table_row</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@output_type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:table_header</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@output_type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:table_separator</span>)) <span class="ruby-operator">&&</span>
|
526
|
+
(<span class="ruby-identifier">current_mode</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:table</span>)
|
527
|
+
<span class="ruby-keyword">end</span></pre>
|
528
|
+
</div><!-- enter_table-3F-source -->
|
529
|
+
|
530
|
+
</div>
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
</div><!-- enter_table-3F-method -->
|
536
|
+
|
537
|
+
|
538
|
+
<div id="exit_table-3F-method" class="method-detail ">
|
539
|
+
<a name="method-i-exit_table-3F"></a>
|
540
|
+
|
541
|
+
|
542
|
+
<div class="method-heading">
|
543
|
+
<span class="method-name">exit_table?</span><span
|
544
|
+
class="method-args">()</span>
|
545
|
+
<span class="method-click-advice">click to toggle source</span>
|
546
|
+
</div>
|
547
|
+
|
548
|
+
|
549
|
+
<div class="method-description">
|
550
|
+
|
551
|
+
<p>Tests if we are existing a table mode.</p>
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
<div class="method-source-code" id="exit_table-3F-source">
|
556
|
+
<pre>
|
557
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 127</span>
|
558
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exit_table?</span>
|
559
|
+
((<span class="ruby-ivar">@output_type</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:table_row</span>) <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@output_type</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:table_header</span>) <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@output_type</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:table_separator</span>)) <span class="ruby-operator">&&</span>
|
560
|
+
(<span class="ruby-identifier">current_mode</span> <span class="ruby-operator">==</span> <span class="ruby-value">:table</span>)
|
561
|
+
<span class="ruby-keyword">end</span></pre>
|
562
|
+
</div><!-- exit_table-3F-source -->
|
563
|
+
|
564
|
+
</div>
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
</div><!-- exit_table-3F-method -->
|
570
|
+
|
571
|
+
|
572
|
+
<div id="get_next_headline_number-method" class="method-detail ">
|
573
|
+
<a name="method-i-get_next_headline_number"></a>
|
574
|
+
|
575
|
+
|
576
|
+
<div class="method-heading">
|
577
|
+
<span class="method-name">get_next_headline_number</span><span
|
578
|
+
class="method-args">(level)</span>
|
579
|
+
<span class="method-click-advice">click to toggle source</span>
|
580
|
+
</div>
|
581
|
+
|
582
|
+
|
583
|
+
<div class="method-description">
|
584
|
+
|
585
|
+
<p>Gets the next headline number for a given level. The intent is this
|
586
|
+
function is called sequentially for each headline that needs to get
|
587
|
+
numbered. It does standard outline numbering.</p>
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
<div class="method-source-code" id="get_next_headline_number-source">
|
592
|
+
<pre>
|
593
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 107</span>
|
594
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_next_headline_number</span>(<span class="ruby-identifier">level</span>)
|
595
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Headline level not valid: #{level}"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">level</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
596
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">level</span> <span class="ruby-operator">></span> <span class="ruby-ivar">@headline_number_stack</span>.<span class="ruby-identifier">length</span> <span class="ruby-keyword">do</span>
|
597
|
+
<span class="ruby-ivar">@headline_number_stack</span>.<span class="ruby-identifier">push</span> <span class="ruby-value">0</span>
|
598
|
+
<span class="ruby-keyword">end</span>
|
599
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">level</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@headline_number_stack</span>.<span class="ruby-identifier">length</span> <span class="ruby-keyword">do</span>
|
600
|
+
<span class="ruby-ivar">@headline_number_stack</span>.<span class="ruby-identifier">pop</span>
|
601
|
+
<span class="ruby-keyword">end</span>
|
602
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Oops, shouldn't happen"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">level</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@headline_number_stack</span>.<span class="ruby-identifier">length</span>
|
603
|
+
<span class="ruby-ivar">@headline_number_stack</span>[<span class="ruby-ivar">@headline_number_stack</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
604
|
+
<span class="ruby-ivar">@headline_number_stack</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"."</span>)
|
605
|
+
<span class="ruby-keyword">end</span></pre>
|
606
|
+
</div><!-- get_next_headline_number-source -->
|
607
|
+
|
608
|
+
</div>
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
</div><!-- get_next_headline_number-method -->
|
614
|
+
|
615
|
+
|
616
|
+
<div id="list_indent_level-method" class="method-detail ">
|
617
|
+
<a name="method-i-list_indent_level"></a>
|
618
|
+
|
619
|
+
|
620
|
+
<div class="method-heading">
|
621
|
+
<span class="method-name">list_indent_level</span><span
|
622
|
+
class="method-args">()</span>
|
623
|
+
<span class="method-click-advice">click to toggle source</span>
|
624
|
+
</div>
|
625
|
+
|
626
|
+
|
627
|
+
<div class="method-description">
|
628
|
+
|
629
|
+
<p>Gets the current list indent level.</p>
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
<div class="method-source-code" id="list_indent_level-source">
|
634
|
+
<pre>
|
635
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 143</span>
|
636
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">list_indent_level</span>
|
637
|
+
<span class="ruby-ivar">@list_indent_stack</span>.<span class="ruby-identifier">length</span>
|
638
|
+
<span class="ruby-keyword">end</span></pre>
|
639
|
+
</div><!-- list_indent_level-source -->
|
640
|
+
|
641
|
+
</div>
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
</div><!-- list_indent_level-method -->
|
647
|
+
|
648
|
+
|
649
|
+
<div id="pop_mode-method" class="method-detail ">
|
650
|
+
<a name="method-i-pop_mode"></a>
|
651
|
+
|
652
|
+
|
653
|
+
<div class="method-heading">
|
654
|
+
<span class="method-name">pop_mode</span><span
|
655
|
+
class="method-args">(mode = nil)</span>
|
656
|
+
<span class="method-click-advice">click to toggle source</span>
|
657
|
+
</div>
|
658
|
+
|
659
|
+
|
660
|
+
<div class="method-description">
|
661
|
+
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
<div class="method-source-code" id="pop_mode-source">
|
667
|
+
<pre>
|
668
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 72</span>
|
669
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pop_mode</span>(<span class="ruby-identifier">mode</span> = <span class="ruby-keyword">nil</span>)
|
670
|
+
<span class="ruby-identifier">m</span> = <span class="ruby-ivar">@mode_stack</span>.<span class="ruby-identifier">pop</span>
|
671
|
+
<span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">"Modes don't match. Expected to pop #{mode}, but popped #{m}"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mode</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">mode</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">m</span>
|
672
|
+
<span class="ruby-identifier">m</span>
|
673
|
+
<span class="ruby-keyword">end</span></pre>
|
674
|
+
</div><!-- pop_mode-source -->
|
675
|
+
|
676
|
+
</div>
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
</div><!-- pop_mode-method -->
|
682
|
+
|
683
|
+
|
684
|
+
<div id="prepare-method" class="method-detail ">
|
685
|
+
<a name="method-i-prepare"></a>
|
686
|
+
|
687
|
+
|
688
|
+
<div class="method-heading">
|
689
|
+
<span class="method-name">prepare</span><span
|
690
|
+
class="method-args">(line)</span>
|
691
|
+
<span class="method-click-advice">click to toggle source</span>
|
692
|
+
</div>
|
693
|
+
|
694
|
+
|
695
|
+
<div class="method-description">
|
696
|
+
|
697
|
+
<p>Prepares the output buffer to receive content from a line. As a side
|
698
|
+
effect, this may flush the current accumulated text.</p>
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
<div class="method-source-code" id="prepare-source">
|
703
|
+
<pre>
|
704
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 80</span>
|
705
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">prepare</span>(<span class="ruby-identifier">line</span>)
|
706
|
+
<span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"Looking at #{line.paragraph_type}: #{line.to_s}"</span>
|
707
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">should_accumulate_output?</span>(<span class="ruby-identifier">line</span>) <span class="ruby-keyword">then</span>
|
708
|
+
<span class="ruby-identifier">flush!</span>
|
709
|
+
<span class="ruby-identifier">maintain_list_indent_stack</span>(<span class="ruby-identifier">line</span>)
|
710
|
+
<span class="ruby-ivar">@output_type</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">paragraph_type</span>
|
711
|
+
<span class="ruby-keyword">end</span>
|
712
|
+
<span class="ruby-identifier">push_mode</span>(<span class="ruby-value">:inline_example</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">inline_example?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">current_mode</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:inline_example</span>
|
713
|
+
<span class="ruby-identifier">pop_mode</span>(<span class="ruby-value">:inline_example</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">current_mode</span> <span class="ruby-operator">==</span> <span class="ruby-value">:inline_example</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">line</span>.<span class="ruby-identifier">inline_example?</span>
|
714
|
+
<span class="ruby-identifier">push_mode</span>(<span class="ruby-value">:table</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">enter_table?</span>
|
715
|
+
<span class="ruby-identifier">pop_mode</span>(<span class="ruby-value">:table</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">exit_table?</span>
|
716
|
+
<span class="ruby-ivar">@buffered_lines</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">line</span>)
|
717
|
+
<span class="ruby-keyword">end</span></pre>
|
718
|
+
</div><!-- prepare-source -->
|
719
|
+
|
720
|
+
</div>
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
</div><!-- prepare-method -->
|
726
|
+
|
727
|
+
|
728
|
+
<div id="preserve_whitespace-3F-method" class="method-detail ">
|
729
|
+
<a name="method-i-preserve_whitespace-3F"></a>
|
730
|
+
|
731
|
+
|
732
|
+
<div class="method-heading">
|
733
|
+
<span class="method-name">preserve_whitespace?</span><span
|
734
|
+
class="method-args">()</span>
|
735
|
+
<span class="method-click-advice">click to toggle source</span>
|
736
|
+
</div>
|
737
|
+
|
738
|
+
|
739
|
+
<div class="method-description">
|
740
|
+
|
741
|
+
<p>Test if we’re in an output mode in which whitespace is significant.</p>
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
<div class="method-source-code" id="preserve_whitespace-3F-source">
|
746
|
+
<pre>
|
747
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 148</span>
|
748
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">preserve_whitespace?</span>
|
749
|
+
<span class="ruby-identifier">mode_is_code</span> <span class="ruby-identifier">current_mode</span>
|
750
|
+
<span class="ruby-keyword">end</span></pre>
|
751
|
+
</div><!-- preserve_whitespace-3F-source -->
|
752
|
+
|
753
|
+
</div>
|
754
|
+
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
</div><!-- preserve_whitespace-3F-method -->
|
759
|
+
|
760
|
+
|
761
|
+
<div id="push_mode-method" class="method-detail ">
|
762
|
+
<a name="method-i-push_mode"></a>
|
763
|
+
|
764
|
+
|
765
|
+
<div class="method-heading">
|
766
|
+
<span class="method-name">push_mode</span><span
|
767
|
+
class="method-args">(mode)</span>
|
768
|
+
<span class="method-click-advice">click to toggle source</span>
|
769
|
+
</div>
|
770
|
+
|
771
|
+
|
772
|
+
<div class="method-description">
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
|
777
|
+
|
778
|
+
<div class="method-source-code" id="push_mode-source">
|
779
|
+
<pre>
|
780
|
+
<span class="ruby-comment"># File lib/org-ruby/output_buffer.rb, line 67</span>
|
781
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">push_mode</span>(<span class="ruby-identifier">mode</span>)
|
782
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Not a recognized mode: #{mode}"</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Modes</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">mode</span>)
|
783
|
+
<span class="ruby-ivar">@mode_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">mode</span>)
|
784
|
+
<span class="ruby-keyword">end</span></pre>
|
785
|
+
</div><!-- push_mode-source -->
|
786
|
+
|
787
|
+
</div>
|
788
|
+
|
789
|
+
|
790
|
+
|
791
|
+
|
792
|
+
</div><!-- push_mode-method -->
|
793
|
+
|
794
|
+
|
795
|
+
</div><!-- public-instance-method-details -->
|
796
|
+
|
797
|
+
</div><!-- 5Buntitled-5D -->
|
798
|
+
|
799
|
+
|
800
|
+
</div><!-- documentation -->
|
801
|
+
|
802
|
+
<div id="validator-badges">
|
803
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
804
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
805
|
+
Rdoc Generator</a> 2</small>.</p>
|
806
|
+
</div>
|
807
|
+
|
808
|
+
</body>
|
809
|
+
</html>
|
810
|
+
|