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,522 +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::Headline</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/headline_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
- class="thickbox" title="lib/org-ruby/headline.rb">lib/org-ruby/headline.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">Line</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-headline-3F">::headline?</a></li>
69
-
70
- <li><a href="#method-c-new">::new</a></li>
71
-
72
- <li><a href="#method-i-output_text">#output_text</a></li>
73
-
74
- <li><a href="#method-i-paragraph_type">#paragraph_type</a></li>
75
-
76
- <li><a href="#method-i-to_textile">#to_textile</a></li>
77
-
78
- </ul>
79
- </div>
80
-
81
-
82
-
83
- </div>
84
-
85
- <div id="project-metadata">
86
-
87
-
88
- <div id="fileindex-section" class="section project-section">
89
- <h3 class="section-header">Files</h3>
90
- <ul>
91
-
92
- <li class="file"><a href="../History_txt.html">History.txt</a></li>
93
-
94
- <li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
95
-
96
- <li class="file"><a href="../announcement_txt.html">announcement.txt</a></li>
97
-
98
- </ul>
99
- </div>
100
-
101
-
102
- <div id="classindex-section" class="section project-section">
103
- <h3 class="section-header">Class/Module Index
104
- <span class="search-toggle"><img src="../images/find.png"
105
- height="16" width="16" alt="[+]"
106
- title="show/hide quicksearch" /></span></h3>
107
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
108
- <fieldset>
109
- <legend>Quicksearch</legend>
110
- <input type="text" name="quicksearch" value=""
111
- class="quicksearch-field" />
112
- </fieldset>
113
- </form>
114
-
115
- <ul class="link-list">
116
-
117
- <li><a href="../Orgmode.html">Orgmode</a></li>
118
-
119
- <li><a href="../Orgmode/Headline.html">Orgmode::Headline</a></li>
120
-
121
- <li><a href="../Orgmode/HtmlOutputBuffer.html">Orgmode::HtmlOutputBuffer</a></li>
122
-
123
- <li><a href="../Orgmode/Line.html">Orgmode::Line</a></li>
124
-
125
- <li><a href="../Orgmode/OutputBuffer.html">Orgmode::OutputBuffer</a></li>
126
-
127
- <li><a href="../Orgmode/Parser.html">Orgmode::Parser</a></li>
128
-
129
- <li><a href="../Orgmode/RegexpHelper.html">Orgmode::RegexpHelper</a></li>
130
-
131
- <li><a href="../Orgmode/TextileOutputBuffer.html">Orgmode::TextileOutputBuffer</a></li>
132
-
133
- <li><a href="../OrgRuby.html">OrgRuby</a></li>
134
-
135
- </ul>
136
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
137
- </div>
138
-
139
-
140
- </div>
141
- </div>
142
-
143
- <div id="documentation">
144
- <h1 class="class">Orgmode::Headline</h1>
145
-
146
- <div id="description" class="description">
147
-
148
- <p>Represents a headline in an orgmode file.</p>
149
-
150
- </div><!-- description -->
151
-
152
-
153
- <div id="5Buntitled-5D" class="documentation-section">
154
-
155
-
156
-
157
-
158
-
159
- <!-- Constants -->
160
- <div id="constants-list" class="section">
161
- <h3 class="section-header">Constants</h3>
162
- <dl>
163
-
164
- <dt><a name="Keywords">Keywords</a></dt>
165
-
166
- <dd class="description"><p>Special keywords allowed at the start of a line.</p></dd>
167
-
168
-
169
- <dt><a name="KeywordsRegexp">KeywordsRegexp</a></dt>
170
-
171
- <dd class="description"></dd>
172
-
173
-
174
- <dt><a name="LineRegexp">LineRegexp</a></dt>
175
-
176
- <dd class="description"><p>This is the regex that matches a line</p></dd>
177
-
178
-
179
- <dt><a name="TagsRegexp">TagsRegexp</a></dt>
180
-
181
- <dd class="description"><p>This matches the tags on a headline</p></dd>
182
-
183
-
184
- <dt><a name="ValidExportStates">ValidExportStates</a></dt>
185
-
186
- <dd class="description"><p>Valid states for partial export.</p>
187
- <table class="rdoc-list"><tr><td class="rdoc-term"><p>exclude</p></td>
188
- <td>
189
- <p>The entire subtree from this heading should be excluded.</p>
190
- </td></tr><tr><td class="rdoc-term"><p>headline_only</p></td>
191
- <td>
192
- <p>The headline should be exported, but not the body.</p>
193
- </td></tr><tr><td class="rdoc-term"><p>all</p></td>
194
- <td>
195
- <p>Everything should be exported, headline/body/children.</p>
196
- </td></tr></table></dd>
197
-
198
-
199
- </dl>
200
- </div>
201
-
202
-
203
-
204
- <!-- Attributes -->
205
- <div id="attribute-method-details" class="method-section section">
206
- <h3 class="section-header">Attributes</h3>
207
-
208
-
209
- <div id="body_lines-attribute-method" class="method-detail">
210
- <a name="body_lines"></a>
211
-
212
- <div class="method-heading attribute-method-heading">
213
- <span class="method-name">body_lines</span><span
214
- class="attribute-access-type">[R]</span>
215
- </div>
216
-
217
- <div class="method-description">
218
-
219
- <p>This contains the lines that “belong” to the headline.</p>
220
-
221
- </div>
222
- </div>
223
-
224
- <div id="export_state-attribute-method" class="method-detail">
225
- <a name="export_state"></a>
226
-
227
- <a name="export_state="></a>
228
-
229
- <div class="method-heading attribute-method-heading">
230
- <span class="method-name">export_state</span><span
231
- class="attribute-access-type">[RW]</span>
232
- </div>
233
-
234
- <div class="method-description">
235
-
236
- <p>The export state of this headline. See <tt><a
237
- href="Headline.html#ValidExportStates">ValidExportStates</a></tt>.</p>
238
-
239
- </div>
240
- </div>
241
-
242
- <div id="headline_text-attribute-method" class="method-detail">
243
- <a name="headline_text"></a>
244
-
245
- <div class="method-heading attribute-method-heading">
246
- <span class="method-name">headline_text</span><span
247
- class="attribute-access-type">[R]</span>
248
- </div>
249
-
250
- <div class="method-description">
251
-
252
- <p>This is the headline text – the part of the headline minus the leading
253
- asterisks, the keywords, and the tags.</p>
254
-
255
- </div>
256
- </div>
257
-
258
- <div id="keyword-attribute-method" class="method-detail">
259
- <a name="keyword"></a>
260
-
261
- <div class="method-heading attribute-method-heading">
262
- <span class="method-name">keyword</span><span
263
- class="attribute-access-type">[R]</span>
264
- </div>
265
-
266
- <div class="method-description">
267
-
268
- <p>Optional keyword found at the beginning of the headline.</p>
269
-
270
- </div>
271
- </div>
272
-
273
- <div id="level-attribute-method" class="method-detail">
274
- <a name="level"></a>
275
-
276
- <div class="method-heading attribute-method-heading">
277
- <span class="method-name">level</span><span
278
- class="attribute-access-type">[R]</span>
279
- </div>
280
-
281
- <div class="method-description">
282
-
283
- <p>This is the “level” of the headline</p>
284
-
285
- </div>
286
- </div>
287
-
288
- <div id="tags-attribute-method" class="method-detail">
289
- <a name="tags"></a>
290
-
291
- <div class="method-heading attribute-method-heading">
292
- <span class="method-name">tags</span><span
293
- class="attribute-access-type">[R]</span>
294
- </div>
295
-
296
- <div class="method-description">
297
-
298
- <p>These are the headline tags</p>
299
-
300
- </div>
301
- </div>
302
-
303
- </div><!-- attribute-method-details -->
304
-
305
-
306
- <!-- Methods -->
307
-
308
- <div id="public-class-method-details" class="method-section section">
309
- <h3 class="section-header">Public Class Methods</h3>
310
-
311
-
312
- <div id="headline-3F-method" class="method-detail ">
313
- <a name="method-c-headline-3F"></a>
314
-
315
-
316
- <div class="method-heading">
317
- <span class="method-name">headline?</span><span
318
- class="method-args">(line)</span>
319
- <span class="method-click-advice">click to toggle source</span>
320
- </div>
321
-
322
-
323
- <div class="method-description">
324
-
325
- <p>Determines if a line is an orgmode “headline”: A headline begins with
326
- one or more asterisks.</p>
327
-
328
-
329
-
330
- <div class="method-source-code" id="headline-3F-source">
331
- <pre>
332
- <span class="ruby-comment"># File lib/org-ruby/headline.rb, line 73</span>
333
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">headline?</span>(<span class="ruby-identifier">line</span>)
334
- <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">LineRegexp</span>
335
- <span class="ruby-keyword">end</span></pre>
336
- </div><!-- headline-3F-source -->
337
-
338
- </div>
339
-
340
-
341
-
342
-
343
- </div><!-- headline-3F-method -->
344
-
345
-
346
- <div id="new-method" class="method-detail ">
347
- <a name="method-c-new"></a>
348
-
349
-
350
- <div class="method-heading">
351
- <span class="method-name">new</span><span
352
- class="method-args">(line, parser = nil, offset=0)</span>
353
- <span class="method-click-advice">click to toggle source</span>
354
- </div>
355
-
356
-
357
- <div class="method-description">
358
-
359
-
360
-
361
-
362
-
363
- <div class="method-source-code" id="new-source">
364
- <pre>
365
- <span class="ruby-comment"># File lib/org-ruby/headline.rb, line 44</span>
366
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">parser</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">offset</span>=<span class="ruby-value">0</span>)
367
- <span class="ruby-keyword">super</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">parser</span>)
368
- <span class="ruby-ivar">@body_lines</span> = []
369
- <span class="ruby-ivar">@body_lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">self</span> <span class="ruby-comment"># Make @body_lines contain the headline?</span>
370
- <span class="ruby-ivar">@tags</span> = []
371
- <span class="ruby-ivar">@export_state</span> = <span class="ruby-value">:exclude</span>
372
- <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@line</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">LineRegexp</span>) <span class="ruby-keyword">then</span>
373
- <span class="ruby-ivar">@level</span> = <span class="ruby-node">$&amp;</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">offset</span>
374
- <span class="ruby-ivar">@headline_text</span> = <span class="ruby-node">$'</span>.<span class="ruby-identifier">strip</span>
375
- <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@headline_text</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">TagsRegexp</span>) <span class="ruby-keyword">then</span>
376
- <span class="ruby-ivar">@tags</span> = <span class="ruby-node">$&amp;</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/:/</span>) <span class="ruby-comment"># split tag text on semicolon</span>
377
- <span class="ruby-ivar">@tags</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) <span class="ruby-comment"># the first item will be empty; discard</span>
378
- <span class="ruby-ivar">@headline_text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-constant">TagsRegexp</span>, <span class="ruby-string">&quot;&quot;</span>) <span class="ruby-comment"># Removes the tags from the headline</span>
379
- <span class="ruby-keyword">end</span>
380
- <span class="ruby-ivar">@keyword</span> = <span class="ruby-keyword">nil</span>
381
- <span class="ruby-identifier">parse_keywords</span>
382
- <span class="ruby-keyword">else</span>
383
- <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;'#{line}' is not a valid headline&quot;</span>
384
- <span class="ruby-keyword">end</span>
385
- <span class="ruby-keyword">end</span></pre>
386
- </div><!-- new-source -->
387
-
388
- </div>
389
-
390
-
391
-
392
-
393
- </div><!-- new-method -->
394
-
395
-
396
- </div><!-- public-class-method-details -->
397
-
398
- <div id="public-instance-method-details" class="method-section section">
399
- <h3 class="section-header">Public Instance Methods</h3>
400
-
401
-
402
- <div id="output_text-method" class="method-detail ">
403
- <a name="method-i-output_text"></a>
404
-
405
-
406
- <div class="method-heading">
407
- <span class="method-name">output_text</span><span
408
- class="method-args">()</span>
409
- <span class="method-click-advice">click to toggle source</span>
410
- </div>
411
-
412
-
413
- <div class="method-description">
414
-
415
- <p>Override <a href="Line.html#method-i-output_text">Line.output_text</a>. For
416
- a heading, @<a
417
- href="Headline.html#attribute-i-headline_text">headline_text</a> is what we
418
- should output.</p>
419
-
420
-
421
-
422
- <div class="method-source-code" id="output_text-source">
423
- <pre>
424
- <span class="ruby-comment"># File lib/org-ruby/headline.rb, line 67</span>
425
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">output_text</span>
426
- <span class="ruby-keyword">return</span> <span class="ruby-ivar">@headline_text</span>
427
- <span class="ruby-keyword">end</span></pre>
428
- </div><!-- output_text-source -->
429
-
430
- </div>
431
-
432
-
433
-
434
-
435
- </div><!-- output_text-method -->
436
-
437
-
438
- <div id="paragraph_type-method" class="method-detail ">
439
- <a name="method-i-paragraph_type"></a>
440
-
441
-
442
- <div class="method-heading">
443
- <span class="method-name">paragraph_type</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
- <p>Overrides <a
452
- href="Line.html#method-i-paragraph_type">Line.paragraph_type</a>.</p>
453
-
454
-
455
-
456
- <div class="method-source-code" id="paragraph_type-source">
457
- <pre>
458
- <span class="ruby-comment"># File lib/org-ruby/headline.rb, line 78</span>
459
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">paragraph_type</span>
460
- <span class="ruby-value">:&quot;heading#{@level}&quot;</span>
461
- <span class="ruby-keyword">end</span></pre>
462
- </div><!-- paragraph_type-source -->
463
-
464
- </div>
465
-
466
-
467
-
468
-
469
- </div><!-- paragraph_type-method -->
470
-
471
-
472
- <div id="to_textile-method" class="method-detail ">
473
- <a name="method-i-to_textile"></a>
474
-
475
-
476
- <div class="method-heading">
477
- <span class="method-name">to_textile</span><span
478
- class="method-args">()</span>
479
- <span class="method-click-advice">click to toggle source</span>
480
- </div>
481
-
482
-
483
- <div class="method-description">
484
-
485
- <p>Converts this headline and its body to textile.</p>
486
-
487
-
488
-
489
- <div class="method-source-code" id="to_textile-source">
490
- <pre>
491
- <span class="ruby-comment"># File lib/org-ruby/headline.rb, line 83</span>
492
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_textile</span>
493
- <span class="ruby-identifier">output</span> = <span class="ruby-node">&quot;h#{@level}. #{@headline_text}\n&quot;</span>
494
- <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">@body_lines</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>])
495
- <span class="ruby-identifier">output</span>
496
- <span class="ruby-keyword">end</span></pre>
497
- </div><!-- to_textile-source -->
498
-
499
- </div>
500
-
501
-
502
-
503
-
504
- </div><!-- to_textile-method -->
505
-
506
-
507
- </div><!-- public-instance-method-details -->
508
-
509
- </div><!-- 5Buntitled-5D -->
510
-
511
-
512
- </div><!-- documentation -->
513
-
514
- <div id="validator-badges">
515
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
516
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
517
- Rdoc Generator</a> 2</small>.</p>
518
- </div>
519
-
520
- </body>
521
- </html>
522
-