org-ruby 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/.gitignore +2 -0
  2. data/Gemfile +8 -0
  3. data/Gemfile.lock +36 -0
  4. data/History.txt +9 -0
  5. data/README.rdoc +2 -1
  6. data/Rakefile +10 -10
  7. data/announcement.txt +7 -12
  8. data/lib/org-ruby.rb +1 -1
  9. data/lib/org-ruby/headline.rb +8 -0
  10. data/lib/org-ruby/html_output_buffer.rb +12 -1
  11. data/lib/org-ruby/line.rb +36 -2
  12. data/lib/org-ruby/output_buffer.rb +6 -3
  13. data/lib/org-ruby/parser.rb +25 -7
  14. data/lib/org-ruby/regexp_helper.rb +7 -5
  15. data/lib/org-ruby/textile_symbol_replace.rb +1 -0
  16. data/lib/org-ruby/tilt.rb +29 -0
  17. data/org-ruby.gemspec +19 -23
  18. data/spec/headline_spec.rb +5 -0
  19. data/spec/html_examples/advanced-code.html +53 -18
  20. data/spec/html_examples/advanced-code.org +40 -0
  21. data/spec/html_examples/comment-trees.html +4 -0
  22. data/spec/html_examples/comment-trees.org +13 -0
  23. data/spec/html_examples/horizontal_rule.html +4 -0
  24. data/spec/html_examples/horizontal_rule.org +5 -0
  25. data/spec/html_examples/inline-formatting.html +7 -0
  26. data/spec/html_examples/inline-formatting.org +16 -0
  27. data/spec/line_spec.rb +8 -1
  28. data/spec/parser_spec.rb +6 -0
  29. metadata +55 -118
  30. data/doc/History_txt.html +0 -272
  31. data/doc/OrgRuby.html +0 -149
  32. data/doc/Orgmode.html +0 -960
  33. data/doc/Orgmode/Headline.html +0 -522
  34. data/doc/Orgmode/HtmlOutputBuffer.html +0 -480
  35. data/doc/Orgmode/Line.html +0 -1251
  36. data/doc/Orgmode/OutputBuffer.html +0 -810
  37. data/doc/Orgmode/Parser.html +0 -852
  38. data/doc/Orgmode/RegexpHelper.html +0 -639
  39. data/doc/Orgmode/TextileOutputBuffer.html +0 -456
  40. data/doc/README_rdoc.html +0 -178
  41. data/doc/announcement_txt.html +0 -142
  42. data/doc/bin/org-ruby.html +0 -54
  43. data/doc/created.rid +0 -15
  44. data/doc/images/brick.png +0 -0
  45. data/doc/images/brick_link.png +0 -0
  46. data/doc/images/bug.png +0 -0
  47. data/doc/images/bullet_black.png +0 -0
  48. data/doc/images/bullet_toggle_minus.png +0 -0
  49. data/doc/images/bullet_toggle_plus.png +0 -0
  50. data/doc/images/date.png +0 -0
  51. data/doc/images/find.png +0 -0
  52. data/doc/images/loadingAnimation.gif +0 -0
  53. data/doc/images/macFFBgHack.png +0 -0
  54. data/doc/images/package.png +0 -0
  55. data/doc/images/page_green.png +0 -0
  56. data/doc/images/page_white_text.png +0 -0
  57. data/doc/images/page_white_width.png +0 -0
  58. data/doc/images/plugin.png +0 -0
  59. data/doc/images/ruby.png +0 -0
  60. data/doc/images/tag_green.png +0 -0
  61. data/doc/images/wrench.png +0 -0
  62. data/doc/images/wrench_orange.png +0 -0
  63. data/doc/images/zoom.png +0 -0
  64. data/doc/index.html +0 -306
  65. data/doc/js/darkfish.js +0 -116
  66. data/doc/js/jquery.js +0 -32
  67. data/doc/js/quicksearch.js +0 -114
  68. data/doc/js/thickbox-compressed.js +0 -10
  69. data/doc/lib/org-ruby/headline_rb.html +0 -52
  70. data/doc/lib/org-ruby/html_output_buffer_rb.html +0 -52
  71. data/doc/lib/org-ruby/html_symbol_replace_rb.html +0 -54
  72. data/doc/lib/org-ruby/line_rb.html +0 -52
  73. data/doc/lib/org-ruby/output_buffer_rb.html +0 -54
  74. data/doc/lib/org-ruby/parser_rb.html +0 -56
  75. data/doc/lib/org-ruby/regexp_helper_rb.html +0 -54
  76. data/doc/lib/org-ruby/textile_output_buffer_rb.html +0 -54
  77. data/doc/lib/org-ruby/textile_symbol_replace_rb.html +0 -54
  78. data/doc/lib/org-ruby_rb.html +0 -52
  79. data/doc/rdoc.css +0 -763
