org-ruby 0.3.0 → 0.4.0
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.
- data/.bnsignore +18 -0
- data/History.txt +40 -32
- data/README.txt +66 -66
- data/Rakefile +27 -26
- data/bin/org-ruby +40 -40
- data/lib/org-ruby.rb +50 -50
- data/lib/org-ruby/headline.rb +80 -75
- data/lib/org-ruby/html_output_buffer.rb +105 -81
- data/lib/org-ruby/line.rb +173 -173
- data/lib/org-ruby/output_buffer.rb +172 -154
- data/lib/org-ruby/parser.rb +80 -76
- data/lib/org-ruby/regexp_helper.rb +156 -156
- data/lib/org-ruby/textile_output_buffer.rb +67 -67
- data/spec/data/freeform.org +111 -111
- data/spec/data/hyp-planning.org +335 -335
- data/spec/data/remember.org +53 -53
- data/spec/headline_spec.rb +55 -55
- data/spec/html_examples/advanced-lists.html +31 -0
- data/spec/html_examples/advanced-lists.org +31 -0
- data/spec/html_examples/block_code.html +30 -30
- data/spec/html_examples/block_code.org +35 -35
- data/spec/html_examples/blockquote.html +7 -7
- data/spec/html_examples/blockquote.org +13 -13
- data/spec/html_examples/escape-pre.html +7 -7
- data/spec/html_examples/escape-pre.org +6 -6
- data/spec/html_examples/inline-formatting.html +10 -10
- data/spec/html_examples/inline-formatting.org +17 -17
- data/spec/html_examples/lists.html +19 -19
- data/spec/html_examples/lists.org +36 -36
- data/spec/html_examples/only-list.html +5 -5
- data/spec/html_examples/only-list.org +3 -3
- data/spec/html_examples/only-table.html +6 -6
- data/spec/html_examples/only-table.org +5 -5
- data/spec/html_examples/tables.html +20 -20
- data/spec/html_examples/tables.org +26 -26
- data/spec/html_examples/text.html +2 -2
- data/spec/html_examples/text.org +16 -16
- data/spec/line_spec.rb +89 -89
- data/spec/parser_spec.rb +86 -86
- data/spec/regexp_helper_spec.rb +57 -57
- data/spec/spec_helper.rb +20 -20
- data/spec/textile_examples/block_code.org +35 -35
- data/spec/textile_examples/block_code.textile +29 -29
- data/spec/textile_examples/blockquote.org +13 -13
- data/spec/textile_examples/blockquote.textile +11 -11
- data/spec/textile_examples/keywords.org +13 -13
- data/spec/textile_examples/keywords.textile +11 -11
- data/spec/textile_examples/links.org +11 -11
- data/spec/textile_examples/links.textile +10 -10
- data/spec/textile_examples/lists.org +36 -36
- data/spec/textile_examples/lists.textile +20 -20
- data/spec/textile_examples/single-space-plain-list.org +13 -13
- data/spec/textile_examples/single-space-plain-list.textile +10 -10
- data/spec/textile_examples/tables.org +26 -26
- data/spec/textile_examples/tables.textile +23 -23
- data/spec/textile_output_buffer_spec.rb +21 -21
- data/tasks/test_case.rake +49 -49
- metadata +5 -2
data/spec/data/remember.org
CHANGED
@@ -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
|
data/spec/headline_spec.rb
CHANGED
@@ -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
|
+
|
@@ -0,0 +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>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Advanced Lists
|
2
|
+
|
3
|
+
=org-ruby= supports the following list features of =org-mode=:
|
4
|
+
|
5
|
+
* Nested lists
|
6
|
+
|
7
|
+
- You can have nested lists
|
8
|
+
- This is first-level
|
9
|
+
- This is a nested item
|
10
|
+
- This is another nested item
|
11
|
+
- Back to the first level
|
12
|
+
- Another first level item
|
13
|
+
1. This is a numbered list nested within the unordered list
|
14
|
+
2. This is another numbered item
|
15
|
+
|
16
|
+
Note the list ends just some more text. Make sure both list blocks
|
17
|
+
are closed.
|
18
|
+
|
19
|
+
* Multi-paragraph list items
|
20
|
+
|
21
|
+
This list will end with the end-of-file. Make sure all blocks are closed.
|
22
|
+
|
23
|
+
- This is a list item
|
24
|
+
- This list item has multiple paragraphs.
|
25
|
+
|
26
|
+
This is paragraph two.
|
27
|
+
|
28
|
+
And paragraph three.
|
29
|
+
- Back to a list item.
|
30
|
+
- Nested, just for grins!
|
31
|
+
- woo hoo!
|
@@ -1,30 +1,30 @@
|
|
1
|
-
<h1>Block Code</h1>
|
2
|
-
<p>I need to get block code examples working. In <code>orgmode</code>, they look like this:</p>
|
3
|
-
<pre>
|
4
|
-
|
5
|
-
|
6
|
-
def initialize(output)
|
7
|
-
@output = output
|
8
|
-
@buffer = ""
|
9
|
-
@output_type = :start
|
10
|
-
@list_indent_stack = []
|
11
|
-
@paragraph_modifier = nil
|
12
|
-
|
13
|
-
@logger = Logger.new(STDERR)
|
14
|
-
@logger.level = Logger::WARN
|
15
|
-
end
|
16
|
-
|
17
|
-
</pre>
|
18
|
-
<p>And now I should be back to normal text.</p>
|
19
|
-
<p>Putting in another paragraph for good measure.</p>
|
20
|
-
<p>Code should also get cancelled by a list, thus:</p>
|
21
|
-
<pre>
|
22
|
-
|
23
|
-
This is my code!
|
24
|
-
|
25
|
-
Another line!
|
26
|
-
</pre>
|
27
|
-
<ul>
|
28
|
-
<li>My list should cancel this.</li>
|
29
|
-
<li>Another list line.</li>
|
30
|
-
</ul>
|
1
|
+
<h1 class="title">Block Code</h1>
|
2
|
+
<p>I need to get block code examples working. In <code>orgmode</code>, they look like this:</p>
|
3
|
+
<pre>
|
4
|
+
|
5
|
+
|
6
|
+
def initialize(output)
|
7
|
+
@output = output
|
8
|
+
@buffer = ""
|
9
|
+
@output_type = :start
|
10
|
+
@list_indent_stack = []
|
11
|
+
@paragraph_modifier = nil
|
12
|
+
|
13
|
+
@logger = Logger.new(STDERR)
|
14
|
+
@logger.level = Logger::WARN
|
15
|
+
end
|
16
|
+
|
17
|
+
</pre>
|
18
|
+
<p>And now I should be back to normal text.</p>
|
19
|
+
<p>Putting in another paragraph for good measure.</p>
|
20
|
+
<p>Code should also get cancelled by a list, thus:</p>
|
21
|
+
<pre>
|
22
|
+
|
23
|
+
This is my code!
|
24
|
+
|
25
|
+
Another line!
|
26
|
+
</pre>
|
27
|
+
<ul>
|
28
|
+
<li>My list should cancel this.</li>
|
29
|
+
<li>Another list line.</li>
|
30
|
+
</ul>
|
@@ -1,35 +1,35 @@
|
|
1
|
-
* Block Code
|
2
|
-
|
3
|
-
I need to get block code examples working. In =orgmode=, they look
|
4
|
-
like this:
|
5
|
-
|
6
|
-
#+BEGIN_EXAMPLE
|
7
|
-
|
8
|
-
def initialize(output)
|
9
|
-
@output = output
|
10
|
-
@buffer = ""
|
11
|
-
@output_type = :start
|
12
|
-
@list_indent_stack = []
|
13
|
-
@paragraph_modifier = nil
|
14
|
-
|
15
|
-
@logger = Logger.new(STDERR)
|
16
|
-
@logger.level = Logger::WARN
|
17
|
-
end
|
18
|
-
|
19
|
-
#+END_EXAMPLE
|
20
|
-
|
21
|
-
And now I should be back to normal text.
|
22
|
-
|
23
|
-
Putting in another paragraph for good measure.
|
24
|
-
|
25
|
-
|
26
|
-
Code should also get cancelled by a list, thus:
|
27
|
-
|
28
|
-
#+BEGIN_EXAMPLE
|
29
|
-
This is my code!
|
30
|
-
|
31
|
-
Another line!
|
32
|
-
#+END_EXAMPLE
|
33
|
-
|
34
|
-
- My list should cancel this.
|
35
|
-
- Another list line.
|
1
|
+
* Block Code
|
2
|
+
|
3
|
+
I need to get block code examples working. In =orgmode=, they look
|
4
|
+
like this:
|
5
|
+
|
6
|
+
#+BEGIN_EXAMPLE
|
7
|
+
|
8
|
+
def initialize(output)
|
9
|
+
@output = output
|
10
|
+
@buffer = ""
|
11
|
+
@output_type = :start
|
12
|
+
@list_indent_stack = []
|
13
|
+
@paragraph_modifier = nil
|
14
|
+
|
15
|
+
@logger = Logger.new(STDERR)
|
16
|
+
@logger.level = Logger::WARN
|
17
|
+
end
|
18
|
+
|
19
|
+
#+END_EXAMPLE
|
20
|
+
|
21
|
+
And now I should be back to normal text.
|
22
|
+
|
23
|
+
Putting in another paragraph for good measure.
|
24
|
+
|
25
|
+
|
26
|
+
Code should also get cancelled by a list, thus:
|
27
|
+
|
28
|
+
#+BEGIN_EXAMPLE
|
29
|
+
This is my code!
|
30
|
+
|
31
|
+
Another line!
|
32
|
+
#+END_EXAMPLE
|
33
|
+
|
34
|
+
- My list should cancel this.
|
35
|
+
- Another list line.
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<p>BLOCKQUOTE</p>
|
2
|
-
<p>Testing that I can have block quotes:</p>
|
3
|
-
<blockquote>
|
4
|
-
<p><i>Example:</i></p>
|
5
|
-
<p>This is blockquote text.</p>
|
6
|
-
</blockquote>
|
7
|
-
<p>And now I’m back to normal text!</p>
|
1
|
+
<p class="title">BLOCKQUOTE</p>
|
2
|
+
<p>Testing that I can have block quotes:</p>
|
3
|
+
<blockquote>
|
4
|
+
<p><i>Example:</i></p>
|
5
|
+
<p>This is blockquote text.</p>
|
6
|
+
</blockquote>
|
7
|
+
<p>And now I’m back to normal text!</p>
|
@@ -1,13 +1,13 @@
|
|
1
|
-
BLOCKQUOTE
|
2
|
-
|
3
|
-
Testing that I can have block quotes:
|
4
|
-
|
5
|
-
#+BEGIN_QUOTE
|
6
|
-
|
7
|
-
/Example:/
|
8
|
-
|
9
|
-
This is blockquote text.
|
10
|
-
|
11
|
-
#+END_QUOTE
|
12
|
-
|
13
|
-
And now I'm back to normal text!
|
1
|
+
BLOCKQUOTE
|
2
|
+
|
3
|
+
Testing that I can have block quotes:
|
4
|
+
|
5
|
+
#+BEGIN_QUOTE
|
6
|
+
|
7
|
+
/Example:/
|
8
|
+
|
9
|
+
This is blockquote text.
|
10
|
+
|
11
|
+
#+END_QUOTE
|
12
|
+
|
13
|
+
And now I'm back to normal text!
|