org-ruby 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/bin/org-ruby +11 -5
- data/lib/org-ruby.rb +21 -23
- data/lib/org-ruby/headline.rb +0 -2
- data/lib/org-ruby/html_output_buffer.rb +60 -19
- data/lib/org-ruby/line.rb +9 -9
- data/lib/org-ruby/output_buffer.rb +9 -9
- data/lib/org-ruby/parser.rb +4 -1
- data/lib/org-ruby/regexp_helper.rb +3 -3
- metadata +66 -153
- data/.bnsignore +0 -18
- data/.gitignore +0 -2
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -36
- data/Rakefile +0 -26
- data/TAGS +0 -133
- data/announcement.txt +0 -19
- data/org-ruby.gemspec +0 -37
- data/spec/data/freeform-example.org +0 -113
- data/spec/data/freeform.org +0 -111
- data/spec/data/hyp-planning.org +0 -335
- data/spec/data/remember.org +0 -53
- data/spec/headline_spec.rb +0 -65
- data/spec/html_examples/advanced-code.html +0 -81
- data/spec/html_examples/advanced-code.org +0 -106
- data/spec/html_examples/advanced-lists.html +0 -31
- data/spec/html_examples/advanced-lists.org +0 -31
- data/spec/html_examples/block_code.html +0 -28
- data/spec/html_examples/block_code.org +0 -35
- data/spec/html_examples/blockcomment.html +0 -3
- data/spec/html_examples/blockcomment.org +0 -15
- data/spec/html_examples/blockquote.html +0 -7
- data/spec/html_examples/blockquote.org +0 -13
- data/spec/html_examples/center.html +0 -6
- data/spec/html_examples/center.org +0 -7
- data/spec/html_examples/code-comment.html +0 -18
- data/spec/html_examples/code-comment.org +0 -22
- data/spec/html_examples/comment-trees.html +0 -4
- data/spec/html_examples/comment-trees.org +0 -13
- data/spec/html_examples/custom-seq-todo.html +0 -15
- data/spec/html_examples/custom-seq-todo.org +0 -24
- data/spec/html_examples/custom-todo.html +0 -15
- data/spec/html_examples/custom-todo.org +0 -24
- data/spec/html_examples/custom-typ-todo.html +0 -15
- data/spec/html_examples/custom-typ-todo.org +0 -24
- data/spec/html_examples/deflist.html +0 -6
- data/spec/html_examples/deflist.org +0 -6
- data/spec/html_examples/entities.html +0 -4
- data/spec/html_examples/entities.org +0 -11
- data/spec/html_examples/escape-pre.html +0 -6
- data/spec/html_examples/escape-pre.org +0 -6
- data/spec/html_examples/export-exclude-only.html +0 -13
- data/spec/html_examples/export-exclude-only.org +0 -81
- data/spec/html_examples/export-keywords.html +0 -4
- data/spec/html_examples/export-keywords.org +0 -18
- data/spec/html_examples/export-tags.html +0 -8
- data/spec/html_examples/export-tags.org +0 -82
- data/spec/html_examples/export-title.html +0 -2
- data/spec/html_examples/export-title.org +0 -4
- data/spec/html_examples/footnotes.html +0 -10
- data/spec/html_examples/footnotes.org +0 -7
- data/spec/html_examples/horizontal_rule.html +0 -4
- data/spec/html_examples/horizontal_rule.org +0 -5
- data/spec/html_examples/html-literal.html +0 -2
- data/spec/html_examples/html-literal.org +0 -6
- data/spec/html_examples/inline-formatting.html +0 -25
- data/spec/html_examples/inline-formatting.org +0 -43
- data/spec/html_examples/inline-images.html +0 -10
- data/spec/html_examples/inline-images.org +0 -15
- data/spec/html_examples/link-features.html +0 -20
- data/spec/html_examples/link-features.org +0 -35
- data/spec/html_examples/lists.html +0 -23
- data/spec/html_examples/lists.org +0 -47
- data/spec/html_examples/metadata-comment.html +0 -27
- data/spec/html_examples/metadata-comment.org +0 -30
- data/spec/html_examples/only-list.html +0 -5
- data/spec/html_examples/only-list.org +0 -3
- data/spec/html_examples/only-table.html +0 -6
- data/spec/html_examples/only-table.org +0 -5
- data/spec/html_examples/skip-header.html +0 -3
- data/spec/html_examples/skip-header.org +0 -28
- data/spec/html_examples/skip-table.html +0 -4
- data/spec/html_examples/skip-table.org +0 -19
- data/spec/html_examples/subsupscript-nil.html +0 -3
- data/spec/html_examples/subsupscript-nil.org +0 -6
- data/spec/html_examples/subsupscript.html +0 -3
- data/spec/html_examples/subsupscript.org +0 -5
- data/spec/html_examples/tables.html +0 -35
- data/spec/html_examples/tables.org +0 -50
- data/spec/html_examples/text.html +0 -2
- data/spec/html_examples/text.org +0 -16
- data/spec/line_spec.rb +0 -162
- data/spec/output_buffer_spec.rb +0 -19
- data/spec/parser_spec.rb +0 -158
- data/spec/regexp_helper_spec.rb +0 -57
- data/spec/spec_helper.rb +0 -20
- data/spec/textile_examples/block_code.org +0 -35
- data/spec/textile_examples/block_code.textile +0 -29
- data/spec/textile_examples/blockquote.org +0 -13
- data/spec/textile_examples/blockquote.textile +0 -11
- data/spec/textile_examples/center.org +0 -7
- data/spec/textile_examples/center.textile +0 -6
- data/spec/textile_examples/footnotes.org +0 -7
- data/spec/textile_examples/footnotes.textile +0 -8
- data/spec/textile_examples/keywords.org +0 -13
- data/spec/textile_examples/keywords.textile +0 -11
- data/spec/textile_examples/links.org +0 -11
- data/spec/textile_examples/links.textile +0 -10
- data/spec/textile_examples/lists.org +0 -36
- data/spec/textile_examples/lists.textile +0 -20
- data/spec/textile_examples/single-space-plain-list.org +0 -13
- data/spec/textile_examples/single-space-plain-list.textile +0 -10
- data/spec/textile_examples/tables.org +0 -50
- data/spec/textile_examples/tables.textile +0 -40
- data/spec/textile_output_buffer_spec.rb +0 -21
- data/tasks/test_case.rake +0 -49
- data/util/gen-special-replace.el +0 -37
@@ -1,81 +0,0 @@
|
|
1
|
-
<p class="title">advanced-code.org</p>
|
2
|
-
<p>Turns out there’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
|
-
<p>And this:</p>
|
19
|
-
<pre class="src">
|
20
|
-
<code class="ruby">
|
21
|
-
# Finds all emphasis matches in a string.
|
22
|
-
# Supply a block that will get the marker and body as parameters.
|
23
|
-
def match_all(str)
|
24
|
-
str.scan(@org_emphasis_regexp) do |match|
|
25
|
-
yield $2, $3
|
26
|
-
end
|
27
|
-
end
|
28
|
-
</code>
|
29
|
-
</pre>
|
30
|
-
<p>Now let’s test case-insensitive code blocks.</p>
|
31
|
-
<pre class="src">
|
32
|
-
<code class="ruby">
|
33
|
-
# Finds all emphasis matches in a string.
|
34
|
-
# Supply a block that will get the marker and body as parameters.
|
35
|
-
def match_all(str)
|
36
|
-
str.scan(@org_emphasis_regexp) do |match|
|
37
|
-
yield $2, $3
|
38
|
-
end
|
39
|
-
end
|
40
|
-
</code>
|
41
|
-
</pre>
|
42
|
-
<pre class="src">
|
43
|
-
<code class="clojure">
|
44
|
-
(def fib-seq
|
45
|
-
(concat
|
46
|
-
[0 1]
|
47
|
-
((fn rfib [a b]
|
48
|
-
(lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
|
49
|
-
|
50
|
-
user> (take 20 fib-seq)
|
51
|
-
(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)
|
52
|
-
</code>
|
53
|
-
</pre>
|
54
|
-
<p>Even if no language is set, it is still wrapped in code tags but class is empty.</p>
|
55
|
-
<pre class="src">
|
56
|
-
<code class="">
|
57
|
-
echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers
|
58
|
-
</code>
|
59
|
-
</pre>
|
60
|
-
<h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example</h1>
|
61
|
-
<blockquote>
|
62
|
-
<p>I really love to write about :symbols. They sure are the best things in the world!</p>
|
63
|
-
</blockquote>
|
64
|
-
<pre class="src">
|
65
|
-
<code class="ruby">
|
66
|
-
{
|
67
|
-
:one => 1,
|
68
|
-
:two => 2
|
69
|
-
}
|
70
|
-
</code>
|
71
|
-
</pre>
|
72
|
-
<pre class="src">
|
73
|
-
<code class="clojure">
|
74
|
-
(defproject helloworld "0.1"
|
75
|
-
:dependencies [[org.clojure/clojure
|
76
|
-
"1.1.0-master-SNAPSHOT"]
|
77
|
-
[org.clojure/clojure-contrib
|
78
|
-
"1.0-SNAPSHOT"]]
|
79
|
-
:main helloworld)
|
80
|
-
</code>
|
81
|
-
</pre>
|
@@ -1,106 +0,0 @@
|
|
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: <%= @page.title %>/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
|
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
|
-
|
67
|
-
#+begin_src clojure
|
68
|
-
(def fib-seq
|
69
|
-
(concat
|
70
|
-
[0 1]
|
71
|
-
((fn rfib [a b]
|
72
|
-
(lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
|
73
|
-
|
74
|
-
user> (take 20 fib-seq)
|
75
|
-
(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)
|
76
|
-
#+end_src
|
77
|
-
|
78
|
-
Even if no language is set, it is still wrapped in code tags but class is empty.
|
79
|
-
|
80
|
-
#+BEGIN_SRC
|
81
|
-
echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers
|
82
|
-
#+END_SRC
|
83
|
-
|
84
|
-
* It should be possible to write a colon at the beginning of an example
|
85
|
-
|
86
|
-
#+BEGIN_QUOTE
|
87
|
-
I really love to write about
|
88
|
-
:symbols. They sure are the
|
89
|
-
best things in the world!
|
90
|
-
#+END_QUOTE
|
91
|
-
|
92
|
-
#+BEGIN_SRC ruby
|
93
|
-
{
|
94
|
-
:one => 1,
|
95
|
-
:two => 2
|
96
|
-
}
|
97
|
-
#+END_SRC
|
98
|
-
|
99
|
-
#+BEGIN_SRC clojure
|
100
|
-
(defproject helloworld "0.1"
|
101
|
-
:dependencies [[org.clojure/clojure
|
102
|
-
"1.1.0-master-SNAPSHOT"]
|
103
|
-
[org.clojure/clojure-contrib
|
104
|
-
"1.0-SNAPSHOT"]]
|
105
|
-
:main helloworld)
|
106
|
-
#+END_SRC
|
@@ -1,31 +0,0 @@
|
|
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,31 +0,0 @@
|
|
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,28 +0,0 @@
|
|
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 class="example">
|
4
|
-
|
5
|
-
def initialize(output)
|
6
|
-
@output = output
|
7
|
-
@buffer = ""
|
8
|
-
@output_type = :start
|
9
|
-
@list_indent_stack = []
|
10
|
-
@paragraph_modifier = nil
|
11
|
-
|
12
|
-
@logger = Logger.new(STDERR)
|
13
|
-
@logger.level = Logger::WARN
|
14
|
-
end
|
15
|
-
|
16
|
-
</pre>
|
17
|
-
<p>And now I should be back to normal text.</p>
|
18
|
-
<p>Putting in another paragraph for good measure.</p>
|
19
|
-
<p>Code should also get cancelled by a list, thus:</p>
|
20
|
-
<pre class="example">
|
21
|
-
This is my code!
|
22
|
-
|
23
|
-
Another line!
|
24
|
-
</pre>
|
25
|
-
<ul>
|
26
|
-
<li>My list should cancel this.</li>
|
27
|
-
<li>Another list line.</li>
|
28
|
-
</ul>
|
@@ -1,35 +0,0 @@
|
|
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,18 +0,0 @@
|
|
1
|
-
<h1 class="title">Code Comment</h1>
|
2
|
-
<p>I need to be able to export things that look like org-mode comments inside of code blocks, like this:</p>
|
3
|
-
<pre class="example">
|
4
|
-
#+TITLE: orgmode_parser.org
|
5
|
-
#+AUTHOR:
|
6
|
-
#+EMAIL: brian@BRIAN-DESK
|
7
|
-
#+DATE: 2009-12-29 Tue
|
8
|
-
#+DESCRIPTION:
|
9
|
-
#+KEYWORDS:
|
10
|
-
#+LANGUAGE: en
|
11
|
-
#+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
|
12
|
-
#+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
|
13
|
-
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
|
14
|
-
#+EXPORT_SELECT_TAGS: export
|
15
|
-
#+EXPORT_EXCLUDE_TAGS: noexport
|
16
|
-
#+LINK_UP:
|
17
|
-
#+LINK_HOME:
|
18
|
-
</pre>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
* Code Comment
|
2
|
-
|
3
|
-
I need to be able to export things that look like org-mode comments
|
4
|
-
inside of code blocks, like this:
|
5
|
-
|
6
|
-
#+BEGIN_EXAMPLE
|
7
|
-
#+TITLE: orgmode_parser.org
|
8
|
-
#+AUTHOR:
|
9
|
-
#+EMAIL: brian@BRIAN-DESK
|
10
|
-
#+DATE: 2009-12-29 Tue
|
11
|
-
#+DESCRIPTION:
|
12
|
-
#+KEYWORDS:
|
13
|
-
#+LANGUAGE: en
|
14
|
-
#+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
|
15
|
-
#+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
|
16
|
-
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
|
17
|
-
#+EXPORT_SELECT_TAGS: export
|
18
|
-
#+EXPORT_EXCLUDE_TAGS: noexport
|
19
|
-
#+LINK_UP:
|
20
|
-
#+LINK_HOME:
|
21
|
-
#+END_EXAMPLE
|
22
|
-
|
@@ -1,13 +0,0 @@
|
|
1
|
-
* This headline is in the output
|
2
|
-
* COMMENT Commented headline should not be in the output
|
3
|
-
This should not be in the output either.
|
4
|
-
** This should not be in the output.
|
5
|
-
*** Neither this
|
6
|
-
**** nor this
|
7
|
-
** Not in the output
|
8
|
-
* This is in the output
|
9
|
-
** COMMENT But this is not
|
10
|
-
This is not in the output
|
11
|
-
*** Neither is this
|
12
|
-
** Yet, this is in the output
|
13
|
-
and this is also part of the output
|