org-ruby 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. data/History.txt +81 -77
  2. data/README.rdoc +66 -66
  3. data/Rakefile +28 -28
  4. data/bin/org-ruby +40 -40
  5. data/lib/org-ruby.rb +50 -50
  6. data/lib/org-ruby/headline.rb +102 -120
  7. data/lib/org-ruby/html_output_buffer.rb +174 -156
  8. data/lib/org-ruby/line.rb +206 -260
  9. data/lib/org-ruby/output_buffer.rb +227 -191
  10. data/lib/org-ruby/parser.rb +320 -272
  11. data/lib/org-ruby/regexp_helper.rb +156 -156
  12. data/lib/org-ruby/textile_output_buffer.rb +67 -68
  13. data/spec/data/freeform-example.org +113 -113
  14. data/spec/data/freeform.org +111 -111
  15. data/spec/data/hyp-planning.org +335 -335
  16. data/spec/data/remember.org +53 -53
  17. data/spec/headline_spec.rb +55 -55
  18. data/spec/html_examples/advanced-code.html +36 -36
  19. data/spec/html_examples/advanced-code.org +53 -53
  20. data/spec/html_examples/advanced-lists.html +31 -31
  21. data/spec/html_examples/advanced-lists.org +31 -31
  22. data/spec/html_examples/block_code.html +28 -28
  23. data/spec/html_examples/block_code.org +35 -35
  24. data/spec/html_examples/blockquote.html +7 -7
  25. data/spec/html_examples/blockquote.org +13 -13
  26. data/spec/html_examples/code-comment.html +18 -18
  27. data/spec/html_examples/code-comment.org +22 -22
  28. data/spec/html_examples/custom-seq-todo.html +15 -15
  29. data/spec/html_examples/custom-seq-todo.org +24 -24
  30. data/spec/html_examples/custom-todo.html +15 -15
  31. data/spec/html_examples/custom-todo.org +24 -24
  32. data/spec/html_examples/custom-typ-todo.html +15 -15
  33. data/spec/html_examples/custom-typ-todo.org +24 -24
  34. data/spec/html_examples/entities.html +4 -4
  35. data/spec/html_examples/entities.org +11 -11
  36. data/spec/html_examples/escape-pre.html +6 -6
  37. data/spec/html_examples/escape-pre.org +6 -6
  38. data/spec/html_examples/export-exclude-only.html +13 -13
  39. data/spec/html_examples/export-exclude-only.org +81 -81
  40. data/spec/html_examples/export-keywords.html +4 -4
  41. data/spec/html_examples/export-keywords.org +18 -18
  42. data/spec/html_examples/export-tags.html +8 -8
  43. data/spec/html_examples/export-tags.org +82 -82
  44. data/spec/html_examples/export-title.html +2 -2
  45. data/spec/html_examples/export-title.org +4 -4
  46. data/spec/html_examples/html-literal.html +2 -2
  47. data/spec/html_examples/html-literal.org +6 -6
  48. data/spec/html_examples/inline-formatting.html +10 -10
  49. data/spec/html_examples/inline-formatting.org +17 -17
  50. data/spec/html_examples/link-features.html +8 -8
  51. data/spec/html_examples/link-features.org +19 -19
  52. data/spec/html_examples/lists.html +19 -19
  53. data/spec/html_examples/lists.org +36 -36
  54. data/spec/html_examples/metadata-comment.html +27 -27
  55. data/spec/html_examples/metadata-comment.org +30 -30
  56. data/spec/html_examples/only-list.html +5 -5
  57. data/spec/html_examples/only-list.org +3 -3
  58. data/spec/html_examples/only-table.html +6 -6
  59. data/spec/html_examples/only-table.org +5 -5
  60. data/spec/html_examples/skip-header.html +3 -3
  61. data/spec/html_examples/skip-header.org +28 -28
  62. data/spec/html_examples/skip-table.html +4 -4
  63. data/spec/html_examples/skip-table.org +19 -19
  64. data/spec/html_examples/tables.html +20 -20
  65. data/spec/html_examples/tables.org +26 -26
  66. data/spec/html_examples/text.html +2 -2
  67. data/spec/html_examples/text.org +16 -16
  68. data/spec/line_spec.rb +151 -151
  69. data/spec/output_buffer_spec.rb +19 -0
  70. data/spec/parser_spec.rb +152 -166
  71. data/spec/regexp_helper_spec.rb +57 -57
  72. data/spec/spec_helper.rb +21 -21
  73. data/spec/textile_examples/block_code.org +35 -35
  74. data/spec/textile_examples/block_code.textile +29 -29
  75. data/spec/textile_examples/blockquote.org +13 -13
  76. data/spec/textile_examples/blockquote.textile +11 -11
  77. data/spec/textile_examples/keywords.org +13 -13
  78. data/spec/textile_examples/keywords.textile +11 -11
  79. data/spec/textile_examples/links.org +11 -11
  80. data/spec/textile_examples/links.textile +10 -10
  81. data/spec/textile_examples/lists.org +36 -36
  82. data/spec/textile_examples/lists.textile +20 -20
  83. data/spec/textile_examples/single-space-plain-list.org +13 -13
  84. data/spec/textile_examples/single-space-plain-list.textile +10 -10
  85. data/spec/textile_examples/tables.org +26 -26
  86. data/spec/textile_examples/tables.textile +23 -23
  87. data/spec/textile_output_buffer_spec.rb +21 -21
  88. data/tasks/test_case.rake +49 -49
  89. metadata +3 -2