@@ -1,852 +0,0 @@
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::Parser</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/parser_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
- class="thickbox" title="lib/org-ruby/parser.rb">lib/org-ruby/parser.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-load">::load</a></li>
69
-
70
- <li><a href="#method-c-new">::new</a></li>
71
-
72
- <li><a href="#method-i-custom_keyword_regexp">#custom_keyword_regexp</a></li>
73
-
74
- <li><a href="#method-i-export_exclude_tags">#export_exclude_tags</a></li>
75
-
76
- <li><a href="#method-i-export_footnotes-3F">#export_footnotes?</a></li>
77
-
78
- <li><a href="#method-i-export_heading_number-3F">#export_heading_number?</a></li>
79
-
80
- <li><a href="#method-i-export_select_tags">#export_select_tags</a></li>
81
-
82
- <li><a href="#method-i-export_tables-3F">#export_tables?</a></li>
83
-
84
- <li><a href="#method-i-export_todo-3F">#export_todo?</a></li>
85
-
86
- <li><a href="#method-i-skip_header_lines-3F">#skip_header_lines?</a></li>
87
-
88
- <li><a href="#method-i-to_html">#to_html</a></li>
89
-
90
- <li><a href="#method-i-to_textile">#to_textile</a></li>
91
-
92
- <li><a href="#method-i-use_sub_superscripts-3F">#use_sub_superscripts?</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::Parser</h1>
161
-
162
- <div id="description" class="description">
163
-
164
- <p>Simple routines for loading / saving an ORG file.</p>
165
-
166
- </div><!-- description -->
167
-
168
-
169
- <div id="5Buntitled-5D" class="documentation-section">
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
- <!-- Attributes -->
178
- <div id="attribute-method-details" class="method-section section">
179
- <h3 class="section-header">Attributes</h3>
180
-
181
-
182
- <div id="custom_keywords-attribute-method" class="method-detail">
183
- <a name="custom_keywords"></a>
184
-
185
- <div class="method-heading attribute-method-heading">
186
- <span class="method-name">custom_keywords</span><span
187
- class="attribute-access-type">[R]</span>
188
- </div>
189
-
190
- <div class="method-description">
191
-
192
- <p>Array of custom keywords.</p>
193
-
194
- </div>
195
- </div>
196
-
197
- <div id="header_lines-attribute-method" class="method-detail">
198
- <a name="header_lines"></a>
199
-
200
- <div class="method-heading attribute-method-heading">
201
- <span class="method-name">header_lines</span><span
202
- class="attribute-access-type">[R]</span>
203
- </div>
204
-
205
- <div class="method-description">
206
-
207
- <p>These are any lines before the first headline</p>
208
-
209
- </div>
210
- </div>
211
-
212
- <div id="headlines-attribute-method" class="method-detail">
213
- <a name="headlines"></a>
214
-
215
- <div class="method-heading attribute-method-heading">
216
- <span class="method-name">headlines</span><span
217
- class="attribute-access-type">[R]</span>
218
- </div>
219
-
220
- <div class="method-description">
221
-
222
- <p>All of the headlines in the org file</p>
223
-
224
- </div>
225
- </div>
226
-
227
- <div id="in_buffer_settings-attribute-method" class="method-detail">
228
- <a name="in_buffer_settings"></a>
229
-
230
- <div class="method-heading attribute-method-heading">
231
- <span class="method-name">in_buffer_settings</span><span
232
- class="attribute-access-type">[R]</span>
233
- </div>
234
-
235
- <div class="method-description">
236
-
237
- <p>This contains any in-buffer settings from the org-mode file. See <a
238
- href="http://orgmode.org/manual/In_002dbuffer-settings.html#In_002dbuffer-settings">orgmode.org/manual/In_002dbuffer-settings.html#In_002dbuffer-settings</a></p>
239
-
240
- </div>
241
- </div>
242
-
243
- <div id="lines-attribute-method" class="method-detail">
244
- <a name="lines"></a>
245
-
246
- <div class="method-heading attribute-method-heading">
247
- <span class="method-name">lines</span><span
248
- class="attribute-access-type">[R]</span>
249
- </div>
250
-
251
- <div class="method-description">
252
-
253
- <p>All of the lines of the orgmode file</p>
254
-
255
- </div>
256
- </div>
257
-
258
- <div id="options-attribute-method" class="method-detail">
259
- <a name="options"></a>
260
-
261
- <div class="method-heading attribute-method-heading">
262
- <span class="method-name">options</span><span
263
- class="attribute-access-type">[R]</span>
264
- </div>
265
-
266
- <div class="method-description">
267
-
268
- <p>This contains in-buffer options; a special case of in-buffer settings.</p>
269
-
270
- </div>
271
- </div>
272
-
273
- </div><!-- attribute-method-details -->
274
-
275
-
276
- <!-- Methods -->
277
-
278
- <div id="public-class-method-details" class="method-section section">
279
- <h3 class="section-header">Public Class Methods</h3>
280
-
281
-
282
- <div id="load-method" class="method-detail ">
283
- <a name="method-c-load"></a>
284
-
285
-
286
- <div class="method-heading">
287
- <span class="method-name">load</span><span
288
- class="method-args">(fname)</span>
289
- <span class="method-click-advice">click to toggle source</span>
290
- </div>
291
-
292
-
293
- <div class="method-description">
294
-
295
- <p>Creates a new parser from the data in a given file</p>
296
-
297
-
298
-
299
- <div class="method-source-code" id="load-source">
300
- <pre>
301
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 161</span>
302
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">fname</span>)
303
- <span class="ruby-identifier">lines</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">readlines</span>(<span class="ruby-identifier">fname</span>)
304
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">lines</span>)
305
- <span class="ruby-keyword">end</span></pre>
306
- </div><!-- load-source -->
307
-
308
- </div>
309
-
310
-
311
-
312
-
313
- </div><!-- load-method -->
314
-
315
-
316
- <div id="new-method" class="method-detail ">
317
- <a name="method-c-new"></a>
318
-
319
-
320
- <div class="method-heading">
321
- <span class="method-name">new</span><span
322
- class="method-args">(lines, offset=0)</span>
323
- <span class="method-click-advice">click to toggle source</span>
324
- </div>
325
-
326
-
327
- <div class="method-description">
328
-
329
- <p>I can construct a parser object either with an array of lines or with a
330
- single string that I will split along n boundaries.</p>
331
-
332
-
333
-
334
- <div class="method-source-code" id="new-source">
335
- <pre>
336
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 85</span>
337
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-identifier">offset</span>=<span class="ruby-value">0</span>)
338
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span> <span class="ruby-keyword">then</span>
339
- <span class="ruby-ivar">@lines</span> = <span class="ruby-identifier">lines</span>
340
- <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span>
341
- <span class="ruby-ivar">@lines</span> = <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
342
- <span class="ruby-keyword">else</span>
343
- <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unsupported type for +lines+: #{lines.class}&quot;</span>
344
- <span class="ruby-keyword">end</span>
345
-
346
- <span class="ruby-ivar">@custom_keywords</span> = []
347
- <span class="ruby-ivar">@headlines</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
348
- <span class="ruby-ivar">@current_headline</span> = <span class="ruby-keyword">nil</span>
349
- <span class="ruby-ivar">@header_lines</span> = []
350
- <span class="ruby-ivar">@in_buffer_settings</span> = { }
351
- <span class="ruby-ivar">@options</span> = { }
352
- <span class="ruby-identifier">mode</span> = <span class="ruby-value">:normal</span>
353
- <span class="ruby-identifier">previous_line</span> = <span class="ruby-keyword">nil</span>
354
- <span class="ruby-identifier">table_header_set</span> = <span class="ruby-keyword">false</span>
355
- <span class="ruby-ivar">@lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
356
- <span class="ruby-keyword">case</span> <span class="ruby-identifier">mode</span>
357
- <span class="ruby-keyword">when</span> <span class="ruby-value">:normal</span>
358
-
359
- <span class="ruby-keyword">if</span> (<span class="ruby-constant">Headline</span>.<span class="ruby-identifier">headline?</span> <span class="ruby-identifier">line</span>) <span class="ruby-keyword">then</span>
360
- <span class="ruby-ivar">@current_headline</span> = <span class="ruby-constant">Headline</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">line</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">offset</span>
361
- <span class="ruby-ivar">@headlines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@current_headline</span>
362
- <span class="ruby-keyword">else</span>
363
- <span class="ruby-identifier">line</span> = <span class="ruby-constant">Line</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">line</span>, <span class="ruby-keyword">self</span>
364
- <span class="ruby-comment"># If there is a setting on this line, remember it.</span>
365
- <span class="ruby-identifier">line</span>.<span class="ruby-identifier">in_buffer_setting?</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
366
- <span class="ruby-identifier">store_in_buffer_setting</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>
367
- <span class="ruby-keyword">end</span>
368
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">table_separator?</span> <span class="ruby-keyword">then</span>
369
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">previous_line</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">previous_line</span>.<span class="ruby-identifier">paragraph_type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:table_row</span> <span class="ruby-keyword">and</span> <span class="ruby-operator">!</span><span class="ruby-identifier">table_header_set</span>
370
- <span class="ruby-identifier">previous_line</span>.<span class="ruby-identifier">assigned_paragraph_type</span> = <span class="ruby-value">:table_header</span>
371
- <span class="ruby-identifier">table_header_set</span> = <span class="ruby-keyword">true</span>
372
- <span class="ruby-keyword">end</span>
373
- <span class="ruby-keyword">end</span>
374
- <span class="ruby-identifier">table_header_set</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">line</span>.<span class="ruby-identifier">table?</span>
375
- <span class="ruby-identifier">mode</span> = <span class="ruby-value">:code</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">begin_block?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">block_type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;EXAMPLE&quot;</span>
376
- <span class="ruby-identifier">mode</span> = <span class="ruby-value">:block_comment</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">begin_block?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">block_type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;COMMENT&quot;</span>
377
- <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@current_headline</span>) <span class="ruby-keyword">then</span>
378
- <span class="ruby-ivar">@current_headline</span>.<span class="ruby-identifier">body_lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">line</span>
379
- <span class="ruby-keyword">else</span>
380
- <span class="ruby-ivar">@header_lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">line</span>
381
- <span class="ruby-keyword">end</span>
382
- <span class="ruby-keyword">end</span>
383
-
384
- <span class="ruby-keyword">when</span> <span class="ruby-value">:block_comment</span>
385
- <span class="ruby-identifier">line</span> = <span class="ruby-constant">Line</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">line</span>, <span class="ruby-keyword">self</span>
386
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">end_block?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">block_type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;COMMENT&quot;</span>
387
- <span class="ruby-identifier">mode</span> = <span class="ruby-value">:normal</span>
388
- <span class="ruby-keyword">else</span>
389
- <span class="ruby-identifier">line</span>.<span class="ruby-identifier">assigned_paragraph_type</span> = <span class="ruby-value">:comment</span>
390
- <span class="ruby-keyword">end</span>
391
-
392
- <span class="ruby-keyword">when</span> <span class="ruby-value">:code</span>
393
-
394
- <span class="ruby-comment"># As long as we stay in code mode, force lines to be either blank or paragraphs.</span>
395
- <span class="ruby-comment"># Don't try to interpret structural items, like headings and tables.</span>
396
- <span class="ruby-identifier">line</span> = <span class="ruby-constant">Line</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">line</span>, <span class="ruby-keyword">self</span>
397
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">end_block?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">block_type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;EXAMPLE&quot;</span>
398
- <span class="ruby-identifier">mode</span> = <span class="ruby-value">:normal</span>
399
- <span class="ruby-keyword">else</span>
400
- <span class="ruby-identifier">line</span>.<span class="ruby-identifier">assigned_paragraph_type</span> = <span class="ruby-value">:paragraph</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">blank?</span>
401
- <span class="ruby-keyword">end</span>
402
- <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@current_headline</span>) <span class="ruby-keyword">then</span>
403
- <span class="ruby-ivar">@current_headline</span>.<span class="ruby-identifier">body_lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">line</span>
404
- <span class="ruby-keyword">else</span>
405
- <span class="ruby-ivar">@header_lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">line</span>
406
- <span class="ruby-keyword">end</span>
407
- <span class="ruby-keyword">end</span> <span class="ruby-comment"># case</span>
408
- <span class="ruby-identifier">previous_line</span> = <span class="ruby-identifier">line</span>
409
- <span class="ruby-keyword">end</span> <span class="ruby-comment"># @lines.each</span>
410
- <span class="ruby-keyword">end</span></pre>
411
- </div><!-- new-source -->
412
-
413
- </div>
414
-
415
-
416
-
417
-
418
- </div><!-- new-method -->
419
-
420
-
421
- </div><!-- public-class-method-details -->
422
-
423
- <div id="public-instance-method-details" class="method-section section">
424
- <h3 class="section-header">Public Instance Methods</h3>
425
-
426
-
427
- <div id="custom_keyword_regexp-method" class="method-detail ">
428
- <a name="method-i-custom_keyword_regexp"></a>
429
-
430
-
431
- <div class="method-heading">
432
- <span class="method-name">custom_keyword_regexp</span><span
433
- class="method-args">()</span>
434
- <span class="method-click-advice">click to toggle source</span>
435
- </div>
436
-
437
-
438
- <div class="method-description">
439
-
440
- <p>Regexp that recognizes words in custom_keywords.</p>
441
-
442
-
443
-
444
- <div class="method-source-code" id="custom_keyword_regexp-source">
445
- <pre>
446
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 32</span>
447
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">custom_keyword_regexp</span>
448
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@custom_keywords</span>.<span class="ruby-identifier">empty?</span>
449
- <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;^(#{@custom_keywords.join('|')})\$&quot;</span>)
450
- <span class="ruby-keyword">end</span></pre>
451
- </div><!-- custom_keyword_regexp-source -->
452
-
453
- </div>
454
-
455
-
456
-
457
-
458
- </div><!-- custom_keyword_regexp-method -->
459
-
460
-
461
- <div id="export_exclude_tags-method" class="method-detail ">
462
- <a name="method-i-export_exclude_tags"></a>
463
-
464
-
465
- <div class="method-heading">
466
- <span class="method-name">export_exclude_tags</span><span
467
- class="method-args">()</span>
468
- <span class="method-click-advice">click to toggle source</span>
469
- </div>
470
-
471
-
472
- <div class="method-description">
473
-
474
- <p>A set of tags that, if present on any headlines in the org-file, means that
475
- subtree will not get exported.</p>
476
-
477
-
478
-
479
- <div class="method-source-code" id="export_exclude_tags-source">
480
- <pre>
481
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 46</span>
482
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">export_exclude_tags</span>
483
- <span class="ruby-keyword">return</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@in_buffer_settings</span>[<span class="ruby-string">&quot;EXPORT_EXCLUDE_TAGS&quot;</span>]
484
- <span class="ruby-ivar">@in_buffer_settings</span>[<span class="ruby-string">&quot;EXPORT_EXCLUDE_TAGS&quot;</span>].<span class="ruby-identifier">split</span>
485
- <span class="ruby-keyword">end</span></pre>
486
- </div><!-- export_exclude_tags-source -->
487
-
488
- </div>
489
-
490
-
491
-
492
-
493
- </div><!-- export_exclude_tags-method -->
494
-
495
-
496
- <div id="export_footnotes-3F-method" class="method-detail ">
497
- <a name="method-i-export_footnotes-3F"></a>
498
-
499
-
500
- <div class="method-heading">
501
- <span class="method-name">export_footnotes?</span><span
502
- class="method-args">()</span>
503
- <span class="method-click-advice">click to toggle source</span>
504
- </div>
505
-
506
-
507
- <div class="method-description">
508
-
509
- <p>Returns true if we are to export footnotes</p>
510
-
511
-
512
-
513
- <div class="method-source-code" id="export_footnotes-3F-source">
514
- <pre>
515
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 57</span>
516
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">export_footnotes?</span>
517
- <span class="ruby-string">&quot;t&quot;</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@options</span>[<span class="ruby-string">&quot;f&quot;</span>]
518
- <span class="ruby-keyword">end</span></pre>
519
- </div><!-- export_footnotes-3F-source -->
520
-
521
- </div>
522
-
523
-
524
-
525
-
526
- </div><!-- export_footnotes-3F-method -->
527
-
528
-
529
- <div id="export_heading_number-3F-method" class="method-detail ">
530
- <a name="method-i-export_heading_number-3F"></a>
531
-
532
-
533
- <div class="method-heading">
534
- <span class="method-name">export_heading_number?</span><span
535
- class="method-args">()</span>
536
- <span class="method-click-advice">click to toggle source</span>
537
- </div>
538
-
539
-
540
- <div class="method-description">
541
-
542
- <p>Returns true if we are to export heading numbers.</p>
543
-
544
-
545
-
546
- <div class="method-source-code" id="export_heading_number-3F-source">
547
- <pre>
548
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 62</span>
549
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">export_heading_number?</span>
550
- <span class="ruby-string">&quot;t&quot;</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@options</span>[<span class="ruby-string">&quot;num&quot;</span>]
551
- <span class="ruby-keyword">end</span></pre>
552
- </div><!-- export_heading_number-3F-source -->
553
-
554
- </div>
555
-
556
-
557
-
558
-
559
- </div><!-- export_heading_number-3F-method -->
560
-
561
-
562
- <div id="export_select_tags-method" class="method-detail ">
563
- <a name="method-i-export_select_tags"></a>
564
-
565
-
566
- <div class="method-heading">
567
- <span class="method-name">export_select_tags</span><span
568
- class="method-args">()</span>
569
- <span class="method-click-advice">click to toggle source</span>
570
- </div>
571
-
572
-
573
- <div class="method-description">
574
-
575
- <p>A set of tags that, if present on any headlines in the org-file, means only
576
- those headings will get exported.</p>
577
-
578
-
579
-
580
- <div class="method-source-code" id="export_select_tags-source">
581
- <pre>
582
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 39</span>
583
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">export_select_tags</span>
584
- <span class="ruby-keyword">return</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@in_buffer_settings</span>[<span class="ruby-string">&quot;EXPORT_SELECT_TAGS&quot;</span>]
585
- <span class="ruby-ivar">@in_buffer_settings</span>[<span class="ruby-string">&quot;EXPORT_SELECT_TAGS&quot;</span>].<span class="ruby-identifier">split</span>
586
- <span class="ruby-keyword">end</span></pre>
587
- </div><!-- export_select_tags-source -->
588
-
589
- </div>
590
-
591
-
592
-
593
-
594
- </div><!-- export_select_tags-method -->
595
-
596
-
597
- <div id="export_tables-3F-method" class="method-detail ">
598
- <a name="method-i-export_tables-3F"></a>
599
-
600
-
601
- <div class="method-heading">
602
- <span class="method-name">export_tables?</span><span
603
- class="method-args">()</span>
604
- <span class="method-click-advice">click to toggle source</span>
605
- </div>
606
-
607
-
608
- <div class="method-description">
609
-
610
- <p>Should we export tables? Defaults to true, must be overridden with an
611
- explicit “nil”</p>
612
-
613
-
614
-
615
- <div class="method-source-code" id="export_tables-3F-source">
616
- <pre>
617
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 73</span>
618
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">export_tables?</span>
619
- <span class="ruby-string">&quot;nil&quot;</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@options</span>[<span class="ruby-string">&quot;|&quot;</span>]
620
- <span class="ruby-keyword">end</span></pre>
621
- </div><!-- export_tables-3F-source -->
622
-
623
- </div>
624
-
625
-
626
-
627
-
628
- </div><!-- export_tables-3F-method -->
629
-
630
-
631
- <div id="export_todo-3F-method" class="method-detail ">
632
- <a name="method-i-export_todo-3F"></a>
633
-
634
-
635
- <div class="method-heading">
636
- <span class="method-name">export_todo?</span><span
637
- class="method-args">()</span>
638
- <span class="method-click-advice">click to toggle source</span>
639
- </div>
640
-
641
-
642
- <div class="method-description">
643
-
644
- <p>Returns true if we are to export todo keywords on headings.</p>
645
-
646
-
647
-
648
- <div class="method-source-code" id="export_todo-3F-source">
649
- <pre>
650
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 52</span>
651
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">export_todo?</span>
652
- <span class="ruby-string">&quot;t&quot;</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@options</span>[<span class="ruby-string">&quot;todo&quot;</span>]
653
- <span class="ruby-keyword">end</span></pre>
654
- </div><!-- export_todo-3F-source -->
655
-
656
- </div>
657
-
658
-
659
-
660
-
661
- </div><!-- export_todo-3F-method -->
662
-
663
-
664
- <div id="skip_header_lines-3F-method" class="method-detail ">
665
- <a name="method-i-skip_header_lines-3F"></a>
666
-
667
-
668
- <div class="method-heading">
669
- <span class="method-name">skip_header_lines?</span><span
670
- class="method-args">()</span>
671
- <span class="method-click-advice">click to toggle source</span>
672
- </div>
673
-
674
-
675
- <div class="method-description">
676
-
677
- <p>Should we skip exporting text before the first heading?</p>
678
-
679
-
680
-
681
- <div class="method-source-code" id="skip_header_lines-3F-source">
682
- <pre>
683
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 67</span>
684
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">skip_header_lines?</span>
685
- <span class="ruby-string">&quot;t&quot;</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@options</span>[<span class="ruby-string">&quot;skip&quot;</span>]
686
- <span class="ruby-keyword">end</span></pre>
687
- </div><!-- skip_header_lines-3F-source -->
688
-
689
- </div>
690
-
691
-
692
-
693
-
694
- </div><!-- skip_header_lines-3F-method -->
695
-
696
-
697
- <div id="to_html-method" class="method-detail ">
698
- <a name="method-i-to_html"></a>
699
-
700
-
701
- <div class="method-heading">
702
- <span class="method-name">to_html</span><span
703
- class="method-args">()</span>
704
- <span class="method-click-advice">click to toggle source</span>
705
- </div>
706
-
707
-
708
- <div class="method-description">
709
-
710
- <p>Converts the loaded org-mode file to HTML.</p>
711
-
712
-
713
-
714
- <div class="method-source-code" id="to_html-source">
715
- <pre>
716
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 177</span>
717
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_html</span>
718
- <span class="ruby-identifier">mark_trees_for_export</span>
719
- <span class="ruby-identifier">export_options</span> = {
720
- <span class="ruby-value">:decorate_title</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>,
721
- <span class="ruby-value">:export_heading_number</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">export_heading_number?</span>,
722
- <span class="ruby-value">:export_todo</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">export_todo?</span>,
723
- <span class="ruby-value">:use_sub_superscripts</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">use_sub_superscripts?</span>,
724
- <span class="ruby-value">:export_footnotes</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">export_footnotes?</span>
725
- }
726
- <span class="ruby-identifier">export_options</span>[<span class="ruby-value">:skip_tables</span>] = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">export_tables?</span>
727
- <span class="ruby-identifier">output</span> = <span class="ruby-string">&quot;&quot;</span>
728
- <span class="ruby-identifier">output_buffer</span> = <span class="ruby-constant">HtmlOutputBuffer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">export_options</span>)
729
-
730
- <span class="ruby-keyword">if</span> <span class="ruby-ivar">@in_buffer_settings</span>[<span class="ruby-string">&quot;TITLE&quot;</span>] <span class="ruby-keyword">then</span>
731
-
732
- <span class="ruby-comment"># If we're given a new title, then just create a new line</span>
733
- <span class="ruby-comment"># for that title.</span>
734
- <span class="ruby-identifier">title</span> = <span class="ruby-constant">Line</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@in_buffer_settings</span>[<span class="ruby-string">&quot;TITLE&quot;</span>], <span class="ruby-keyword">self</span>)
735
- <span class="ruby-constant">Parser</span>.<span class="ruby-identifier">translate</span>([<span class="ruby-identifier">title</span>], <span class="ruby-identifier">output_buffer</span>)
736
- <span class="ruby-keyword">end</span>
737
- <span class="ruby-constant">Parser</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-ivar">@header_lines</span>, <span class="ruby-identifier">output_buffer</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">skip_header_lines?</span>
738
-
739
- <span class="ruby-comment"># If we've output anything at all, remove the :decorate_title option.</span>
740
- <span class="ruby-identifier">export_options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:decorate_title</span>) <span class="ruby-keyword">if</span> (<span class="ruby-identifier">output</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>)
741
- <span class="ruby-ivar">@headlines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">headline</span><span class="ruby-operator">|</span>
742
- <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">headline</span>.<span class="ruby-identifier">export_state</span> <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
743
- <span class="ruby-keyword">case</span> <span class="ruby-identifier">headline</span>.<span class="ruby-identifier">export_state</span>
744
- <span class="ruby-keyword">when</span> <span class="ruby-value">:exclude</span>
745
- <span class="ruby-comment"># NOTHING</span>
746
- <span class="ruby-keyword">when</span> <span class="ruby-value">:headline_only</span>
747
- <span class="ruby-constant">Parser</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">headline</span>.<span class="ruby-identifier">body_lines</span>[<span class="ruby-value">0</span>, <span class="ruby-value">1</span>], <span class="ruby-identifier">output_buffer</span>)
748
- <span class="ruby-keyword">when</span> <span class="ruby-value">:all</span>
749
- <span class="ruby-constant">Parser</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">headline</span>.<span class="ruby-identifier">body_lines</span>, <span class="ruby-identifier">output_buffer</span>)
750
- <span class="ruby-keyword">end</span>
751
- <span class="ruby-keyword">end</span>
752
- <span class="ruby-identifier">rp</span> = <span class="ruby-constant">RubyPants</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">output</span>)
753
- <span class="ruby-identifier">rp</span>.<span class="ruby-identifier">to_html</span>
754
- <span class="ruby-keyword">end</span></pre>
755
- </div><!-- to_html-source -->
756
-
757
- </div>
758
-
759
-
760
-
761
-
762
- </div><!-- to_html-method -->
763
-
764
-
765
- <div id="to_textile-method" class="method-detail ">
766
- <a name="method-i-to_textile"></a>
767
-
768
-
769
- <div class="method-heading">
770
- <span class="method-name">to_textile</span><span
771
- class="method-args">()</span>
772
- <span class="method-click-advice">click to toggle source</span>
773
- </div>
774
-
775
-
776
- <div class="method-description">
777
-
778
- <p>Saves the loaded orgmode file as a textile file.</p>
779
-
780
-
781
-
782
- <div class="method-source-code" id="to_textile-source">
783
- <pre>
784
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 167</span>
785
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_textile</span>
786
- <span class="ruby-identifier">output</span> = <span class="ruby-string">&quot;&quot;</span>
787
- <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Line</span>.<span class="ruby-identifier">to_textile</span>(<span class="ruby-ivar">@header_lines</span>)
788
- <span class="ruby-ivar">@headlines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">headline</span><span class="ruby-operator">|</span>
789
- <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">headline</span>.<span class="ruby-identifier">to_textile</span>
790
- <span class="ruby-keyword">end</span>
791
- <span class="ruby-identifier">output</span>
792
- <span class="ruby-keyword">end</span></pre>
793
- </div><!-- to_textile-source -->
794
-
795
- </div>
796
-
797
-
798
-
799
-
800
- </div><!-- to_textile-method -->
801
-
802
-
803
- <div id="use_sub_superscripts-3F-method" class="method-detail ">
804
- <a name="method-i-use_sub_superscripts-3F"></a>
805
-
806
-
807
- <div class="method-heading">
808
- <span class="method-name">use_sub_superscripts?</span><span
809
- class="method-args">()</span>
810
- <span class="method-click-advice">click to toggle source</span>
811
- </div>
812
-
813
-
814
- <div class="method-description">
815
-
816
- <p>Should we export sub/superscripts? (_{foo}/^{foo}) only {} mode is
817
- currently supported.</p>
818
-
819
-
820
-
821
- <div class="method-source-code" id="use_sub_superscripts-3F-source">
822
- <pre>
823
- <span class="ruby-comment"># File lib/org-ruby/parser.rb, line 79</span>
824
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">use_sub_superscripts?</span>
825
- <span class="ruby-ivar">@options</span>[<span class="ruby-string">&quot;^&quot;</span>] <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;nil&quot;</span>
826
- <span class="ruby-keyword">end</span></pre>
827
- </div><!-- use_sub_superscripts-3F-source -->
828
-
829
- </div>
830
-
831
-
832
-
833
-
834
- </div><!-- use_sub_superscripts-3F-method -->
835
-
836
-
837
- </div><!-- public-instance-method-details -->
838
-
839
- </div><!-- 5Buntitled-5D -->
840
-
841
-
842
- </div><!-- documentation -->
843
-
844
- <div id="validator-badges">
845
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
846
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
847
- Rdoc Generator</a> 2</small>.</p>
848
- </div>
849
-
850
- </body>
851
- </html>
852
-