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.
Files changed (97) hide show
  1. data/History.txt +12 -0
  2. data/Rakefile +3 -5
  3. data/announcement.txt +24 -0
  4. data/doc/History_txt.html +272 -0
  5. data/doc/OrgRuby.html +149 -0
  6. data/doc/Orgmode.html +960 -0
  7. data/doc/Orgmode/Headline.html +522 -0
  8. data/doc/Orgmode/HtmlOutputBuffer.html +480 -0
  9. data/doc/Orgmode/Line.html +1251 -0
  10. data/doc/Orgmode/OutputBuffer.html +810 -0
  11. data/doc/Orgmode/Parser.html +852 -0
  12. data/doc/Orgmode/RegexpHelper.html +639 -0
  13. data/doc/Orgmode/TextileOutputBuffer.html +456 -0
  14. data/doc/README_rdoc.html +178 -0
  15. data/doc/announcement_txt.html +142 -0
  16. data/doc/bin/org-ruby.html +54 -0
  17. data/doc/created.rid +15 -0
  18. data/doc/images/brick.png +0 -0
  19. data/doc/images/brick_link.png +0 -0
  20. data/doc/images/bug.png +0 -0
  21. data/doc/images/bullet_black.png +0 -0
  22. data/doc/images/bullet_toggle_minus.png +0 -0
  23. data/doc/images/bullet_toggle_plus.png +0 -0
  24. data/doc/images/date.png +0 -0
  25. data/doc/images/find.png +0 -0
  26. data/doc/images/loadingAnimation.gif +0 -0
  27. data/doc/images/macFFBgHack.png +0 -0
  28. data/doc/images/package.png +0 -0
  29. data/doc/images/page_green.png +0 -0
  30. data/doc/images/page_white_text.png +0 -0
  31. data/doc/images/page_white_width.png +0 -0
  32. data/doc/images/plugin.png +0 -0
  33. data/doc/images/ruby.png +0 -0
  34. data/doc/images/tag_green.png +0 -0
  35. data/doc/images/wrench.png +0 -0
  36. data/doc/images/wrench_orange.png +0 -0
  37. data/doc/images/zoom.png +0 -0
  38. data/doc/index.html +306 -0
  39. data/doc/js/darkfish.js +116 -0
  40. data/doc/js/jquery.js +32 -0
  41. data/doc/js/quicksearch.js +114 -0
  42. data/doc/js/thickbox-compressed.js +10 -0
  43. data/doc/lib/org-ruby/headline_rb.html +52 -0
  44. data/doc/lib/org-ruby/html_output_buffer_rb.html +52 -0
  45. data/doc/lib/org-ruby/html_symbol_replace_rb.html +54 -0
  46. data/doc/lib/org-ruby/line_rb.html +52 -0
  47. data/doc/lib/org-ruby/output_buffer_rb.html +54 -0
  48. data/doc/lib/org-ruby/parser_rb.html +56 -0
  49. data/doc/lib/org-ruby/regexp_helper_rb.html +54 -0
  50. data/doc/lib/org-ruby/textile_output_buffer_rb.html +54 -0
  51. data/doc/lib/org-ruby/textile_symbol_replace_rb.html +54 -0
  52. data/doc/lib/org-ruby_rb.html +52 -0
  53. data/doc/rdoc.css +763 -0
  54. data/lib/org-ruby.rb +1 -1
  55. data/lib/org-ruby/headline.rb +2 -2
  56. data/lib/org-ruby/html_output_buffer.rb +62 -5
  57. data/lib/org-ruby/html_symbol_replace.rb +345 -0
  58. data/lib/org-ruby/line.rb +20 -9
  59. data/lib/org-ruby/output_buffer.rb +8 -1
  60. data/lib/org-ruby/parser.rb +47 -19
  61. data/lib/org-ruby/regexp_helper.rb +16 -0
  62. data/lib/org-ruby/textile_output_buffer.rb +37 -2
  63. data/lib/org-ruby/textile_symbol_replace.rb +345 -0
  64. data/org-ruby.gemspec +41 -0
  65. data/spec/headline_spec.rb +5 -0
  66. data/spec/html_examples/advanced-code.html +10 -0
  67. data/spec/html_examples/advanced-code.org +13 -0
  68. data/spec/html_examples/blockcomment.html +3 -0
  69. data/spec/html_examples/blockcomment.org +15 -0
  70. data/spec/html_examples/center.html +6 -0
  71. data/spec/html_examples/center.org +7 -0
  72. data/spec/html_examples/deflist.html +6 -0
  73. data/spec/html_examples/deflist.org +6 -0
  74. data/spec/html_examples/footnotes.html +10 -0
  75. data/spec/html_examples/footnotes.org +7 -0
  76. data/spec/html_examples/inline-formatting.html +8 -0
  77. data/spec/html_examples/inline-formatting.org +10 -0
  78. data/spec/html_examples/inline-images.html +1 -1
  79. data/spec/html_examples/lists.html +4 -0
  80. data/spec/html_examples/lists.org +11 -0
  81. data/spec/html_examples/subsupscript-nil.html +3 -0
  82. data/spec/html_examples/subsupscript-nil.org +6 -0
  83. data/spec/html_examples/subsupscript.html +3 -0
  84. data/spec/html_examples/subsupscript.org +5 -0
  85. data/spec/html_examples/tables.html +15 -0
  86. data/spec/html_examples/tables.org +24 -0
  87. data/spec/line_spec.rb +17 -13
  88. data/spec/spec_helper.rb +1 -2
  89. data/spec/textile_examples/center.org +7 -0
  90. data/spec/textile_examples/center.textile +6 -0
  91. data/spec/textile_examples/footnotes.org +7 -0
  92. data/spec/textile_examples/footnotes.textile +8 -0
  93. data/spec/textile_examples/tables.org +24 -0
  94. data/spec/textile_examples/tables.textile +17 -0
  95. data/util/gen-special-replace.el +37 -0
  96. metadata +111 -19
  97. data/.gitignore +0 -1
