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
data/spec/spec_helper.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
|
2
|
-
require File.expand_path(
|
3
|
-
File.join(File.dirname(__FILE__), %w[.. lib org-ruby]))
|
4
|
-
|
5
|
-
|
6
|
-
RememberFile = File.join(File.dirname(__FILE__), %w[data remember.org])
|
7
|
-
FreeformFile = File.join(File.dirname(__FILE__), %w[data freeform.org])
|
8
|
-
FreeformExampleFile = File.join(File.dirname(__FILE__), %w[data freeform-example.org])
|
9
|
-
|
10
|
-
RSpec.configure do |config|
|
11
|
-
# == Mock Framework
|
12
|
-
#
|
13
|
-
# RSpec uses it's own mocking framework by default. If you prefer to
|
14
|
-
# use mocha, flexmock or RR, uncomment the appropriate line:
|
15
|
-
#
|
16
|
-
# config.mock_with :mocha
|
17
|
-
# config.mock_with :flexmock
|
18
|
-
# config.mock_with :rr
|
19
|
-
end
|
20
|
-
|
@@ -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,29 +0,0 @@
|
|
1
|
-
h1. Block Code
|
2
|
-
|
3
|
-
I need to get block code examples working. In @orgmode@, they look like this:
|
4
|
-
|
5
|
-
bc..
|
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
|
-
|
18
|
-
p. And now I should be back to normal text.
|
19
|
-
|
20
|
-
Putting in another paragraph for good measure.
|
21
|
-
|
22
|
-
Code should also get cancelled by a list, thus:
|
23
|
-
|
24
|
-
bc.. This is my code!
|
25
|
-
|
26
|
-
Another line!
|
27
|
-
|
28
|
-
* My list should cancel this.
|
29
|
-
* Another list line.
|
@@ -1,13 +0,0 @@
|
|
1
|
-
KEYWORDS
|
2
|
-
|
3
|
-
By default, I don't want keywords exported to textile.
|
4
|
-
|
5
|
-
* DONE Recognize standard keywords
|
6
|
-
CLOSED: [2009-12-21 Mon 15:23]
|
7
|
-
|
8
|
-
The standard =orgmode= keywords are TODO and DONE. Recognize those.
|
9
|
-
|
10
|
-
* TODO Recongize buffer-specific keywords
|
11
|
-
|
12
|
-
There's a way to define a custom keyword list in a buffer. Research
|
13
|
-
that and handle it.
|
@@ -1,11 +0,0 @@
|
|
1
|
-
KEYWORDS
|
2
|
-
|
3
|
-
By default, I don't want keywords exported to textile.
|
4
|
-
|
5
|
-
h1. Recognize standard keywords
|
6
|
-
|
7
|
-
The standard @orgmode@ keywords are TODO and DONE. Recognize those.
|
8
|
-
|
9
|
-
h1. Recongize buffer-specific keywords
|
10
|
-
|
11
|
-
There's a way to define a custom keyword list in a buffer. Research that and handle it.
|
@@ -1,10 +0,0 @@
|
|
1
|
-
LINKS
|
2
|
-
|
3
|
-
"http://www.bing.com":http://www.bing.com
|
4
|
-
|
5
|
-
h1. Supported Link Styles
|
6
|
-
|
7
|
-
* "http://www.hotmail.com":http://www.hotmail.com => Simple
|
8
|
-
* "Hotmail":http://www.hotmail.com => With link text
|
9
|
-
* "with spaces":http://url/with%20spaces
|
10
|
-
* "http://url/with spaces":http://url/with%20spaces
|
@@ -1,36 +0,0 @@
|
|
1
|
-
* Lists
|
2
|
-
|
3
|
-
I want to make sure I have great support for lists.
|
4
|
-
|
5
|
-
- This is an unordered list
|
6
|
-
- This continues the unordered list
|
7
|
-
|
8
|
-
And this is a paragraph *after* the list.
|
9
|
-
|
10
|
-
** Wrapping within the list
|
11
|
-
|
12
|
-
- This is a single-line list item in the org file.
|
13
|
-
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
|
14
|
-
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
|
15
|
-
erat, sed diam voluptua. At vero eos et accusam et justo duo
|
16
|
-
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
|
17
|
-
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
|
18
|
-
amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
|
19
|
-
invidunt ut labore et dolore magna aliquyam erat, sed diam
|
20
|
-
voluptua. At vero eos et accusam et justo duo dolores et ea
|
21
|
-
rebum. Stet clita kasd gubergren, no sea takimata sanctus est
|
22
|
-
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
|
23
|
-
consetetur sadipscing elitr, sed diam nonumy eirmod tempor
|
24
|
-
invidunt ut labore et dolore magna aliquyam erat, sed diam
|
25
|
-
voluptua. At vero eos et accusam et justo duo dolores et ea
|
26
|
-
rebum. Stet clita kasd gubergren, no sea takimata sanctus est
|
27
|
-
Lorem ipsum dolor sit amet.
|
28
|
-
- And this is the next item. The previous item needs to be on one
|
29
|
-
line to keep =textile= happy.
|
30
|
-
- Ditto the previous line, actually.
|
31
|
-
|
32
|
-
** Edge cases
|
33
|
-
|
34
|
-
- This is a single-line list.
|
35
|
-
And this is a *separate paragraph.* Note the indentation in the org
|
36
|
-
file.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
h1. Lists
|
2
|
-
|
3
|
-
I want to make sure I have great support for lists.
|
4
|
-
|
5
|
-
* This is an unordered list
|
6
|
-
* This continues the unordered list
|
7
|
-
|
8
|
-
And this is a paragraph *after* the list.
|
9
|
-
|
10
|
-
h2. Wrapping within the list
|
11
|
-
|
12
|
-
* This is a single-line list item in the org file.
|
13
|
-
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
14
|
-
* And this is the next item. The previous item needs to be on one line to keep @textile@ happy.
|
15
|
-
* Ditto the previous line, actually.
|
16
|
-
|
17
|
-
h2. Edge cases
|
18
|
-
|
19
|
-
* This is a single-line list.
|
20
|
-
And this is a *separate paragraph.* Note the indentation in the org file.
|
@@ -1,13 +0,0 @@
|
|
1
|
-
** Anatomy of a BVP
|
2
|
-
|
3
|
-
Each BVP followed a simple, one-page template with the following
|
4
|
-
parts:
|
5
|
-
|
6
|
-
- Customer Summary
|
7
|
-
- Storyboard
|
8
|
-
- Requirements
|
9
|
-
- Partner teams
|
10
|
-
|
11
|
-
The following sections walk through each section and give an
|
12
|
-
example from one of our BVPs, [[http://windows/hyper-v/initiatives/Value Propositions/DynamicDatacenter-ValueProp.docx][Resource-Smart Virtualization
|
13
|
-
Infrastructure]] (also called /Dynamic Datacenter/).
|
@@ -1,10 +0,0 @@
|
|
1
|
-
h2. Anatomy of a BVP
|
2
|
-
|
3
|
-
Each BVP followed a simple, one-page template with the following parts:
|
4
|
-
|
5
|
-
* Customer Summary
|
6
|
-
* Storyboard
|
7
|
-
* Requirements
|
8
|
-
* Partner teams
|
9
|
-
|
10
|
-
The following sections walk through each section and give an example from one of our BVPs, "Resource-Smart Virtualization Infrastructure":http://windows/hyper-v/initiatives/Value%20Propositions/DynamicDatacenter-ValueProp.docx (also called _Dynamic Datacenter_).
|
@@ -1,50 +0,0 @@
|
|
1
|
-
TABLES
|
2
|
-
|
3
|
-
Different types of ORG tables.
|
4
|
-
|
5
|
-
* Simple table, no header.
|
6
|
-
|
7
|
-
| Cell one | Cell two |
|
8
|
-
| Cell three | Cell four |
|
9
|
-
|
10
|
-
|
11
|
-
* Indented table
|
12
|
-
|
13
|
-
| Cell one |
|
14
|
-
| Cell two |
|
15
|
-
|
16
|
-
And here's some paragraph content. The line breaks will need to get
|
17
|
-
removed here, but not for the tables.
|
18
|
-
|
19
|
-
* Table with header
|
20
|
-
|
21
|
-
| One | Two | Three |
|
22
|
-
|-------+-------+-------|
|
23
|
-
| Four | Five | Six |
|
24
|
-
| Seven | Eight | Nine |
|
25
|
-
|
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.
|
@@ -1,40 +0,0 @@
|
|
1
|
-
TABLES
|
2
|
-
|
3
|
-
Different types of ORG tables.
|
4
|
-
|
5
|
-
h1. Simple table, no header.
|
6
|
-
|
7
|
-
| Cell one | Cell two |
|
8
|
-
| Cell three | Cell four |
|
9
|
-
|
10
|
-
h1. Indented table
|
11
|
-
|
12
|
-
| Cell one |
|
13
|
-
| Cell two |
|
14
|
-
|
15
|
-
And here's some paragraph content. The line breaks will need to get removed here, but not for the tables.
|
16
|
-
|
17
|
-
h1. Table with header
|
18
|
-
|
19
|
-
| One | Two | Three |
|
20
|
-
| Four | Five | Six |
|
21
|
-
| Seven | Eight | Nine |
|
22
|
-
|
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.
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), %w[spec_helper])
|
2
|
-
|
3
|
-
describe Orgmode::TextileOutputBuffer do
|
4
|
-
it "should substitute / with _" do
|
5
|
-
Orgmode::TextileOutputBuffer.new("").inline_formatting("/italic/").should eql("_italic_")
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should convert simple links" do
|
9
|
-
Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com]]").should \
|
10
|
-
eql("\"http://www.google.com\":http://www.google.com")
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should convert links with text" do
|
14
|
-
Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com][Google]]").should \
|
15
|
-
eql("\"Google\":http://www.google.com")
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should convert spaces in urls" do
|
19
|
-
Orgmode::TextileOutputBuffer.new("").inline_formatting("[[my url]]").should eql("\"my url\":my%20url")
|
20
|
-
end
|
21
|
-
end
|
data/tasks/test_case.rake
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require File.expand_path(
|
2
|
-
File.join(File.dirname(__FILE__), %w[.. lib org-ruby]))
|
3
|
-
|
4
|
-
namespace :testcase do
|
5
|
-
@data_directory = File.join(File.dirname(__FILE__), "../spec/html_examples")
|
6
|
-
|
7
|
-
desc "List all of the current HTML test cases"
|
8
|
-
task :list do
|
9
|
-
org_files = File.expand_path(File.join(@data_directory, "*.org" ))
|
10
|
-
files = Dir.glob(org_files)
|
11
|
-
files.each do |file|
|
12
|
-
puts File.basename(file, ".org")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
desc "Accept the current org-ruby output for the test case as correct"
|
17
|
-
task :accept, :case do |t, args|
|
18
|
-
basename = args[:case]
|
19
|
-
raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
|
20
|
-
fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
|
21
|
-
oname = File.expand_path(File.join(@data_directory, "#{basename}.html"))
|
22
|
-
data = IO.read(fname)
|
23
|
-
puts "=== #{fname} is: ===>>>\n\n"
|
24
|
-
puts data
|
25
|
-
puts "\n\n=== ACCEPTING OUTPUT: ===>>>\n\n"
|
26
|
-
p = Orgmode::Parser.new(data)
|
27
|
-
puts p.to_html
|
28
|
-
File.open(oname, "w") do |s|
|
29
|
-
s.write(p.to_html)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "Look at the current org-ruby output for a test case"
|
34
|
-
task :inspect, :case do |t, args|
|
35
|
-
basename = args[:case]
|
36
|
-
raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
|
37
|
-
fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
|
38
|
-
data = IO.read(fname)
|
39
|
-
puts "=== #{fname} is: ===>>>\n\n"
|
40
|
-
puts data
|
41
|
-
puts "\n\n=== #{fname} converts to: ===>>>\n\n"
|
42
|
-
p = Orgmode::Parser.new(data)
|
43
|
-
puts p.to_html
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
desc "Alias for testcase:list"
|
48
|
-
task :testcase => ["testcase:list"]
|
49
|
-
|