@@ -1,53 +1,53 @@
1
- * New Ideas
2
- ** YAML header in Webby
3
-
4
- Make sure you don't have TABS here. Best practice: Configure your
5
- editor to use spaces instaed of tabs, and if you can see whitespace,
6
- even better.
7
-
8
- In emacs, set indent-tabs-mode to NIL.
9
- ** Ruby Gems behind Proxy
10
-
11
- Set the following environment variable:
12
-
13
- So, I added a User Variable for my account called http_proxy with
14
- the value of http://<proxyserveraddress>:8080, rebooted, ran plan
15
- old vanillia gem install rails –include-dependencies, and magically,
16
- it worked
17
- ** Hyper-V technical info
18
-
19
- http://technet.microsoft.com/en-us/dd565807.aspx
20
- ** VirtualBox
21
-
22
- Virtualization software from Sun. Looks like it might be more for
23
- dev/test. I'm surprised this hasn't popped at
24
- all. http://www.virtualbox.org/. Backed by Sun.
25
- ** Interesting LaTeX article
26
-
27
- http://nitens.org/taraborelli/latex -- on the virtues of LaTeX
28
- ** XEmacs / Emacs internals
29
-
30
- Looks like an interesting resource if I want to learn how Emacs works.
31
-
32
- http://www.xemacs.org/Documentation/21.5/html/internals_9.html#SEC19
33
- ** MikTeX
34
-
35
- Get it here: http://www.miktex.org/portable/
36
- ** Orgmode publishing tutorial
37
-
38
- [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php][Publishing Org-mode files to HTML]]
39
- ** Git and Live Mesh
40
-
41
- This is really helpful:
42
- http://whereslou.com/2009/06/04/using-live-mesh-and-git-the-best-of-both-worlds
43
- ** VDI deployment stats
44
-
45
- Key takeaways:
46
- - 74% are using VDI in production or pilot ... but 45% of those using have less than 100 users
47
- - Upward of 55% of the DAC members [project] they will have up to 50% of their users using VDI in 3 years (~1/2 of those will have > 50%)
48
- - No real surprises on the reasons / benefits etc
49
- - Interestingly ... even if TS supported all client apps / supported user-install apps - 100% of the DAC preferred VDI over TS
50
- - Most companies said a portion of their users would have VDI as the primary replacement desktop (60% < 20% of users, 32% 21-50% of users)
51
- ** Hyper-V Scheduler Information
52
-
53
- http://msdn.microsoft.com/en-us/library/bb969782.aspx
1
+ * New Ideas
2
+ ** YAML header in Webby
3
+
4
+ Make sure you don't have TABS here. Best practice: Configure your
5
+ editor to use spaces instaed of tabs, and if you can see whitespace,
6
+ even better.
7
+
8
+ In emacs, set indent-tabs-mode to NIL.
9
+ ** Ruby Gems behind Proxy
10
+
11
+ Set the following environment variable:
12
+
13
+ So, I added a User Variable for my account called http_proxy with
14
+ the value of http://<proxyserveraddress>:8080, rebooted, ran plan
15
+ old vanillia gem install rails –include-dependencies, and magically,
16
+ it worked
17
+ ** Hyper-V technical info
18
+
19
+ http://technet.microsoft.com/en-us/dd565807.aspx
20
+ ** VirtualBox
21
+
22
+ Virtualization software from Sun. Looks like it might be more for
23
+ dev/test. I'm surprised this hasn't popped at
24
+ all. http://www.virtualbox.org/. Backed by Sun.
25
+ ** Interesting LaTeX article
26
+
27
+ http://nitens.org/taraborelli/latex -- on the virtues of LaTeX
28
+ ** XEmacs / Emacs internals
29
+
30
+ Looks like an interesting resource if I want to learn how Emacs works.
31
+
32
+ http://www.xemacs.org/Documentation/21.5/html/internals_9.html#SEC19
33
+ ** MikTeX
34
+
35
+ Get it here: http://www.miktex.org/portable/
36
+ ** Orgmode publishing tutorial
37
+
38
+ [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php][Publishing Org-mode files to HTML]]
39
+ ** Git and Live Mesh
40
+
41
+ This is really helpful:
42
+ http://whereslou.com/2009/06/04/using-live-mesh-and-git-the-best-of-both-worlds
43
+ ** VDI deployment stats
44
+
45
+ Key takeaways:
46
+ - 74% are using VDI in production or pilot ... but 45% of those using have less than 100 users
47
+ - Upward of 55% of the DAC members [project] they will have up to 50% of their users using VDI in 3 years (~1/2 of those will have > 50%)
48
+ - No real surprises on the reasons / benefits etc
49
+ - Interestingly ... even if TS supported all client apps / supported user-install apps - 100% of the DAC preferred VDI over TS
50
+ - Most companies said a portion of their users would have VDI as the primary replacement desktop (60% < 20% of users, 32% 21-50% of users)
51
+ ** Hyper-V Scheduler Information
52
+
53
+ http://msdn.microsoft.com/en-us/library/bb969782.aspx
@@ -1,55 +1,55 @@
1
-
2
- require File.join(File.dirname(__FILE__), %w[spec_helper])
3
-
4
- describe Orgmode::Headline do
5
-
6
- it "should recognize headlines that start with asterisks" do
7
- Orgmode::Headline.headline?("*** test\n").should_not be_nil
8
- end
9
-
10
- it "should reject headlines without headlines at the start" do
11
- Orgmode::Headline.headline?(" nope!").should be_nil
12
- Orgmode::Headline.headline?(" tricked you!!!***").should be_nil
13
- end
14
-
15
- it "should reject improper initialization" do
16
- lambda { Orgmode::Headline.new " tricked**" }.should raise_error
17
- end
18
-
19
- it "should properly determine headline level" do
20
- samples = ["* one", "** two", "*** three", "**** four"]
21
- expected = 1
22
- samples.each do |sample|
23
- h = Orgmode::Headline.new sample
24
- h.level.should eql(expected)
25
- expected += 1
26
- end
27
- end
28
-
29
- it "should find simple headline text" do
30
- h = Orgmode::Headline.new "*** sample"
31
- h.headline_text.should eql("sample")
32
- end
33
-
34
- it "should understand tags" do
35
- h = Orgmode::Headline.new "*** sample :tag:tag2:\n"
36
- h.headline_text.should eql("sample")
37
- h.should have(2).tags
38
- h.tags[0].should eql("tag")
39
- h.tags[1].should eql("tag2")
40
- end
41
-
42
- it "should understand a single tag" do
43
- h = Orgmode::Headline.new "*** sample :tag:\n"
44
- h.headline_text.should eql("sample")
45
- h.should have(1).tags
46
- h.tags[0].should eql("tag")
47
- end
48
-
49
- it "should understand keywords" do
50
- h = Orgmode::Headline.new "*** TODO Feed cat :home:"
51
- h.headline_text.should eql("Feed cat")
52
- h.keyword.should eql("TODO")
53
- end
54
- end
55
-
1
+
2
+ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
+
4
+ describe Orgmode::Headline do
5
+
6
+ it "should recognize headlines that start with asterisks" do
7
+ Orgmode::Headline.headline?("*** test\n").should_not be_nil
8
+ end
9
+
10
+ it "should reject headlines without headlines at the start" do
11
+ Orgmode::Headline.headline?(" nope!").should be_nil
12
+ Orgmode::Headline.headline?(" tricked you!!!***").should be_nil
13
+ end
14
+
15
+ it "should reject improper initialization" do
16
+ lambda { Orgmode::Headline.new " tricked**" }.should raise_error
17
+ end
18
+
19
+ it "should properly determine headline level" do
20
+ samples = ["* one", "** two", "*** three", "**** four"]
21
+ expected = 1
22
+ samples.each do |sample|
23
+ h = Orgmode::Headline.new sample
24
+ h.level.should eql(expected)
25
+ expected += 1
26
+ end
27
+ end
28
+
29
+ it "should find simple headline text" do
30
+ h = Orgmode::Headline.new "*** sample"
31
+ h.headline_text.should eql("sample")
32
+ end
33
+
34
+ it "should understand tags" do
35
+ h = Orgmode::Headline.new "*** sample :tag:tag2:\n"
36
+ h.headline_text.should eql("sample")
37
+ h.should have(2).tags
38
+ h.tags[0].should eql("tag")
39
+ h.tags[1].should eql("tag2")
40
+ end
41
+
42
+ it "should understand a single tag" do
43
+ h = Orgmode::Headline.new "*** sample :tag:\n"
44
+ h.headline_text.should eql("sample")
45
+ h.should have(1).tags
46
+ h.tags[0].should eql("tag")
47
+ end
48
+
49
+ it "should understand keywords" do
50
+ h = Orgmode::Headline.new "*** TODO Feed cat :home:"
51
+ h.headline_text.should eql("Feed cat")
52
+ h.keyword.should eql("TODO")
53
+ end
54
+ end
55
+
@@ -1,36 +1,36 @@
1
- <p class="title">advanced-code.org</p>
2
- <p>Turns out there&#8217;s more way to do code than just BEGIN_EXAMPLE.</p>
3
- <h1><span class="heading-number heading-number-1">1 </span>Inline examples</h1>
4
- <p>This should work:</p>
5
- <pre class="example">
6
- fixed width? how does this work?
7
- ...........
8
- ............
9
- .
10
- . . . .
11
- . ..
12
- ....... .....
13
- . .
14
- ....
15
- </pre>
16
- <p>Two ASCII blobs.</p>
17
- <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC</h1>
18
- <pre class="example">
19
- PROPERTIES:
20
- ARCHIVE_TIME: 2009-12-26 Sat 22:16
21
- ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
22
- ARCHIVE_OLPATH: &amp;lt;%= @page.title %&amp;gt;/Future Development
23
- ARCHIVE_CATEGORY: orgmode_parser
24
- ARCHIVE_TODO: DONE
25
- END:
26
- </pre>
27
- <p>And this:</p>
28
- <pre class="src">
29
- # Finds all emphasis matches in a string.
30
- # Supply a block that will get the marker and body as parameters.
31
- def match_all(str)
32
- str.scan(@org_emphasis_regexp) do |match|
33
- yield $2, $3
34
- end
35
- end
36
- </pre>
1
+ <p class="title">advanced-code.org</p>
2
+ <p>Turns out there&#8217;s more way to do code than just BEGIN_EXAMPLE.</p>
3
+ <h1><span class="heading-number heading-number-1">1 </span>Inline examples</h1>
4
+ <p>This should work:</p>
5
+ <pre class="example">
6
+ fixed width? how does this work?
7
+ ...........
8
+ ............
9
+ .
10
+ . . . .
11
+ . ..
12
+ ....... .....
13
+ . .
14
+ ....
15
+ </pre>
16
+ <p>Two ASCII blobs.</p>
17
+ <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC</h1>
18
+ <pre class="example">
19
+ PROPERTIES:
20
+ ARCHIVE_TIME: 2009-12-26 Sat 22:16
21
+ ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
22
+ ARCHIVE_OLPATH: &amp;lt;%= @page.title %&amp;gt;/Future Development
23
+ ARCHIVE_CATEGORY: orgmode_parser
24
+ ARCHIVE_TODO: DONE
25
+ END:
26
+ </pre>
27
+ <p>And this:</p>
28
+ <pre class="src">
29
+ # Finds all emphasis matches in a string.
30
+ # Supply a block that will get the marker and body as parameters.
31
+ def match_all(str)
32
+ str.scan(@org_emphasis_regexp) do |match|
33
+ yield $2, $3
34
+ end
35
+ end
36
+ </pre>
@@ -1,53 +1,53 @@
1
- #+TITLE: advanced-code.org
2
- #+AUTHOR: Brian Dewey
3
- #+EMAIL: bdewey@gmail.com
4
- #+DATE: 2009-12-30 Wed
5
- #+DESCRIPTION: More types of code support
6
- #+KEYWORDS:
7
- #+LANGUAGE: en
8
- #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
9
- #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
10
- #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
11
- #+EXPORT_SELECT_TAGS: export
12
- #+EXPORT_EXCLUDE_TAGS: noexport
13
- #+LINK_UP:
14
- #+LINK_HOME:
15
-
16
- Turns out there's more way to do code than just BEGIN_EXAMPLE.
17
-
18
- * Inline examples
19
-
20
- This should work:
21
-
22
- : fixed width? how does this work?
23
- : ...........
24
- : ............
25
- : .
26
- : . . . .
27
- : . ..
28
- : ....... .....
29
- : . .
30
- : ....
31
-
32
- Two ASCII blobs.
33
-
34
- * BEGIN_SRC
35
- :PROPERTIES:
36
- :ARCHIVE_TIME: 2009-12-26 Sat 22:16
37
- :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
38
- :ARCHIVE_OLPATH: &lt;%= @page.title %&gt;/Future Development
39
- :ARCHIVE_CATEGORY: orgmode_parser
40
- :ARCHIVE_TODO: DONE
41
- :END:
42
-
43
- And this:
44
-
45
- #+BEGIN_SRC ruby
46
- # Finds all emphasis matches in a string.
47
- # Supply a block that will get the marker and body as parameters.
48
- def match_all(str)
49
- str.scan(@org_emphasis_regexp) do |match|
50
- yield $2, $3
51
- end
52
- end
53
- #+END_SRC
1
+ #+TITLE: advanced-code.org
2
+ #+AUTHOR: Brian Dewey
3
+ #+EMAIL: bdewey@gmail.com
4
+ #+DATE: 2009-12-30 Wed
5
+ #+DESCRIPTION: More types of code support
6
+ #+KEYWORDS:
7
+ #+LANGUAGE: en
8
+ #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
9
+ #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
10
+ #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
11
+ #+EXPORT_SELECT_TAGS: export
12
+ #+EXPORT_EXCLUDE_TAGS: noexport
13
+ #+LINK_UP:
14
+ #+LINK_HOME:
15
+
16
+ Turns out there's more way to do code than just BEGIN_EXAMPLE.
17
+
18
+ * Inline examples
19
+
20
+ This should work:
21
+
22
+ : fixed width? how does this work?
23
+ : ...........
24
+ : ............
25
+ : .
26
+ : . . . .
27
+ : . ..
28
+ : ....... .....
29
+ : . .
30
+ : ....
31
+
32
+ Two ASCII blobs.
33
+
34
+ * BEGIN_SRC
35
+ :PROPERTIES:
36
+ :ARCHIVE_TIME: 2009-12-26 Sat 22:16
37
+ :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
38
+ :ARCHIVE_OLPATH: &lt;%= @page.title %&gt;/Future Development
39
+ :ARCHIVE_CATEGORY: orgmode_parser
40
+ :ARCHIVE_TODO: DONE
41
+ :END:
42
+
43
+ And this:
44
+
45
+ #+BEGIN_SRC ruby
46
+ # Finds all emphasis matches in a string.
47
+ # Supply a block that will get the marker and body as parameters.
48
+ def match_all(str)
49
+ str.scan(@org_emphasis_regexp) do |match|
50
+ yield $2, $3
51
+ end
52
+ end
53
+ #+END_SRC
@@ -1,31 +1,31 @@
1
- <p class="title">Advanced Lists</p>
2
- <p><code>org-ruby</code> supports the following list features of <code>org-mode</code>:</p>
3
- <h1>Nested lists</h1>
4
- <ul>
5
- <li>You can have nested lists</li>
6
- <li>This is first-level</li>
7
- <ul>
8
- <li>This is a nested item</li>
9
- <li>This is another nested item</li>
10
- </ul>
11
- <li>Back to the first level</li>
12
- <li>Another first level item</li>
13
- <ol>
14
- <li>This is a numbered list nested within the unordered list</li>
15
- <li>This is another numbered item</li>
16
- </ol>
17
- </ul>
18
- <p>Note the list ends just some more text. Make sure both list blocks are closed.</p>
19
- <h1>Multi-paragraph list items</h1>
20
- <p>This list will end with the end-of-file. Make sure all blocks are closed.</p>
21
- <ul>
22
- <li>This is a list item</li>
23
- <li>This list item has multiple paragraphs.</li>
24
- <p>This is paragraph two.</p>
25
- <p>And paragraph three.</p>
26
- <li>Back to a list item.</li>
27
- <ul>
28
- <li>Nested, just for grins!</li>
29
- <li>woo hoo!</li>
30
- </ul>
31
- </ul>
1
+ <p class="title">Advanced Lists</p>
2
+ <p><code>org-ruby</code> supports the following list features of <code>org-mode</code>:</p>
3
+ <h1>Nested lists</h1>
4
+ <ul>
5
+ <li>You can have nested lists</li>
6
+ <li>This is first-level</li>
7
+ <ul>
8
+ <li>This is a nested item</li>
9
+ <li>This is another nested item</li>
10
+ </ul>
11
+ <li>Back to the first level</li>
12
+ <li>Another first level item</li>
13
+ <ol>
14
+ <li>This is a numbered list nested within the unordered list</li>
15
+ <li>This is another numbered item</li>
16
+ </ol>
17
+ </ul>
18
+ <p>Note the list ends just some more text. Make sure both list blocks are closed.</p>
19
+ <h1>Multi-paragraph list items</h1>
20
+ <p>This list will end with the end-of-file. Make sure all blocks are closed.</p>
21
+ <ul>
22
+ <li>This is a list item</li>
23
+ <li>This list item has multiple paragraphs.</li>
24
+ <p>This is paragraph two.</p>
25
+ <p>And paragraph three.</p>
26
+ <li>Back to a list item.</li>
27
+ <ul>
28
+ <li>Nested, just for grins!</li>
29
+ <li>woo hoo!</li>
30
+ </ul>
31
+ </ul>