data/org-ruby.gemspec ADDED
@@ -0,0 +1,41 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{org-ruby}
5
+ s.version = "0.6.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = [%q{Brian Dewey}]
9
+ s.date = %q{2011-09-03}
10
+ s.description = %q{This gem contains Ruby routines for parsing org-mode files.The most
11
+ significant thing this library does today is convert org-mode files to
12
+ HTML or textile. Currently, you cannot do much to customize the
13
+ conversion. The supplied textile conversion is optimized for
14
+ extracting "content" from the orgfile as opposed to "metadata." }
15
+ s.email = %q{bdewey@gmail.com}
16
+ s.executables = [%q{org-ruby}]
17
+ s.extra_rdoc_files = [%q{History.txt}, %q{README.rdoc}, %q{bin/org-ruby}]
18
+ s.files = [%q{.bnsignore}, %q{History.txt}, %q{README.rdoc}, %q{Rakefile}, %q{TAGS}, %q{bin/org-ruby}, %q{lib/org-ruby.rb}, %q{lib/org-ruby/headline.rb}, %q{lib/org-ruby/html_output_buffer.rb}, %q{lib/org-ruby/html_symbol_replace.rb}, %q{lib/org-ruby/line.rb}, %q{lib/org-ruby/output_buffer.rb}, %q{lib/org-ruby/parser.rb}, %q{lib/org-ruby/regexp_helper.rb}, %q{lib/org-ruby/textile_output_buffer.rb}, %q{lib/org-ruby/textile_symbol_replace.rb}, %q{spec/data/freeform-example.org}, %q{spec/data/freeform.org}, %q{spec/data/hyp-planning.org}, %q{spec/data/remember.org}, %q{spec/headline_spec.rb}, %q{spec/html_examples/advanced-code.html}, %q{spec/html_examples/advanced-code.org}, %q{spec/html_examples/advanced-lists.html}, %q{spec/html_examples/advanced-lists.org}, %q{spec/html_examples/block_code.html}, %q{spec/html_examples/block_code.org}, %q{spec/html_examples/blockcomment.html}, %q{spec/html_examples/blockcomment.org}, %q{spec/html_examples/blockquote.html}, %q{spec/html_examples/blockquote.org}, %q{spec/html_examples/center.html}, %q{spec/html_examples/center.org}, %q{spec/html_examples/code-comment.html}, %q{spec/html_examples/code-comment.org}, %q{spec/html_examples/custom-seq-todo.html}, %q{spec/html_examples/custom-seq-todo.org}, %q{spec/html_examples/custom-todo.html}, %q{spec/html_examples/custom-todo.org}, %q{spec/html_examples/custom-typ-todo.html}, %q{spec/html_examples/custom-typ-todo.org}, %q{spec/html_examples/deflist.html}, %q{spec/html_examples/deflist.org}, %q{spec/html_examples/entities.html}, %q{spec/html_examples/entities.org}, %q{spec/html_examples/escape-pre.html}, %q{spec/html_examples/escape-pre.org}, %q{spec/html_examples/export-exclude-only.html}, %q{spec/html_examples/export-exclude-only.org}, %q{spec/html_examples/export-keywords.html}, %q{spec/html_examples/export-keywords.org}, %q{spec/html_examples/export-tags.html}, %q{spec/html_examples/export-tags.org}, %q{spec/html_examples/export-title.html}, %q{spec/html_examples/export-title.org}, %q{spec/html_examples/footnotes.html}, %q{spec/html_examples/footnotes.org}, %q{spec/html_examples/html-literal.html}, %q{spec/html_examples/html-literal.org}, %q{spec/html_examples/inline-formatting.html}, %q{spec/html_examples/inline-formatting.org}, %q{spec/html_examples/inline-images.html}, %q{spec/html_examples/inline-images.org}, %q{spec/html_examples/link-features.html}, %q{spec/html_examples/link-features.org}, %q{spec/html_examples/lists.html}, %q{spec/html_examples/lists.org}, %q{spec/html_examples/metadata-comment.html}, %q{spec/html_examples/metadata-comment.org}, %q{spec/html_examples/only-list.html}, %q{spec/html_examples/only-list.org}, %q{spec/html_examples/only-table.html}, %q{spec/html_examples/only-table.org}, %q{spec/html_examples/skip-header.html}, %q{spec/html_examples/skip-header.org}, %q{spec/html_examples/skip-table.html}, %q{spec/html_examples/skip-table.org}, %q{spec/html_examples/subsupscript-nil.html}, %q{spec/html_examples/subsupscript-nil.org}, %q{spec/html_examples/subsupscript.html}, %q{spec/html_examples/subsupscript.org}, %q{spec/html_examples/tables.html}, %q{spec/html_examples/tables.org}, %q{spec/html_examples/text.html}, %q{spec/html_examples/text.org}, %q{spec/line_spec.rb}, %q{spec/output_buffer_spec.rb}, %q{spec/parser_spec.rb}, %q{spec/regexp_helper_spec.rb}, %q{spec/spec_helper.rb}, %q{spec/textile_examples/block_code.org}, %q{spec/textile_examples/block_code.textile}, %q{spec/textile_examples/blockquote.org}, %q{spec/textile_examples/blockquote.textile}, %q{spec/textile_examples/center.org}, %q{spec/textile_examples/center.textile}, %q{spec/textile_examples/footnotes.org}, %q{spec/textile_examples/footnotes.textile}, %q{spec/textile_examples/keywords.org}, %q{spec/textile_examples/keywords.textile}, %q{spec/textile_examples/links.org}, %q{spec/textile_examples/links.textile}, %q{spec/textile_examples/lists.org}, %q{spec/textile_examples/lists.textile}, %q{spec/textile_examples/single-space-plain-list.org}, %q{spec/textile_examples/single-space-plain-list.textile}, %q{spec/textile_examples/tables.org}, %q{spec/textile_examples/tables.textile}, %q{spec/textile_output_buffer_spec.rb}, %q{tasks/test_case.rake}, %q{test/test_orgmode_parser.rb}, %q{util/gen-special-replace.el}]
19
+ s.homepage = %q{http://github.com/bdewey/org-ruby}
20
+ s.rdoc_options = [%q{--main}, %q{README.rdoc}]
21
+ s.require_paths = [%q{lib}]
22
+ s.rubyforge_project = %q{org-ruby}
23
+ s.rubygems_version = %q{1.8.5}
24
+ s.summary = %q{This gem contains Ruby routines for parsing org-mode files.}
25
+ s.test_files = [%q{test/test_orgmode_parser.rb}]
26
+
27
+ if s.respond_to? :specification_version then
28
+ s.specification_version = 3
29
+
30
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
31
+ s.add_runtime_dependency(%q<rubypants>, [">= 0.2.0"])
32
+ s.add_development_dependency(%q<bones>, [">= 3.7.1"])
33
+ else
34
+ s.add_dependency(%q<rubypants>, [">= 0.2.0"])
35
+ s.add_dependency(%q<bones>, [">= 3.7.1"])
36
+ end
37
+ else
38
+ s.add_dependency(%q<rubypants>, [">= 0.2.0"])
39
+ s.add_dependency(%q<bones>, [">= 3.7.1"])
40
+ end
41
+ end
@@ -26,6 +26,11 @@ describe Orgmode::Headline do
26
26
  end
27
27
  end
28
28
 
29
+ it "should properly determine headline level with offset" do
30
+ h = Orgmode::Headline.new("* one", nil, 1)
31
+ h.level.should eql(2)
32
+ end
33
+
29
34
  it "should find simple headline text" do
30
35
  h = Orgmode::Headline.new "*** sample"
31
36
  h.headline_text.should eql("sample")
@@ -34,3 +34,13 @@ END:
34
34
  end
35
35
  end
36
36
  </pre>
37
+ <p>Now let&#8217;s test case-insensitive code blocks.</p>
38
+ <pre class="src">
39
+ # Finds all emphasis matches in a string.
40
+ # Supply a block that will get the marker and body as parameters.
41
+ def match_all(str)
42
+ str.scan(@org_emphasis_regexp) do |match|
43
+ yield $2, $3
44
+ end
45
+ end
46
+ </pre>
@@ -51,3 +51,16 @@ And this:
51
51
  end
52
52
  end
53
53
  #+END_SRC
54
+
55
+ Now let's test case-insensitive code blocks.
56
+
57
+ #+begin_src ruby
58
+ # Finds all emphasis matches in a string.
59
+ # Supply a block that will get the marker and body as parameters.
60
+ def match_all(str)
61
+ str.scan(@org_emphasis_regexp) do |match|
62
+ yield $2, $3
63
+ end
64
+ end
65
+ #+end_src
66
+
@@ -0,0 +1,3 @@
1
+ <p class="title">BLOCKCOMMENT</p>
2
+ <p>Testing that the next part is ignored</p>
3
+ <p>And now back to normal!</p>
@@ -0,0 +1,15 @@
1
+ BLOCKCOMMENT
2
+
3
+ Testing that the next part is ignored
4
+
5
+ #+BEGIN_COMMENT
6
+
7
+ /Foo/
8
+
9
+ #+BEGIN_SRC c++
10
+ int main() { }
11
+ #+END_SRC
12
+
13
+ #+END_COMMENT
14
+
15
+ And now back to normal!
@@ -0,0 +1,6 @@
1
+ <p class="title">Fou</p>
2
+ <p>not center</p>
3
+ <div style="text-align: center">
4
+ <p>center</p>
5
+ </div>
6
+ <p>not center, again</p>
@@ -0,0 +1,7 @@
1
+ #+TITLE: Fou
2
+
3
+ not center
4
+ #+BEGIN_CENTER
5
+ center
6
+ #+END_CENTER
7
+ not center, again
@@ -0,0 +1,6 @@
1
+ <p class="title">Hallo</p>
2
+ <dl>
3
+ <dt>a</dt><dd>hello</dd>
4
+ <dt>b</dt><dd>world</dd>
5
+ </dl>
6
+ <p>Text</p>
@@ -0,0 +1,6 @@
1
+ #+TITLE: Hallo
2
+
3
+ - a :: hello
4
+ - b :: world
5
+
6
+ Text
@@ -0,0 +1,10 @@
1
+ <p class="title">Footnotes</p>
2
+ <p>Hello<sup><a class="footref" name="fnr.abc" href="#fn.abc">abc</a></sup> World<sup><a class="footref" name="fnr.abc" href="#fn.abc">abc</a></sup></p>
3
+ <p>Bfoo<sup><a class="footref" name="fnr.1" href="#fn.1">1</a></sup></p>
4
+ <div id="footnotes">
5
+ <h2 class="footnotes">Footnotes: </h2>
6
+ <div id="text-footnotes">
7
+ <p class="footnote"><sup><a class="footnum" name="fn.abc" href="#fnr.abc">abc</a></sup>definition of abc</p>
8
+ <p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a></sup><b>blub</b></p>
9
+ </div>
10
+ </div>
@@ -0,0 +1,7 @@
1
+ #+TITLE: Footnotes
2
+ #+OPTIONS: f:t
3
+
4
+ Hello[fn:abc]
5
+ World[fn:abc:definition of abc]
6
+
7
+ Bfoo[fn:1:*blub*]
@@ -8,3 +8,11 @@
8
8
  </ul>
9
9
  <p>Note the last one <b>is not</b> a link, as the source doesn&#8217;t include it in double-brackets and I don&#8217;t auto-recognize URLs.</p>
10
10
  <p>I should also handle links with <a href="http://www.xkcd.com">helpful text</a>.</p>
11
+ <p>Helpful addition from <a href="https://github.com/punchagan">punchagan</a>, we now recognize when the link goes to an image and make the link anchor be the image, like this:</p>
12
+ <ul>
13
+ <li><a href="http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg"><img src="http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg" /></a></li>
14
+ </ul>
15
+ <p>Also, if you make the descriptive text be an image, then it will get formatted with an image tag, like so:</p>
16
+ <ul>
17
+ <li><a href="http://www.xkcd.com"><img src="http://imgs.xkcd.com/comics/t_cells.png" /></a></li>
18
+ </ul>
@@ -15,3 +15,13 @@ double-brackets and I don't auto-recognize URLs.
15
15
 
16
16
  I should also handle links with [[http://www.xkcd.com][helpful text]].
17
17
 
18
+ Helpful addition from [[https://github.com/punchagan][punchagan]], we now
19
+ recognize when the link goes to an image and make the link anchor be the
20
+ image, like this:
21
+
22
+ - [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]]
23
+
24
+ Also, if you make the descriptive text be an image, then it will get formatted
25
+ with an image tag, like so:
26
+
27
+ - [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]]
@@ -1,6 +1,6 @@
1
1
  <p class="title">Inline Images</p>
2
2
  <p>Per the org-mode <a href="http://orgmode.org/manual/Images-and-tables.html#Images-and-tables">spec</a>, you can include inline images as links without any descriptive link text, like this:</p>
3
- <p><img src="http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg" /></p>
3
+ <p><a href="http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg"><img src="http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg" /></a></p>
4
4
  <p>I currently do not support the caption/link syntax, but I can include the inline image. I recognize the following image file types:</p>
5
5
  <ul>
6
6
  <li>.jpg</li>
@@ -17,3 +17,7 @@
17
17
  <li>This is a single-line list.</li>
18
18
  </ul>
19
19
  <p>And this is a <b>separate paragraph.</b> Note the indentation in the org file.</p>
20
+ <h2>Invalid lists</h2>
21
+ <p>Note that spaces are required to denote lists. Thus, none of the following should get recognized as lists.</p>
22
+ <p>-This isn&#8217;t a list. -And this isn&#8217;t a list.</p>
23
+ <p>1.And this isn&#8217;t a list. 2.And this isn&#8217;t a list.</p>
@@ -34,3 +34,14 @@ And this is a paragraph *after* the list.
34
34
  - This is a single-line list.
35
35
  And this is a *separate paragraph.* Note the indentation in the org
36
36
  file.
37
+
38
+ ** Invalid lists
39
+
40
+ Note that spaces are required to denote lists. Thus, none of the following
41
+ should get recognized as lists.
42
+
43
+ -This isn't a list.
44
+ -And this isn't a list.
45
+
46
+ 1.And this isn't a list.
47
+ 2.And this isn't a list.
@@ -0,0 +1,3 @@
1
+ <p class="title">SUBSUPSCRIPT</p>
2
+ <p>a^{b}</p>
3
+ <p>a_{b}</p>
@@ -0,0 +1,6 @@
1
+ #+OPTIONS: ^:nil
2
+ SUBSUPSCRIPT
3
+
4
+ a^{b}
5
+
6
+ a_{b}
@@ -0,0 +1,3 @@
1
+ <p class="title">SUBSUPSCRIPT</p>
2
+ <p>a<sup>b</sup></p>
3
+ <p>a<sub>b</sub></p>
@@ -0,0 +1,5 @@
1
+ SUBSUPSCRIPT
2
+
3
+ a^{b}
4
+
5
+ a_{b}
@@ -18,3 +18,18 @@
18
18
  <tr><td>Seven</td><td>Eight</td><td>Nine</td></tr>
19
19
  </table>
20
20
  <p>The separator row should not get printed out.</p>
21
+ <h1>Table with complete box</h1>
22
+ <table>
23
+ <tr><th>One</th><th>Two</th><th>Three</th></tr>
24
+ <tr><td>Four</td><td>Five</td><td>Six</td></tr>
25
+ <tr><td>Seven</td><td>Eight</td><td>Nine</td></tr>
26
+ </table>
27
+ <p>Only the first row should be a header row.</p>
28
+ <h1>Table with extra lines</h1>
29
+ <table>
30
+ <tr><th>One</th><th>Two</th><th>Three</th></tr>
31
+ <tr><td>Four</td><td>Five</td><td>Six</td></tr>
32
+ <tr><td>Seven</td><td>Eight</td><td>Nine</td></tr>
33
+ <tr><td>Ten</td><td>Eleven</td><td>Twelve</td></tr>
34
+ </table>
35
+ <p>Only the first row should be a header row.</p>
@@ -24,3 +24,27 @@ Different types of ORG tables.
24
24
  | Seven | Eight | Nine |
25
25
 
26
26
  The separator row should not get printed out.
27
+
28
+ * Table with complete box
29
+
30
+ |-------+-------+-------|
31
+ | One | Two | Three |
32
+ |-------+-------+-------|
33
+ | Four | Five | Six |
34
+ | Seven | Eight | Nine |
35
+ |-------+-------+-------|
36
+
37
+ Only the first row should be a header row.
38
+
39
+ * Table with extra lines
40
+
41
+ |-------+--------+--------|
42
+ | One | Two | Three |
43
+ |-------+--------+--------|
44
+ | Four | Five | Six |
45
+ | Seven | Eight | Nine |
46
+ |-------+--------+--------|
47
+ | Ten | Eleven | Twelve |
48
+ |-------+--------+--------|
49
+
50
+ Only the first row should be a header row.
data/spec/line_spec.rb CHANGED
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
3
  describe Orgmode::Line do
4
4
 
5
5
  it "should tell comments" do
6
- comments = ["# hello", "#hello", " #hello", "\t#hello\n"]
6
+ comments = ["# hello", "#hello" ]
7
7
  comments.each do |c|
8
8
  line = Orgmode::Line.new c
9
9
  line.comment?.should be_true
@@ -29,20 +29,26 @@ describe Orgmode::Line do
29
29
  Orgmode::Line.new(inline_example).inline_example?.should be_true
30
30
  end
31
31
  end
32
-
33
-
34
- it "should recognize plain lists" do
35
- list_formats = ["-",
36
- "+",
37
- " -",
38
- " +",
39
- " 1.",
40
- " 2)"]
41
- list_formats.each do |list|
32
+
33
+ list_formats = ["- ",
34
+ "+ ",
35
+ " - ",
36
+ " + ",
37
+ " 1. ",
38
+ " 2) "]
39
+ list_formats.each do |list|
40
+ it "should recognize this list format: '#{list}'" do
42
41
  line = Orgmode::Line.new list
43
42
  line.plain_list?.should be_true
44
43
  end
45
44
  end
45
+
46
+ ["-foo", "+foo", "1.foo", "2.foo"].each do |invalid_list|
47
+ it "should not recognize this invalid list: '#{invalid_list}'" do
48
+ line = Orgmode::Line.new invalid_list
49
+ line.plain_list?.should_not be_true
50
+ end
51
+ end
46
52
 
47
53
  it "should recognize table rows" do
48
54
  Orgmode::Line.new("| One | Two | Three |").table_row?.should be_true
@@ -81,14 +87,12 @@ describe Orgmode::Line do
81
87
 
82
88
  begin_examples.each_key do |str|
83
89
  line = Orgmode::Line.new str
84
- line.comment?.should be_true
85
90
  line.begin_block?.should be_true
86
91
  line.block_type.should eql(begin_examples[str])
87
92
  end
88
93
 
89
94
  end_examples.each_key do |str|
90
95
  line = Orgmode::Line.new str
91
- line.comment?.should be_true
92
96
  line.end_block?.should be_true
93
97
  line.block_type.should eql(end_examples[str])
94
98
  end
data/spec/spec_helper.rb CHANGED
@@ -7,8 +7,7 @@ RememberFile = File.join(File.dirname(__FILE__), %w[data remember.org])
7
7
  FreeformFile = File.join(File.dirname(__FILE__), %w[data freeform.org])
8
8
  FreeformExampleFile = File.join(File.dirname(__FILE__), %w[data freeform-example.org])
9
9
 
10
-
11
- Spec::Runner.configure do |config|
10
+ RSpec.configure do |config|
12
11
  # == Mock Framework
13
12
  #
14
13
  # RSpec uses it's own mocking framework by default. If you prefer to
@@ -0,0 +1,7 @@
1
+ #+TITLE: Fou
2
+
3
+ not center
4
+ #+BEGIN_CENTER
5
+ center
6
+ #+END_CENTER
7
+ not center, again
@@ -0,0 +1,6 @@
1
+
2
+ not center
3
+
4
+ p=. center
5
+
6
+ not center, again
@@ -0,0 +1,7 @@
1
+ #+TITLE: Footnotes
2
+ #+OPTIONS: f:t
3
+
4
+ Hello[fn:abc]
5
+ World[fn:abc:definition of abc]
6
+
7
+ Bfoo[fn:1:*blub*]
@@ -0,0 +1,8 @@
1
+
2
+ Hello[833038373] World[833038373]
3
+
4
+ Bfoo[1]
5
+
6
+ fn1. *blub*
7
+
8
+ fn833038373. definition of abc
@@ -24,3 +24,27 @@ Different types of ORG tables.
24
24
  | Seven | Eight | Nine |
25
25
 
26
26
  The separator row should not get printed out.
27
+
28
+ * Table with complete box
29
+
30
+ |-------+-------+-------|
31
+ | One | Two | Three |
32
+ |-------+-------+-------|
33
+ | Four | Five | Six |
34
+ | Seven | Eight | Nine |
35
+ |-------+-------+-------|
36
+
37
+ Only the first row should be a header row.
38
+
39
+ * Table with extra lines
40
+
41
+ |-------+--------+--------|
42
+ | One | Two | Three |
43
+ |-------+--------+--------|
44
+ | Four | Five | Six |
45
+ | Seven | Eight | Nine |
46
+ |-------+--------+--------|
47
+ | Ten | Eleven | Twelve |
48
+ |-------+--------+--------|
49
+
50
+ Only the first row should be a header row.
@@ -21,3 +21,20 @@ h1. Table with header
21
21
  | Seven | Eight | Nine |
22
22
 
23
23
  The separator row should not get printed out.
24
+
25
+ h1. Table with complete box
26
+
27
+ | One | Two | Three |
28
+ | Four | Five | Six |
29
+ | Seven | Eight | Nine |
30
+
31
+ Only the first row should be a header row.
32
+
33
+ h1. Table with extra lines
34
+
35
+ | One | Two | Three |
36
+ | Four | Five | Six |
37
+ | Seven | Eight | Nine |
38
+ | Ten | Eleven | Twelve |
39
+
40
+ Only the first row should be a header row.