├── .gitignore
├── .travis.yml
├── Gemfile
├── History.txt
├── README.rdoc
├── Rakefile
├── bench
├── Gemfile
├── Gemfile_6_0
├── Gemfile_6_1
├── Gemfile_6_2
├── Gemfile_6_3
├── Gemfile_redcarpet
├── bench.org
├── parsing_redcarpet_test.rb
└── parsing_test.rb
├── bin
└── org-ruby
├── lib
├── org-ruby.rb
└── org-ruby
│ ├── headline.rb
│ ├── html_output_buffer.rb
│ ├── html_symbol_replace.rb
│ ├── line.rb
│ ├── markdown_output_buffer.rb
│ ├── output_buffer.rb
│ ├── parser.rb
│ ├── regexp_helper.rb
│ ├── textile_output_buffer.rb
│ ├── textile_symbol_replace.rb
│ ├── tilt.rb
│ └── version.rb
├── org-ruby.gemspec
├── spec
├── data
│ ├── freeform-example.org
│ ├── freeform.org
│ ├── hyp-planning.org
│ ├── remember.org
│ └── tables.org
├── headline_spec.rb
├── html_code_syntax_highlight_examples
│ ├── advanced-code-coderay.html
│ ├── advanced-code-coderay.org
│ ├── advanced-code-no-color.html
│ ├── advanced-code-no-color.org
│ ├── advanced-code-pygments.html
│ ├── advanced-code-pygments.org
│ ├── code-coderay.html
│ ├── code-coderay.org
│ ├── code-no-color.html
│ ├── code-no-color.org
│ ├── code-pygments.html
│ ├── code-pygments.org
│ ├── prepended-comma-coderay.html
│ ├── prepended-comma-coderay.org
│ ├── prepended-comma-no-color.html
│ ├── prepended-comma-no-color.org
│ ├── prepended-comma-pygments.html
│ ├── prepended-comma-pygments.org
│ ├── src-code-list-coderay.html
│ ├── src-code-list-coderay.org
│ ├── src-code-list-no-color.html
│ ├── src-code-list-no-color.org
│ ├── src-code-list-pygments.html
│ └── src-code-list-pygments.org
├── html_examples
│ ├── advanced-lists.html
│ ├── advanced-lists.org
│ ├── block_code.html
│ ├── block_code.org
│ ├── blockcomment.html
│ ├── blockcomment.org
│ ├── blockquote.html
│ ├── blockquote.org
│ ├── center.html
│ ├── center.org
│ ├── code-block-lists.html
│ ├── code-block-lists.org
│ ├── code-comment.html
│ ├── code-comment.org
│ ├── code-lists.html
│ ├── code-lists.org
│ ├── comment-trees.html
│ ├── comment-trees.org
│ ├── custom-seq-todo.html
│ ├── custom-seq-todo.org
│ ├── custom-todo.html
│ ├── custom-todo.org
│ ├── custom-typ-todo.html
│ ├── custom-typ-todo.org
│ ├── deflist.html
│ ├── deflist.org
│ ├── emphasis.html
│ ├── emphasis.org
│ ├── entities.html
│ ├── entities.org
│ ├── escape-pre.html
│ ├── escape-pre.org
│ ├── export-exclude-only.html
│ ├── export-exclude-only.org
│ ├── export-keywords.html
│ ├── export-keywords.org
│ ├── export-tags.html
│ ├── export-tags.org
│ ├── export-title.html
│ ├── export-title.org
│ ├── footnotes.html
│ ├── footnotes.org
│ ├── horizontal_rule.html
│ ├── horizontal_rule.org
│ ├── html-literal.html
│ ├── html-literal.org
│ ├── include-file-disabled.html
│ ├── include-file.html
│ ├── include-file.org
│ ├── inline-formatting.html
│ ├── inline-formatting.org
│ ├── inline-images.html
│ ├── inline-images.org
│ ├── link-features.html
│ ├── link-features.org
│ ├── lists.html
│ ├── lists.org
│ ├── metadata-comment.html
│ ├── metadata-comment.org
│ ├── only-list.html
│ ├── only-list.org
│ ├── only-table.html
│ ├── only-table.org
│ ├── prepended-comma.html
│ ├── prepended-comma.org
│ ├── properties_drawer.html
│ ├── properties_drawer.org
│ ├── raw-html.html
│ ├── raw-html.org
│ ├── skip-header.html
│ ├── skip-header.org
│ ├── skip-table.html
│ ├── skip-table.org
│ ├── subsupscript-nil.html
│ ├── subsupscript-nil.org
│ ├── subsupscript.html
│ ├── subsupscript.org
│ ├── tables.html
│ ├── tables.org
│ ├── text.html
│ └── text.org
├── line_spec.rb
├── markdown_examples
│ ├── advanced-lists.md
│ ├── advanced-lists.org
│ ├── block_code.md
│ ├── block_code.org
│ ├── blockcomment.md
│ ├── blockcomment.org
│ ├── blockquote.md
│ ├── blockquote.org
│ ├── center.md
│ ├── center.org
│ ├── code-block-lists.md
│ ├── code-block-lists.org
│ ├── code-comment.md
│ ├── code-comment.org
│ ├── code-lists.md
│ ├── code-lists.org
│ ├── comment-trees.md
│ ├── comment-trees.org
│ ├── custom-seq-todo.md
│ ├── custom-seq-todo.org
│ ├── custom-todo.md
│ ├── custom-todo.org
│ ├── custom-typ-todo.md
│ ├── custom-typ-todo.org
│ ├── deflist.md
│ ├── deflist.org
│ ├── emphasis.md
│ ├── emphasis.org
│ ├── entities.md
│ ├── entities.org
│ ├── escape-pre.md
│ ├── escape-pre.org
│ ├── export-exclude-only.md
│ ├── export-exclude-only.org
│ ├── export-keywords.md
│ ├── export-keywords.org
│ ├── export-tags.md
│ ├── export-tags.org
│ ├── export-title.md
│ ├── export-title.org
│ ├── footnotes.md
│ ├── footnotes.org
│ ├── horizontal_rule.md
│ ├── horizontal_rule.org
│ ├── html-literal.md
│ ├── html-literal.org
│ ├── include-file.md
│ ├── include-file.org
│ ├── inline-formatting.md
│ ├── inline-formatting.org
│ ├── inline-images.md
│ ├── inline-images.org
│ ├── link-features.md
│ ├── link-features.org
│ ├── lists.md
│ ├── lists.org
│ ├── metadata-comment.md
│ ├── metadata-comment.org
│ ├── only-list.md
│ ├── only-list.org
│ ├── only-table.md
│ ├── only-table.org
│ ├── prepended-comma.md
│ ├── prepended-comma.org
│ ├── properties_drawer.md
│ ├── properties_drawer.org
│ ├── raw-html.md
│ ├── raw-html.org
│ ├── skip-header.md
│ ├── skip-header.org
│ ├── skip-table.md
│ ├── skip-table.org
│ ├── subsupscript-nil.md
│ ├── subsupscript-nil.org
│ ├── subsupscript.md
│ ├── subsupscript.org
│ ├── tables.md
│ ├── tables.org
│ ├── text.md
│ └── text.org
├── output_buffer_spec.rb
├── parser_spec.rb
├── regexp_helper_spec.rb
├── spec_helper.rb
├── textile_examples
│ ├── block_code.org
│ ├── block_code.textile
│ ├── blockquote.org
│ ├── blockquote.textile
│ ├── center.org
│ ├── center.textile
│ ├── footnotes.org
│ ├── footnotes.textile
│ ├── keywords.org
│ ├── keywords.textile
│ ├── links.org
│ ├── links.textile
│ ├── lists.org
│ ├── lists.textile
│ ├── single-space-plain-list.org
│ ├── single-space-plain-list.textile
│ ├── tables.org
│ └── tables.textile
└── textile_output_buffer_spec.rb
├── tasks
└── test_case.rake
└── util
└── gen-special-replace.el
/.gitignore:
--------------------------------------------------------------------------------
1 | *.tmproj
2 | /util/gen-special-replace.elc
3 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | rvm:
2 | - 1.9.3
3 | - 2.0.0
4 | notifications:
5 | disabled: true
6 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gemspec
4 |
5 | group :development, :test do
6 | gem 'rake'
7 | gem 'rspec'
8 | gem 'tilt'
9 | end
10 |
11 | group :coderay do
12 | gem 'coderay'
13 | end
14 |
15 | group :pygments do
16 | gem 'pygments.rb'
17 | end
18 |
--------------------------------------------------------------------------------
/README.rdoc:
--------------------------------------------------------------------------------
1 | = org-ruby
2 | Originally by Brian Dewey (http://github.com/bdewey/org-ruby)
3 |
4 | {}[http://travis-ci.org/wallyqs/org-ruby]
5 |
6 | Note: The project has moved. Further development is done at {wallyqs/org-ruby}[https://github.com/wallyqs/org-ruby]
7 | Thanks Brian!
8 |
9 | == Description
10 |
11 | An {org-mode}[http://orgmode.org] parser written in Ruby. The most significant thing this library does today is convert org-mode files to HTML or Textile.
12 | Currently, you cannot do much to customize the conversion. The supplied textile conversion is optimized for extracting
13 | “content” from the orgfile as opposed to “metadata.”
14 |
15 | == Installation
16 |
17 | gem install org-ruby
18 |
19 | == Usage
20 |
21 | From Ruby code:
22 |
23 | require 'org-ruby'
24 |
25 | # Renders HTML
26 | Orgmode::Parser.new("* Hello world!").to_html
27 | # => "
advanced-code.org
2 |Turns out there’s more way to do code than just BEGIN_EXAMPLE.
3 |This should work:
5 |6 | fixed width? how does this work? 7 | ........... 8 | ............ 9 | . 10 | . . . . 11 | . .. 12 | ....... ..... 13 | . . 14 | .... 15 |16 |
Two ASCII blobs.
17 |And this:
19 |
20 | # Finds all emphasis matches in a string.
21 | # Supply a block that will get the marker and body as parameters.
22 | def match_all(str)
23 | str.scan(@org_emphasis_regexp) do |match|
24 | yield $2, $3
25 | end
26 | end
27 |
28 | Now let’s test case-insensitive code blocks.
29 |
30 | # Finds all emphasis matches in a string.
31 | # Supply a block that will get the marker and body as parameters.
32 | def match_all(str)
33 | str.scan(@org_emphasis_regexp) do |match|
34 | yield $2, $3
35 | end
36 | end
37 |
38 |
39 | (def fib-seq
40 | (concat
41 | [0 1]
42 | ((fn rfib [a b]
43 | (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
44 |
45 | user> (take 20 fib-seq)
46 | (0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)
47 |
48 | Even if no language is set, it is still wrapped in code tags but class is empty.
49 |50 | echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers 51 |52 |
54 |58 |I really love to write about 55 | :symbols. They sure are the 56 | best things in the world!
57 |
59 | {
60 | :one => 1,
61 | :two => 2
62 | }
63 |
64 |
65 | (defproject helloworld "0.1"
66 | :dependencies [[org.clojure/clojure
67 | "1.1.0-master-SNAPSHOT"]
68 | [org.clojure/clojure-contrib
69 | "1.0-SNAPSHOT"]]
70 | :main helloworld)
71 |
72 |
--------------------------------------------------------------------------------
/spec/html_code_syntax_highlight_examples/advanced-code-no-color.org:
--------------------------------------------------------------------------------
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
107 |
--------------------------------------------------------------------------------
/spec/html_code_syntax_highlight_examples/code-coderay.html:
--------------------------------------------------------------------------------
1 |
3 | class Coderay
4 | class << self
5 | def colorize
6 | # Do colorizing stuff here
7 | heredoc = <<EOF
8 | Some text yay!!!
9 | EOF
10 | end
11 | end
12 | end
13 |
14 |
16 | - This file has only a list
17 | - Note it will end with nothing other than a list item.
18 | - the world wants to know: Will org-ruby write the closing ul tag?
19 |
20 |
21 |
--------------------------------------------------------------------------------
/spec/html_code_syntax_highlight_examples/code-coderay.org:
--------------------------------------------------------------------------------
1 | * Simple Code Syntax highlighting test
2 |
3 | #+BEGIN_SRC ruby
4 | class Coderay
5 | class << self
6 | def colorize
7 | # Do colorizing stuff here
8 | heredoc = <
3 | class Pygments
4 | class << self
5 | def colorize
6 | # Do colorizing stuff here
7 | heredoc = <<EOF
8 | Some text yay!!!
9 | EOF
10 | end
11 | end
12 | end
13 |
14 | Now using EXAMPLE blocks instead:
15 |16 | def hello() 17 | puts "hello" 18 | end 19 |20 |
Small case should work as well:
21 |22 | class Hello 23 | def say 24 | puts "hola" 25 | end 26 | end 27 |28 |
29 | class Piano
30 | def play_note(note)
31 | # TODO
32 | end
33 | end
34 |
35 |
37 | - This file has only a list
38 | - Note it will end with nothing other than a list item.
39 | - the world wants to know: Will org-ruby write the closing ul tag?
40 |
41 |
42 |
--------------------------------------------------------------------------------
/spec/html_code_syntax_highlight_examples/code-no-color.org:
--------------------------------------------------------------------------------
1 | * Simple Code Syntax highlighting test
2 |
3 | #+BEGIN_SRC ruby
4 | class Pygments
5 | class << self
6 | def colorize
7 | # Do colorizing stuff here
8 | heredoc = <class Pygments
3 | class << self
4 | def colorize
5 | # Do colorizing stuff here
6 | heredoc = <<EOF
7 | Some text yay!!!
8 | EOF
9 | end
10 | end
11 | end
12 |
Now using EXAMPLE blocks instead:
14 |15 | def hello() 16 | puts "hello" 17 | end 18 |19 |
Small case should work as well:
20 |21 | class Hello 22 | def say 23 | puts "hola" 24 | end 25 | end 26 |27 |
class Piano
28 | def play_note(note)
29 | # TODO
30 | end
31 | end
32 |
- This file has only a list
35 | - Note it will end with nothing other than a list item.
36 | - the world wants to know: Will org-ruby write the closing ul tag?
37 |
As mentioned in http://orgmode.org/manual/Literal-examples.html, 3 | when at the beginning of the line there is either “,*” or “,#+” 4 | this prepended comma should be removed before parsing.
5 |(Fixes https://github.com/bdewey/org-ruby/issues/50)
6 |* Hello
8 | ** Goodbye
9 | *** Not a headline, but prepended comma still removed.
10 | * I am a headline
11 |
12 |
14 | {
15 | "one": 1
16 | , "two": 2
17 | , "three": 3
18 | , "four": 4
19 | }
20 |
21 | Emacs Org mode implementation also removes it.
23 |
24 | text = <<TEXT
25 | #+TITLE: Prepended comma world
26 | * Hello world
27 | More text here
28 | TEXT
29 |
30 | Hello world
headline
32 | , ,* Hi
33 | ,
34 | , ,* This will be appended a comma
35 | * Hello world
36 | ,
37 |
38 | #+TITLE: "Hello world"
40 |
41 |
43 | ,,,,,,,,,,,,,,,,,*Hello world
44 |
45 |
--------------------------------------------------------------------------------
/spec/html_code_syntax_highlight_examples/prepended-comma-coderay.org:
--------------------------------------------------------------------------------
1 | * Removing the prepended comma from Org mode src blocks
2 |
3 | As mentioned in As mentioned in http://orgmode.org/manual/Literal-examples.html, 3 | when at the beginning of the line there is either “,*” or “,#+” 4 | this prepended comma should be removed before parsing.
5 |(Fixes https://github.com/bdewey/org-ruby/issues/50)
6 |* Hello
8 | ** Goodbye
9 | *** Not a headline, but prepended comma still removed.
10 | * I am a headline
11 |
12 |
14 | {
15 | "one": 1
16 | , "two": 2
17 | , "three": 3
18 | , "four": 4
19 | }
20 |
21 | Emacs Org mode implementation also removes it.
23 |
24 | text = <<TEXT
25 | #+TITLE: Prepended comma world
26 | * Hello world
27 | More text here
28 | TEXT
29 |
30 | Hello world
headline
32 | , ,* Hi
33 | ,
34 | , ,* This will be appended a comma
35 | * Hello world
36 | ,
37 |
38 | #+TITLE: "Hello world"
40 |
41 |
43 | ,,,,,,,,,,,,,,,,,*Hello world
44 |
45 |
--------------------------------------------------------------------------------
/spec/html_code_syntax_highlight_examples/prepended-comma-no-color.org:
--------------------------------------------------------------------------------
1 | * Removing the prepended comma from Org mode src blocks
2 |
3 | As mentioned in As mentioned in http://orgmode.org/manual/Literal-examples.html, 3 | when at the beginning of the line there is either “,*” or “,#+” 4 | this prepended comma should be removed before parsing.
5 |(Fixes https://github.com/bdewey/org-ruby/issues/50)
6 |* Hello
8 | ** Goodbye
9 | *** Not a headline, but prepended comma still removed.
10 | * I am a headline
11 |
{
14 | "one": 1
15 | , "two": 2
16 | , "three": 3
17 | , "four": 4
18 | }
19 |
Emacs Org mode implementation also removes it.
22 |text = <<TEXT
23 | #+TITLE: Prepended comma world
24 | * Hello world
25 | More text here
26 | TEXT
27 |
Hello world
headline, ,* Hi
30 | ,
31 | , ,* This will be appended a comma
32 | * Hello world
33 | ,
34 |
#+TITLE: "Hello world"
37 |
,,,,,,,,,,,,,,,,,*Hello world
40 |
5 | class Hello
6 | def say
7 | puts 'cheers'
8 | end
9 | end
10 |
11 |
14 | puts "This should not get lumped into the above line Example"
15 |
16 | A paragraph should go here.
17 |
20 | echo "Hello"
21 |
22 | And this is a paragraph
23 |
5 | class Hello
6 | def say
7 | puts 'cheers'
8 | end
9 | end
10 |
11 |
14 | puts "This should not get lumped into the above line Example"
15 |
16 | A paragraph should go here.
17 |
20 | echo "Hello"
21 |
22 | And this is a paragraph
23 |class Hello
5 | def say
6 | puts 'cheers'
7 | end
8 | end
9 |
puts "This should not get lumped into the above line Example"
13 |
A paragraph should go here.
15 |echo "Hello"
18 |
And this is a paragraph
20 |Advanced Lists
2 |org-ruby
supports the following list features of org-mode
:
Note the list ends just some more text. Make sure both list blocks 21 | are closed.
22 |This list will end with the end-of-file. Make sure all blocks are closed.
24 |This is paragraph two.
28 |And paragraph three.
29 |I need to get block code examples working. In orgmode
, they look
3 | like this:
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 |18 |
And now I should be back to normal text.
19 |Putting in another paragraph for good measure.
20 |Code should also get cancelled by a list, thus:
21 |22 | This is my code! 23 | 24 | Another line! 25 |26 |
BLOCKCOMMENT
2 |Testing that the next part is ignored
3 |And now back to normal!
4 | -------------------------------------------------------------------------------- /spec/html_examples/blockcomment.org: -------------------------------------------------------------------------------- 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! 16 | -------------------------------------------------------------------------------- /spec/html_examples/blockquote.html: -------------------------------------------------------------------------------- 1 |BLOCKQUOTE
2 |Testing that I can have block quotes:
3 |4 |7 |Example:
5 |This is blockquote text.
6 |
And now I’m back to normal text!
8 | -------------------------------------------------------------------------------- /spec/html_examples/blockquote.org: -------------------------------------------------------------------------------- 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! 14 | -------------------------------------------------------------------------------- /spec/html_examples/center.html: -------------------------------------------------------------------------------- 1 |Fou
2 |not center
3 |center
5 |not center, again
7 | -------------------------------------------------------------------------------- /spec/html_examples/center.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Fou 2 | 3 | not center 4 | #+BEGIN_CENTER 5 | center 6 | #+END_CENTER 7 | not center, again 8 | -------------------------------------------------------------------------------- /spec/html_examples/code-block-lists.html: -------------------------------------------------------------------------------- 1 |4 | - List starts 5 | + Block without indentation 6 | #+begin_example 7 | puts "test" 8 | #+end_example 9 | - List continues here 10 | + and finished here 11 |12 |
17 | puts "test" 18 |19 |
30 | - List starts 31 | + Block without indentation 32 | #+begin_example ruby 33 | puts "test" 34 | #+end_example 35 | - List continues here 36 | + and finished here 37 |38 |
43 | puts "test" 44 |45 |
56 | - Indentation of a begin_example code block 57 | #+begin_example 58 | (+ 3 5) 59 | #+end_example 60 | 61 |62 |
65 | (+ 3 5) 66 |67 |
I need to be able to export things that look like org-mode comments 3 | inside of code blocks, like this:
4 |5 | #+TITLE: orgmode_parser.org 6 | #+AUTHOR: 7 | #+EMAIL: brian@BRIAN-DESK 8 | #+DATE: 2009-12-29 Tue 9 | #+DESCRIPTION: 10 | #+KEYWORDS: 11 | #+LANGUAGE: en 12 | #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t 13 | #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc 14 | #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js 15 | #+EXPORT_SELECT_TAGS: export 16 | #+EXPORT_EXCLUDE_TAGS: noexport 17 | #+LINK_UP: 18 | #+LINK_HOME: 19 |20 | -------------------------------------------------------------------------------- /spec/html_examples/code-comment.org: -------------------------------------------------------------------------------- 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 | 23 | -------------------------------------------------------------------------------- /spec/html_examples/code-lists.html: -------------------------------------------------------------------------------- 1 |
This is a paragraph
6 |Sublist paragraph
11 |Paragraph from 2nd sublist
18 |paragraph
27 |uno dos tres
39 |49 | class Hello 50 | def say 51 | puts 'cheers' 52 | end 53 | end 54 |55 |
58 | This gets lumped in to the above line "Example" 59 |60 |
70 |72 |A quote!!!
71 |
dolor
73 |This table:
84 |a | b |
0 | 1 |
1 | 2 |
The table should be above
94 |103 |105 |Cuando me desperte, el dinosaurio estaba alli.
104 |
and this is also part of the output
5 | -------------------------------------------------------------------------------- /spec/html_examples/comment-trees.org: -------------------------------------------------------------------------------- 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 14 | -------------------------------------------------------------------------------- /spec/html_examples/custom-seq-todo.html: -------------------------------------------------------------------------------- 1 |custom-todo.org
2 |I copied this todo sequence from Worg. It shows a lot of power of the 3 | built-in todo functionality. Now, let’s make sure all of these are 4 | recognized (and therefore NOT exported.)
5 |don’t be fooled by the initial substring above!
20 | -------------------------------------------------------------------------------- /spec/html_examples/custom-seq-todo.org: -------------------------------------------------------------------------------- 1 | #+TITLE: custom-todo.org 2 | #+DESCRIPTION: Makes sure I can handle custom todo entries 3 | #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) 4 | #+OPTIONS: todo:t 5 | 6 | I copied this todo sequence from Worg. It shows a lot of power of the 7 | built-in todo functionality. Now, let's make sure all of these are 8 | recognized (and therefore NOT exported.) 9 | 10 | * TODO Sample 11 | 12 | - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 13 | I gave up. 14 | - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 15 | huh? 16 | 17 | * INPROGRESS this one's in progress 18 | * WAITING who am I waiting on? 19 | * DONE Finished this one! 20 | * CANCELED I gave up here. 21 | * DONT be fooled by just a random word in all caps. 22 | * todo <== this word doesn't match because the case doesn't match. 23 | * TODOX 24 | don't be fooled by the initial substring above! 25 | -------------------------------------------------------------------------------- /spec/html_examples/custom-todo.html: -------------------------------------------------------------------------------- 1 |custom-todo.org
2 |I copied this todo sequence from Worg. It shows a lot of power of the 3 | built-in todo functionality. Now, let’s make sure all of these are 4 | recognized (and therefore NOT exported.)
5 |don’t be fooled by the initial substring above!
20 | -------------------------------------------------------------------------------- /spec/html_examples/custom-todo.org: -------------------------------------------------------------------------------- 1 | #+TITLE: custom-todo.org 2 | #+DESCRIPTION: Makes sure I can handle custom todo entries 3 | #+TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) 4 | #+OPTIONS: todo:t 5 | 6 | I copied this todo sequence from Worg. It shows a lot of power of the 7 | built-in todo functionality. Now, let's make sure all of these are 8 | recognized (and therefore NOT exported.) 9 | 10 | * TODO Sample 11 | 12 | - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 13 | I gave up. 14 | - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 15 | huh? 16 | 17 | * INPROGRESS this one's in progress 18 | * WAITING who am I waiting on? 19 | * DONE Finished this one! 20 | * CANCELED I gave up here. 21 | * DONT be fooled by just a random word in all caps. 22 | * todo <== this word doesn't match because the case doesn't match. 23 | * TODOX 24 | don't be fooled by the initial substring above! 25 | -------------------------------------------------------------------------------- /spec/html_examples/custom-typ-todo.html: -------------------------------------------------------------------------------- 1 |custom-todo.org
2 |I copied this todo sequence from Worg. It shows a lot of power of the 3 | built-in todo functionality. Now, let’s make sure all of these are 4 | recognized (and therefore NOT exported.)
5 |don’t be fooled by the initial substring above!
20 | -------------------------------------------------------------------------------- /spec/html_examples/custom-typ-todo.org: -------------------------------------------------------------------------------- 1 | #+TITLE: custom-todo.org 2 | #+DESCRIPTION: Makes sure I can handle custom todo entries 3 | #+TYP_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) 4 | #+OPTIONS: todo:t 5 | 6 | I copied this todo sequence from Worg. It shows a lot of power of the 7 | built-in todo functionality. Now, let's make sure all of these are 8 | recognized (and therefore NOT exported.) 9 | 10 | * TODO Sample 11 | 12 | - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 13 | I gave up. 14 | - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 15 | huh? 16 | 17 | * INPROGRESS this one's in progress 18 | * WAITING who am I waiting on? 19 | * DONE Finished this one! 20 | * CANCELED I gave up here. 21 | * DONT be fooled by just a random word in all caps. 22 | * todo <== this word doesn't match because the case doesn't match. 23 | * TODOX 24 | don't be fooled by the initial substring above! 25 | -------------------------------------------------------------------------------- /spec/html_examples/deflist.html: -------------------------------------------------------------------------------- 1 |Hallo
2 |Text
7 |The following examples show how org-ruby behave 15 | when handling some cases of definition lists. 16 | (Many thanks to vonavi for his contributions here)
17 |The following cases will not be considered as definition lists 68 | but just regular lists.
69 |??? will be shown in this case
80 |code
verbatim
code
, verbatim
, underline, 2 | <li>[ ] “smart quotes”</li> 3 | <li>[ ] I think I need this for ‘single quotes’ too. Don’t I?</li> 4 | <li>[ ] Em dashes would be great — wouldn’t they?</li> 5 | <li>[ ] I hope to develop an en dash sometime in 2010 – 2011.</li> 6 |7 | -------------------------------------------------------------------------------- /spec/html_examples/escape-pre.org: -------------------------------------------------------------------------------- 1 | #+BEGIN_EXAMPLE 2 |
export-headline-levels.org
2 |What happens when you exceed the number of headline levels to export?
3 |This bit of body should get exported.
6 |This bit of body gets exported.
8 |Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 10 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 11 | erat, sed diam voluptua. At vero eos et accusam et justo duo 12 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 13 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 14 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 15 | invidunt ut labore et dolore magna aliquyam erat, sed diam 16 | voluptua. At vero eos et accusam et justo duo dolores et ea 17 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 18 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 19 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 20 | invidunt ut labore et dolore magna aliquyam erat, sed diam 21 | voluptua. At vero eos et accusam et justo duo dolores et ea 22 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 23 | Lorem ipsum dolor sit amet.
24 |This one should not get exported!!
26 |This also cannot get exported!!
28 | -------------------------------------------------------------------------------- /spec/html_examples/export-exclude-only.org: -------------------------------------------------------------------------------- 1 | #+TITLE: export-headline-levels.org 2 | #+AUTHOR: 3 | #+EMAIL: bdewey@gmail.com 4 | #+DATE: 2009-12-29 Tue 5 | #+DESCRIPTION: 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_EXCLUDE_TAGS: exclude noexport 12 | #+TAGS: export noexport 13 | #+LINK_UP: 14 | #+LINK_HOME: 15 | 16 | What happens when you exceed the number of headline levels to export? 17 | 18 | * Shouldn't export :noexport: 19 | 20 | This text shouldn't be exported, right? 21 | 22 | ** Nor this subheading? 23 | 24 | Or its text? 25 | 26 | * Exlude me, too! :exclude: 27 | 28 | * Headline 1 :READING:DVD: 29 | 30 | ** Headline 2 31 | 32 | This bit of body *should* get exported. 33 | 34 | *** Headline 3 :export: 35 | 36 | This bit of body gets exported. 37 | 38 | **** Headline 4 (include) 39 | 40 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 41 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 42 | erat, sed diam voluptua. At vero eos et accusam et justo duo 43 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 44 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 45 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 46 | invidunt ut labore et dolore magna aliquyam erat, sed diam 47 | voluptua. At vero eos et accusam et justo duo dolores et ea 48 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 49 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 50 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 51 | invidunt ut labore et dolore magna aliquyam erat, sed diam 52 | voluptua. At vero eos et accusam et justo duo dolores et ea 53 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 54 | Lorem ipsum dolor sit amet. 55 | 56 | **** Headline 4 (exclude) :noexport: 57 | 58 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 59 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 60 | erat, sed diam voluptua. At vero eos et accusam et justo duo 61 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 62 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 63 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 64 | invidunt ut labore et dolore magna aliquyam erat, sed diam 65 | voluptua. At vero eos et accusam et justo duo dolores et ea 66 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 67 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 68 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 69 | invidunt ut labore et dolore magna aliquyam erat, sed diam 70 | voluptua. At vero eos et accusam et justo duo dolores et ea 71 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 72 | Lorem ipsum dolor sit amet. 73 | 74 | 75 | *** Another headline 3 76 | 77 | This one *should not* get exported!! 78 | 79 | **** Another headline 4 80 | 81 | This also *cannot* get exported!! 82 | -------------------------------------------------------------------------------- /spec/html_examples/export-keywords.html: -------------------------------------------------------------------------------- 1 |export-keywords.org
2 |Testing that I can export keywords.
3 |export-headline-levels.org
2 |What happens when you exceed the number of headline levels to export?
3 |This bit of body gets exported.
7 |Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 9 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 10 | erat, sed diam voluptua. At vero eos et accusam et justo duo 11 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 12 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 13 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 14 | invidunt ut labore et dolore magna aliquyam erat, sed diam 15 | voluptua. At vero eos et accusam et justo duo dolores et ea 16 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 17 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 18 | 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.
23 | -------------------------------------------------------------------------------- /spec/html_examples/export-tags.org: -------------------------------------------------------------------------------- 1 | #+TITLE: export-headline-levels.org 2 | #+AUTHOR: 3 | #+EMAIL: bdewey@gmail.com 4 | #+DATE: 2009-12-29 Tue 5 | #+DESCRIPTION: 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: exclude noexport 13 | #+TAGS: export noexport 14 | #+LINK_UP: 15 | #+LINK_HOME: 16 | 17 | What happens when you exceed the number of headline levels to export? 18 | 19 | * Shouldn't export :noexport: 20 | 21 | This text shouldn't be exported, right? 22 | 23 | ** Nor this subheading? 24 | 25 | Or its text? 26 | 27 | * Exlude me, too! :exclude: 28 | 29 | * Headline 1 :READING:DVD: 30 | 31 | ** Headline 2 32 | 33 | This bit of body should not get exported. 34 | 35 | *** Headline 3 :export: 36 | 37 | This bit of body gets exported. 38 | 39 | **** Headline 4 (include) 40 | 41 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 42 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 43 | erat, sed diam voluptua. At vero eos et accusam et justo duo 44 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 45 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 46 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 47 | invidunt ut labore et dolore magna aliquyam erat, sed diam 48 | voluptua. At vero eos et accusam et justo duo dolores et ea 49 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 50 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 51 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 52 | invidunt ut labore et dolore magna aliquyam erat, sed diam 53 | voluptua. At vero eos et accusam et justo duo dolores et ea 54 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 55 | Lorem ipsum dolor sit amet. 56 | 57 | **** Headline 4 (exclude) :noexport: 58 | 59 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 60 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 61 | erat, sed diam voluptua. At vero eos et accusam et justo duo 62 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 63 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 64 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 65 | invidunt ut labore et dolore magna aliquyam erat, sed diam 66 | voluptua. At vero eos et accusam et justo duo dolores et ea 67 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 68 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 69 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 70 | invidunt ut labore et dolore magna aliquyam erat, sed diam 71 | voluptua. At vero eos et accusam et justo duo dolores et ea 72 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 73 | Lorem ipsum dolor sit amet. 74 | 75 | 76 | *** Another headline 3 77 | 78 | This one *should not* get exported!! 79 | 80 | **** Another headline 4 81 | 82 | This also *cannot* get exported!! 83 | -------------------------------------------------------------------------------- /spec/html_examples/export-title.html: -------------------------------------------------------------------------------- 1 |Export Title
2 |This simple org document should get a title from the TITLE
option at
3 | the front of the file.
Footnotes
2 |Using numbers 0
4 |Using letters and not defined in the footnote abc
5 |Using letters and defined in the footnote abc
6 |Defined in the footnote itself with markup 1
7 |0 Definition of first footnote
8 | 15 | -------------------------------------------------------------------------------- /spec/html_examples/footnotes.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Footnotes 2 | #+OPTIONS: f:t 3 | 4 | * Footnotes 5 | 6 | Using numbers [fn:0] 7 | 8 | Using letters and not defined in the footnote [fn:abc] 9 | 10 | Using letters and defined in the footnote [fn:abc:definition of abc] 11 | 12 | Defined in the footnote itself with markup [fn:1:*blub*] 13 | 14 | [fn:0] Definition of first footnote 15 | -------------------------------------------------------------------------------- /spec/html_examples/horizontal_rule.html: -------------------------------------------------------------------------------- 1 |Useful contribution by Neil-Smithline
2 |5 hyphens or more,
3 |will produce a horizontal rule.
5 | -------------------------------------------------------------------------------- /spec/html_examples/horizontal_rule.org: -------------------------------------------------------------------------------- 1 | Useful contribution by [[http://www.neilsmithline.com][Neil-Smithline]] 2 | 3 | 5 hyphens or more, 4 | ----- 5 | will produce a horizontal rule. 6 | -------------------------------------------------------------------------------- /spec/html_examples/html-literal.html: -------------------------------------------------------------------------------- 1 |HTML literals
2 |ORG escapes HTML by default. This should <b>not be bold text!</b> 3 | Instead, it should look like regular text with some HTML tags around 4 | it.
5 | -------------------------------------------------------------------------------- /spec/html_examples/html-literal.org: -------------------------------------------------------------------------------- 1 | HTML literals 2 | 3 | ORG escapes HTML by default. This should not be bold text! 4 | Instead, it should look like regular text with some HTML tags around 5 | it. 6 | 7 | -------------------------------------------------------------------------------- /spec/html_examples/include-file-disabled.html: -------------------------------------------------------------------------------- 1 |Example of including a file
2 |The following included file will be centered:
7 |This is similar to the center block:
10 |11 |14 |Before
12 |After
13 |
16 | #+INCLUDE: "./spec/html_examples/only-list.org" 17 |18 |
One | Two | Three |
---|---|---|
#+INCLUDE: “./spec/html_examples/only-list.org” | Five | Six |
Seven | Eight | Nine |
I want to make sure I handle all inline formatting. I need to handle
3 | bold, italic, code
, verbatim
, underline, strikethrough.
In addition, I need to make sure I can handle links. We’ve got simple 5 | links, like this:
6 |Note the last one is not a link, as the source doesn’t include it in 12 | double-brackets and I don’t auto-recognize URLs.
13 |I should also handle links with helpful text.
14 |Helpful addition from punchagan, we now 15 | recognize when the link goes to an image and make the link anchor be the 16 | image, like this:
17 |Also, if you make the descriptive text be an image, then it will get formatted 21 | with an image tag, like so:
22 | 25 |Helpful addition from wallyqs:
26 |While “naked” links don’t work (like http://www.google.com), angle links 27 | do work. This should look like a link: http://www.google.com.
28 |It should be possible to use both kind of links on the same paragraph:
29 |This is an angle link http://google.com and this is a bracket link to a repository.
30 |This is a bracket link to a repository and this is an angle link http://google.com.
31 |This is a bracket link to a repository and this is a bracket link too to a repository.
32 |This is an angle link http://google.com and this is an angle link too http://google.com.
33 | -------------------------------------------------------------------------------- /spec/html_examples/inline-formatting.org: -------------------------------------------------------------------------------- 1 | Inline Formatting 2 | 3 | I want to make sure I handle all inline formatting. I need to handle 4 | *bold*, /italic/, =code=, ~verbatim~, _underline_, +strikethrough+. 5 | 6 | In addition, I need to make sure I can handle links. We've got simple 7 | links, like this: 8 | 9 | - [[http://www.bing.com]] 10 | - [[http://www.google.com]] 11 | - http://www.gmail.com 12 | 13 | Note the last one *is not* a link, as the source doesn't include it in 14 | double-brackets and I don't auto-recognize URLs. 15 | 16 | I should also handle links with [[http://www.xkcd.com][helpful text]]. 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]] 28 | 29 | Helpful addition from [[https://github.com/wallyqs][wallyqs]]: 30 | 31 | 32 | While "naked" links don't work (like http://www.google.com), angle links 33 | do work. This should look like a link:Inline Images
2 |Per the org-mode spec, you can include inline images as links without 3 | any descriptive link text, like this:
4 |I currently do not support the caption/link syntax, but I can include 6 | the inline image. I recognize the following image file types:
7 |link-features.org
2 |Org-mode export supports a lot of link features. I’ve covered “simple” 3 | HTML links elsewhere. Now let’s cover links to other org files, other 4 | sections within documents, etc.
5 |This is a link to the code-comment.org
file in the same
7 | directory. In emacs
, if you click it, the other file opens. We
8 | want the same behavior in the HTML export.
This is a search link into code-comment.org.
12 | 13 |URLs can be abbreviated by a LINK definition in the org file
27 |This is an abbreviated link example
28 | -------------------------------------------------------------------------------- /spec/html_examples/link-features.org: -------------------------------------------------------------------------------- 1 | #+TITLE: link-features.org 2 | 3 | Org-mode export supports a lot of link features. I've covered "simple" 4 | HTML links elsewhere. Now let's cover links to other org files, other 5 | sections within documents, etc. 6 | 7 | * Links to other org files 8 | 9 | This is a link to the ~code-comment.org~ file in the same 10 | directory. In ~emacs~, if you click it, the other file opens. We 11 | want the same behavior in the HTML export. 12 | 13 | [[file:code-comment.org][Code Comment]] 14 | 15 | * Search links 16 | 17 | This is a search link into code-comment.org. 18 | 19 | [[file:code-comment.org::*Code%20Comment][Code Comment]] 20 | 21 | * Correct handling of .org URIs in HTML markup routine (thanks @rayl!) 22 | 23 | - [[http://foo.com][foo.com website]] 24 | 25 | - [[http://foo.org][foo.org website]] 26 | 27 | - [[http://foo.org/foo.org][foo.org/foo.org]] 28 | 29 | - [[http://localhost:4567/foo.org][localhost:4567/foo.org]] 30 | 31 | * In these links, .org is converted to .html 32 | 33 | - [[file:path.org][file:path.org label]] 34 | 35 | - [[file:notes/path.org][file:notes/path.org label]] 36 | 37 | * Links abbreviations 38 | 39 | URLs can be abbreviated by a LINK definition in the org file 40 | 41 | #+LINK: example http://example.com/something 42 | 43 | [[example][This is an abbreviated link example]] 44 | -------------------------------------------------------------------------------- /spec/html_examples/lists.html: -------------------------------------------------------------------------------- 1 |I want to make sure I have great support for lists.
3 |And this is a paragraph after the list.
8 |textile
happy.And this is a separate paragraph. Note the indentation in the org 35 | file.
36 |Note that spaces are required to denote lists. Thus, none of the following 38 | should get recognized as lists.
39 |-This isn’t a list. 40 | -And this isn’t a list.
41 |1.And this isn’t a list. 42 | 2.And this isn’t a list.
43 | -------------------------------------------------------------------------------- /spec/html_examples/lists.org: -------------------------------------------------------------------------------- 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. 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. 48 | -------------------------------------------------------------------------------- /spec/html_examples/metadata-comment.html: -------------------------------------------------------------------------------- 1 |I normally filter out things that look like metadata. Can’t do it any 3 | more. I need to see all of the following:
4 |5 | * DONE Handle inline formatting 6 | CLOSED: [2009-12-26 Sat 21:41] 7 | :PROPERTIES: 8 | :ARCHIVE_TIME: 2009-12-26 Sat 22:16 9 | :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org 10 | :ARCHIVE_OLPATH: <%= @page.title %>/Future Development 11 | :ARCHIVE_CATEGORY: orgmode_parser 12 | :ARCHIVE_TODO: DONE 13 | :END: 14 | 15 | I still need to handle: 16 | 17 | - [ ] =Inline code= 18 | 19 | How does the =emacs= HTML parser handle *inline* formatting? Ah, 20 | it looks like it defines everything in =org-emphasis-alist= (line 21 | 2855 of =org.el=). 22 | 23 | And then look at =org-emphasis-regexp-components=, line 2828 of 24 | =org.el=. It looks like they just use a crazy regexp for inline 25 | formatting. Which is good, because it means I can copy! 26 | 27 | 28 |29 | -------------------------------------------------------------------------------- /spec/html_examples/metadata-comment.org: -------------------------------------------------------------------------------- 1 | * Metadata, etc. 2 | 3 | I normally filter out things that look like metadata. Can't do it any 4 | more. I need to see all of the following: 5 | 6 | #+BEGIN_EXAMPLE 7 | * DONE Handle inline formatting 8 | CLOSED: [2009-12-26 Sat 21:41] 9 | :PROPERTIES: 10 | :ARCHIVE_TIME: 2009-12-26 Sat 22:16 11 | :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org 12 | :ARCHIVE_OLPATH: <%= @page.title %>/Future Development 13 | :ARCHIVE_CATEGORY: orgmode_parser 14 | :ARCHIVE_TODO: DONE 15 | :END: 16 | 17 | I still need to handle: 18 | 19 | - [ ] =Inline code= 20 | 21 | How does the =emacs= HTML parser handle *inline* formatting? Ah, 22 | it looks like it defines everything in =org-emphasis-alist= (line 23 | 2855 of =org.el=). 24 | 25 | And then look at =org-emphasis-regexp-components=, line 2828 of 26 | =org.el=. It looks like they just use a crazy regexp for inline 27 | formatting. Which is good, because it means I can copy! 28 | 29 | 30 | #+END_EXAMPLE 31 | -------------------------------------------------------------------------------- /spec/html_examples/only-list.html: -------------------------------------------------------------------------------- 1 |
One | Two | Three | Four |
---|---|---|---|
Five | Six | Seven | Eight |
Nine | Ten | Eleven | Twelve |
format | text | in | cells |
As mentioned in http://orgmode.org/manual/Literal-examples.html, 3 | when at the beginning of the line there is either “,*” or “,#+” 4 | this prepended comma should be removed before parsing.
5 |(Fixes https://github.com/bdewey/org-ruby/issues/50)
6 |* Hello 8 | ** Goodbye 9 | *** Not a headline, but prepended comma still removed. 10 | * I am a headline 11 |12 |
14 | { 15 | "one": 1 16 | , "two": 2 17 | , "three": 3 18 | , "four": 4 19 | } 20 |21 |
Emacs Org mode implementation also removes it.
23 |24 | text = <<TEXT 25 | #+TITLE: Prepended comma world 26 | * Hello world 27 | More text here 28 | TEXT 29 |30 |
Hello world
headline32 | , ,* Hi 33 | , 34 | , ,* This will be appended a comma 35 | * Hello world 36 | , 37 |38 |
#+TITLE: "Hello world" 40 |41 |
43 | ,,,,,,,,,,,,,,,,,*Hello world 44 |45 | -------------------------------------------------------------------------------- /spec/html_examples/prepended-comma.org: -------------------------------------------------------------------------------- 1 | * Removing the prepended comma from Org mode example blocks 2 | 3 | As mentioned in
4 | df \ 5 |6 |
8 | |sed '1d' \ 9 |10 |
12 | |awk '{print $5 " " $6}'|sort -n |tail -1 \ 13 |14 |
16 | |awk '{print $2}' 17 |18 |
These properties are metadata so they should not be visible.
20 | -------------------------------------------------------------------------------- /spec/html_examples/properties_drawer.org: -------------------------------------------------------------------------------- 1 | # Example taken from the wiki 2 | # http://orgmode.org/manual/noweb_002dref.html#noweb_002dref 3 | * The mount point of the fullest disk 4 | :PROPERTIES: 5 | :noweb-ref: fullest-disk 6 | :END: 7 | 8 | ** query all mounted disks 9 | #+BEGIN_EXAMPLE 10 | df \ 11 | #+END_EXAMPLE 12 | 13 | ** strip the header row 14 | #+BEGIN_EXAMPLE 15 | |sed '1d' \ 16 | #+END_EXAMPLE 17 | 18 | ** sort by the percent full 19 | #+BEGIN_EXAMPLE 20 | |awk '{print $5 " " $6}'|sort -n |tail -1 \ 21 | #+END_EXAMPLE 22 | 23 | ** extract the mount point 24 | #+BEGIN_EXAMPLE 25 | |awk '{print $2}' 26 | #+END_EXAMPLE 27 | 28 | * Properties drawer example 29 | :PROPERTIES: 30 | :ARCHIVE_TIME: 2009-12-26 Sat 22:16 31 | :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org 32 | :ARCHIVE_OLPATH: <%= @page.title %>/Future Development 33 | :ARCHIVE_CATEGORY: orgmode_parser 34 | :ARCHIVE_TODO: DONE 35 | :END: 36 | 37 | These properties are metadata so they should not be visible. 38 | -------------------------------------------------------------------------------- /spec/html_examples/raw-html.html: -------------------------------------------------------------------------------- 1 |The following will render the tag as is:
3 | Hello
4 | And this will render some Javascript:
5 | 6 |They behave as follows:
8 |9 |
10 | 11 | Hello. 12 | 13 |14 | 15 |
This should be escaped: <html><script type="text/javascript">(function(){})</script></html>
This should be escaped: <html><script type
“text/javascript”>(function(){})</script></html>=
This should be escaped: @<script type="text/javascript">(function(){})@</script>
This should be escaped: @<script type
“text/javascript”>(function(){})=
Hello
6 |
7 | And this will render some Javascript:
8 |
9 | #+html:
10 |
11 | ** HTML blocks
12 |
13 | They behave as follows:
14 |
15 | #+begin_html
16 | 17 |
18 | 19 | Hello. 20 | 21 |22 | 23 | #+end_html 24 | 25 | ** Cases on which html should be escaped 26 | 27 | This should be escaped: ~~ 28 | 29 | # Matches the first = 30 | This should be escaped: == 31 | 32 | This should be escaped: ~@~ 33 | 34 | # Matches the first = 35 | This should be escaped: =@= 36 | -------------------------------------------------------------------------------- /spec/html_examples/skip-header.html: -------------------------------------------------------------------------------- 1 |
skip-header.org
2 |This should be the first text in the output.
4 | -------------------------------------------------------------------------------- /spec/html_examples/skip-header.org: -------------------------------------------------------------------------------- 1 | #+TITLE: skip-header.org 2 | #+AUTHOR: 3 | #+EMAIL: brian@BRIAN-DESK 4 | #+DATE: 2009-12-29 Tue 5 | #+DESCRIPTION: 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:t 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 | This is header text. 16 | It exists in the org-file, but shouldn't show up in the HTML output. 17 | 18 | - Same with this list 19 | - Nope, shouldn't be in the output. 20 | 21 | #+BEGIN_EXAMPLE 22 | Even this code snippet shouldn't be there. 23 | Like a ninja. You can't see me. 24 | #+END_EXAMPLE 25 | 26 | * First heading 27 | 28 | This should be the first text in the output. 29 | -------------------------------------------------------------------------------- /spec/html_examples/skip-table.html: -------------------------------------------------------------------------------- 1 |skip-table.org
2 |Checking that tables are skipped when directed.
3 |For grins, here’s another table without a header. Just keep the bases 4 | covered.
5 |Again, in the HTML output, you should see no tables.
6 | -------------------------------------------------------------------------------- /spec/html_examples/skip-table.org: -------------------------------------------------------------------------------- 1 | #+TITLE: skip-table.org 2 | #+OPTIONS: |:nil 3 | 4 | Checking that tables are skipped when directed. 5 | 6 | | One | Two | Three | 7 | |-------+-------+-------| 8 | | Four | Five | Six | 9 | | Seven | Eight | Nine | 10 | 11 | 12 | For grins, here's another table without a header. Just keep the bases 13 | covered. 14 | 15 | | One | Two | Three | 16 | | Four | Five | Six | 17 | | Seven | Eight | Nine | 18 | 19 | Again, in the HTML output, you should see *no tables*. 20 | -------------------------------------------------------------------------------- /spec/html_examples/subsupscript-nil.html: -------------------------------------------------------------------------------- 1 |SUBSUPSCRIPT
2 |a^{b}
3 |a_{b}
4 | -------------------------------------------------------------------------------- /spec/html_examples/subsupscript-nil.org: -------------------------------------------------------------------------------- 1 | #+OPTIONS: ^:nil 2 | SUBSUPSCRIPT 3 | 4 | a^{b} 5 | 6 | a_{b} 7 | -------------------------------------------------------------------------------- /spec/html_examples/subsupscript.html: -------------------------------------------------------------------------------- 1 |SUBSUPSCRIPT
2 |ab
3 |ab
4 | -------------------------------------------------------------------------------- /spec/html_examples/subsupscript.org: -------------------------------------------------------------------------------- 1 | SUBSUPSCRIPT 2 | 3 | a^{b} 4 | 5 | a_{b} 6 | -------------------------------------------------------------------------------- /spec/html_examples/tables.html: -------------------------------------------------------------------------------- 1 |TABLES
2 |Different types of ORG tables.
3 |Cell one | Cell two |
Cell three | Cell four |
Cell one |
Cell two |
And here’s some paragraph content. The line breaks will need to get 14 | removed here, but not for the tables.
15 |One | Two | Three |
---|---|---|
Four | Five | Six |
Seven | Eight | Nine |
The separator row should not get printed out.
22 |One | Two | Three |
---|---|---|
Four | Five | Six |
Seven | Eight | Nine |
Only the first row should be a header row.
29 |One | Two | Three |
---|---|---|
Four | Five | Six |
Seven | Eight | Nine |
Ten | Eleven | Twelve |
Only the first row should be a header row.
37 |foo | bar |
---|---|
1 | 2 |
https://github.com/bdewey/org-ruby/pull/34
43 | -------------------------------------------------------------------------------- /spec/html_examples/tables.org: -------------------------------------------------------------------------------- 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. 51 | 52 | * Fix error when table starts with hline (Thanks @til!) 53 | |-----+-----| 54 | | foo | bar | 55 | |-----+-----| 56 | | 1 | 2 | 57 | https://github.com/bdewey/org-ruby/pull/34 58 | -------------------------------------------------------------------------------- /spec/html_examples/text.html: -------------------------------------------------------------------------------- 1 |The simplest case: translating plain text.
2 |Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 3 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 4 | sed diam voluptua. At vero eos et accusam et justo duo dolores et ea 5 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem 6 | ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur 7 | sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et 8 | dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam 9 | et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea 10 | takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 11 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12 | invidunt ut labore et dolore magna aliquyam erat, sed diam 13 | voluptua. At vero eos et accusam et justo duo dolores et ea 14 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem 15 | ipsum dolor sit amet.
16 | -------------------------------------------------------------------------------- /spec/html_examples/text.org: -------------------------------------------------------------------------------- 1 | The simplest case: translating plain text. 2 | 3 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 4 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 5 | sed diam voluptua. At vero eos et accusam et justo duo dolores et ea 6 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem 7 | ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur 8 | sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et 9 | dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam 10 | et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea 11 | takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 12 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 13 | invidunt ut labore et dolore magna aliquyam erat, sed diam 14 | voluptua. At vero eos et accusam et justo duo dolores et ea 15 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem 16 | ipsum dolor sit amet. 17 | -------------------------------------------------------------------------------- /spec/markdown_examples/advanced-lists.md: -------------------------------------------------------------------------------- 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 | * This is a numbered list nested within the unordered list 14 | * 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! 32 | 33 | # Hyphen, Plus and Asterisk can be used to create lists 34 | 35 | * One 36 | * uno 37 | * ichi 38 | * uno 39 | * Two 40 | * dos 41 | * ni 42 | * ni 43 | * Three 44 | * Four 45 | 46 | 47 | -------------------------------------------------------------------------------- /spec/markdown_examples/advanced-lists.org: -------------------------------------------------------------------------------- 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! 32 | 33 | * Hyphen, Plus and Asterisk can be used to create lists 34 | 35 | - One 36 | * uno 37 | + ichi 38 | * uno 39 | - Two 40 | + dos 41 | * ni 42 | * ni 43 | - Three 44 | - Four 45 | 46 | 47 | -------------------------------------------------------------------------------- /spec/markdown_examples/block_code.md: -------------------------------------------------------------------------------- 1 | # Block Code 2 | 3 | I need to get block code examples working. In `orgmode`, they look 4 | like this: 5 | 6 | ``` 7 | def initialize(output) 8 | @output = output 9 | @buffer = "" 10 | @output_type = :start 11 | @list_indent_stack = [] 12 | @paragraph_modifier = nil 13 | 14 | @logger = Logger.new(STDERR) 15 | @logger.level = Logger::WARN 16 | end 17 | 18 | ``` 19 | 20 | And now I should be back to normal text. 21 | 22 | Putting in another paragraph for good measure. 23 | 24 | 25 | Code should also get cancelled by a list, thus: 26 | 27 | ``` 28 | This is my code! 29 | 30 | Another line! 31 | ``` 32 | 33 | * My list should cancel this. 34 | * Another list line. 35 | -------------------------------------------------------------------------------- /spec/markdown_examples/block_code.org: -------------------------------------------------------------------------------- 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. 36 | -------------------------------------------------------------------------------- /spec/markdown_examples/blockcomment.md: -------------------------------------------------------------------------------- 1 | BLOCKCOMMENT 2 | 3 | Testing that the next part is ignored 4 | 5 | 6 | And now back to normal! 7 | -------------------------------------------------------------------------------- /spec/markdown_examples/blockcomment.org: -------------------------------------------------------------------------------- 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! 16 | -------------------------------------------------------------------------------- /spec/markdown_examples/blockquote.md: -------------------------------------------------------------------------------- 1 | BLOCKQUOTE 2 | 3 | Testing that I can have block quotes: 4 | 5 | 6 | > *Example:* 7 | 8 | > This is blockquote text. 9 | 10 | 11 | And now I'm back to normal text! 12 | -------------------------------------------------------------------------------- /spec/markdown_examples/blockquote.org: -------------------------------------------------------------------------------- 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! 14 | -------------------------------------------------------------------------------- /spec/markdown_examples/center.md: -------------------------------------------------------------------------------- 1 | 2 | not center 3 | center 4 | not center, again 5 | -------------------------------------------------------------------------------- /spec/markdown_examples/center.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Fou 2 | 3 | not center 4 | #+BEGIN_CENTER 5 | center 6 | #+END_CENTER 7 | not center, again 8 | -------------------------------------------------------------------------------- /spec/markdown_examples/code-block-lists.md: -------------------------------------------------------------------------------- 1 | # Code blocks in lists 2 | ## No spaces in code block 3 | 4 | - List starts 5 | + Block without indentation 6 | #+begin_example 7 | puts "test" 8 | #+end_example 9 | - List continues here 10 | + and finished here 11 | 12 | * List starts 13 | * Block without indentation 14 | ``` 15 | puts "test" 16 | ``` 17 | * List continues here 18 | * and finished here 19 | 20 | ## Code block indented 21 | 22 | - List starts 23 | + Block without indentation 24 | #+begin_example ruby 25 | puts "test" 26 | #+end_example 27 | - List continues here 28 | + and finished here 29 | 30 | * List starts 31 | * Block without indentation 32 | ``` 33 | puts "test" 34 | ``` 35 | * List continues here 36 | * and finished here 37 | 38 | ## Indentation level in example block 39 | 40 | - Indentation of a begin_example code block 41 | #+begin_example 42 | (+ 3 5) 43 | #+end_example 44 | 45 | 46 | * Indentation of a begin_example code block 47 | ``` 48 | (+ 3 5) 49 | ``` 50 | -------------------------------------------------------------------------------- /spec/markdown_examples/code-block-lists.org: -------------------------------------------------------------------------------- 1 | * Code blocks in lists 2 | ** No spaces in code block 3 | 4 | : - List starts 5 | : + Block without indentation 6 | : #+begin_example 7 | : puts "test" 8 | : #+end_example 9 | : - List continues here 10 | : + and finished here 11 | 12 | - List starts 13 | + Block without indentation 14 | #+begin_example 15 | puts "test" 16 | #+end_example 17 | - List continues here 18 | + and finished here 19 | 20 | ** Code block indented 21 | 22 | : - List starts 23 | : + Block without indentation 24 | : #+begin_example ruby 25 | : puts "test" 26 | : #+end_example 27 | : - List continues here 28 | : + and finished here 29 | 30 | - List starts 31 | + Block without indentation 32 | #+begin_example 33 | puts "test" 34 | #+end_example 35 | - List continues here 36 | + and finished here 37 | 38 | ** Indentation level in example block 39 | 40 | : - Indentation of a begin_example code block 41 | : #+begin_example 42 | : (+ 3 5) 43 | : #+end_example 44 | : 45 | 46 | - Indentation of a begin_example code block 47 | #+begin_example 48 | (+ 3 5) 49 | #+end_example 50 | 51 | -------------------------------------------------------------------------------- /spec/markdown_examples/code-comment.md: -------------------------------------------------------------------------------- 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 | ``` 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 | ``` 22 | -------------------------------------------------------------------------------- /spec/markdown_examples/code-comment.org: -------------------------------------------------------------------------------- 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 | 23 | -------------------------------------------------------------------------------- /spec/markdown_examples/code-lists.md: -------------------------------------------------------------------------------- 1 | # normal list should work 2 | 3 | * one 4 | text in the same line 5 | 6 | This is a paragraph 7 | * A sublist 8 | * Another sublist 9 | 10 | Sublist paragraph 11 | * 2nd sublist 12 | * 2nd sublist item 13 | 14 | Paragraph from 2nd sublist 15 | * two 16 | * a new list 17 | 18 | paragraph 19 | * another sublist 20 | * final list 21 | # paragraphs in lists should work 22 | 23 | * Foo 24 | * How does this work? 25 | 26 | uno dos tres 27 | * Should not this be a paragraph? 28 | * Bar 29 | 30 | # begin example in lists should work 31 | 32 | * Foo 33 | ``` 34 | class Hello 35 | def say 36 | puts 'cheers' 37 | end 38 | end 39 | ``` 40 | * Bar 41 | ``` 42 | This gets lumped in to the above line "Example" 43 | ``` 44 | * Hello 45 | 46 | # begin quote in lists should work 47 | 48 | * Example 49 | * Uno 50 | Lorem 51 | A quote!!! 52 | dolor 53 | * Dos 54 | 55 | # tables in lists should work 56 | 57 | * Example 58 | * Table 59 | 60 | This table: 61 | | a | b | 62 | | 0 | 1 | 63 | | 1 | 2 | 64 | 65 | * After the table 66 | 67 | The table should be above 68 | 69 | # definition lists should work 70 | 71 | * Example 72 | Hello :: Hola 73 | Paragrap continues here 74 | Cuando me desperte, el dinosaurio estaba alli. 75 | Dog :: Perro 76 | Paragraph 77 | * Last sublist 78 | * Another list 79 | * with a sublist 80 | -------------------------------------------------------------------------------- /spec/markdown_examples/code-lists.org: -------------------------------------------------------------------------------- 1 | * normal list should work 2 | 3 | - one 4 | text in the same line 5 | 6 | This is a paragraph 7 | + A sublist 8 | - Another sublist 9 | 10 | Sublist paragraph 11 | + 2nd sublist 12 | - 2nd sublist item 13 | 14 | Paragraph from 2nd sublist 15 | - two 16 | 1. a new list 17 | 18 | paragraph 19 | 2. another sublist 20 | - final list 21 | * paragraphs in lists should work 22 | 23 | - Foo 24 | + How does this work? 25 | 26 | uno dos tres 27 | + Should not this be a paragraph? 28 | - Bar 29 | 30 | * begin example in lists should work 31 | 32 | - Foo 33 | #+begin_example 34 | class Hello 35 | def say 36 | puts 'cheers' 37 | end 38 | end 39 | #+end_example 40 | - Bar 41 | #+begin_example 42 | This gets lumped in to the above line "Example" 43 | #+end_example 44 | - Hello 45 | 46 | * begin quote in lists should work 47 | 48 | - Example 49 | + Uno 50 | Lorem 51 | #+begin_quote 52 | A quote!!! 53 | #+end_quote 54 | dolor 55 | + Dos 56 | 57 | * tables in lists should work 58 | 59 | - Example 60 | + Table 61 | 62 | This table: 63 | | a | b | 64 | | 0 | 1 | 65 | | 1 | 2 | 66 | 67 | - After the table 68 | 69 | The table should be above 70 | 71 | * definition lists should work 72 | 73 | - Example 74 | + Hello :: Hola 75 | Paragrap continues here 76 | #+begin_quote 77 | Cuando me desperte, el dinosaurio estaba alli. 78 | #+end_quote 79 | + Dog :: Perro 80 | Paragraph 81 | + Last sublist 82 | - Another list 83 | + with a sublist 84 | -------------------------------------------------------------------------------- /spec/markdown_examples/comment-trees.md: -------------------------------------------------------------------------------- 1 | # This headline is in the output 2 | # This is in the output 3 | ## Yet, this is in the output 4 | and this is also part of the output 5 | -------------------------------------------------------------------------------- /spec/markdown_examples/comment-trees.org: -------------------------------------------------------------------------------- 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 14 | -------------------------------------------------------------------------------- /spec/markdown_examples/custom-seq-todo.md: -------------------------------------------------------------------------------- 1 | 2 | I copied this todo sequence from Worg. It shows a lot of power of the 3 | built-in todo functionality. Now, let's make sure all of these are 4 | recognized (and therefore NOT exported.) 5 | 6 | # Sample 7 | 8 | * State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 9 | I gave up. 10 | * State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 11 | huh? 12 | 13 | # this one's in progress 14 | # who am I waiting on? 15 | # Finished this one! 16 | # I gave up here. 17 | # DONT be fooled by just a random word in all caps. 18 | # todo <== this word doesn't match because the case doesn't match. 19 | # TODOX 20 | don't be fooled by the initial substring above! 21 | -------------------------------------------------------------------------------- /spec/markdown_examples/custom-seq-todo.org: -------------------------------------------------------------------------------- 1 | #+TITLE: custom-todo.org 2 | #+DESCRIPTION: Makes sure I can handle custom todo entries 3 | #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) 4 | #+OPTIONS: todo:t 5 | 6 | I copied this todo sequence from Worg. It shows a lot of power of the 7 | built-in todo functionality. Now, let's make sure all of these are 8 | recognized (and therefore NOT exported.) 9 | 10 | * TODO Sample 11 | 12 | - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 13 | I gave up. 14 | - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 15 | huh? 16 | 17 | * INPROGRESS this one's in progress 18 | * WAITING who am I waiting on? 19 | * DONE Finished this one! 20 | * CANCELED I gave up here. 21 | * DONT be fooled by just a random word in all caps. 22 | * todo <== this word doesn't match because the case doesn't match. 23 | * TODOX 24 | don't be fooled by the initial substring above! 25 | -------------------------------------------------------------------------------- /spec/markdown_examples/custom-todo.md: -------------------------------------------------------------------------------- 1 | 2 | I copied this todo sequence from Worg. It shows a lot of power of the 3 | built-in todo functionality. Now, let's make sure all of these are 4 | recognized (and therefore NOT exported.) 5 | 6 | # Sample 7 | 8 | * State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 9 | I gave up. 10 | * State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 11 | huh? 12 | 13 | # this one's in progress 14 | # who am I waiting on? 15 | # Finished this one! 16 | # I gave up here. 17 | # DONT be fooled by just a random word in all caps. 18 | # todo <== this word doesn't match because the case doesn't match. 19 | # TODOX 20 | don't be fooled by the initial substring above! 21 | -------------------------------------------------------------------------------- /spec/markdown_examples/custom-todo.org: -------------------------------------------------------------------------------- 1 | #+TITLE: custom-todo.org 2 | #+DESCRIPTION: Makes sure I can handle custom todo entries 3 | #+TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) 4 | #+OPTIONS: todo:t 5 | 6 | I copied this todo sequence from Worg. It shows a lot of power of the 7 | built-in todo functionality. Now, let's make sure all of these are 8 | recognized (and therefore NOT exported.) 9 | 10 | * TODO Sample 11 | 12 | - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 13 | I gave up. 14 | - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 15 | huh? 16 | 17 | * INPROGRESS this one's in progress 18 | * WAITING who am I waiting on? 19 | * DONE Finished this one! 20 | * CANCELED I gave up here. 21 | * DONT be fooled by just a random word in all caps. 22 | * todo <== this word doesn't match because the case doesn't match. 23 | * TODOX 24 | don't be fooled by the initial substring above! 25 | -------------------------------------------------------------------------------- /spec/markdown_examples/custom-typ-todo.md: -------------------------------------------------------------------------------- 1 | 2 | I copied this todo sequence from Worg. It shows a lot of power of the 3 | built-in todo functionality. Now, let's make sure all of these are 4 | recognized (and therefore NOT exported.) 5 | 6 | # Sample 7 | 8 | * State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 9 | I gave up. 10 | * State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 11 | huh? 12 | 13 | # this one's in progress 14 | # who am I waiting on? 15 | # Finished this one! 16 | # I gave up here. 17 | # DONT be fooled by just a random word in all caps. 18 | # todo <== this word doesn't match because the case doesn't match. 19 | # TODOX 20 | don't be fooled by the initial substring above! 21 | -------------------------------------------------------------------------------- /spec/markdown_examples/custom-typ-todo.org: -------------------------------------------------------------------------------- 1 | #+TITLE: custom-todo.org 2 | #+DESCRIPTION: Makes sure I can handle custom todo entries 3 | #+TYP_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) 4 | #+OPTIONS: todo:t 5 | 6 | I copied this todo sequence from Worg. It shows a lot of power of the 7 | built-in todo functionality. Now, let's make sure all of these are 8 | recognized (and therefore NOT exported.) 9 | 10 | * TODO Sample 11 | 12 | - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ 13 | I gave up. 14 | - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ 15 | huh? 16 | 17 | * INPROGRESS this one's in progress 18 | * WAITING who am I waiting on? 19 | * DONE Finished this one! 20 | * CANCELED I gave up here. 21 | * DONT be fooled by just a random word in all caps. 22 | * todo <== this word doesn't match because the case doesn't match. 23 | * TODOX 24 | don't be fooled by the initial substring above! 25 | -------------------------------------------------------------------------------- /spec/markdown_examples/deflist.md: -------------------------------------------------------------------------------- 1 | 2 | a :: hello 3 | b :: world 4 | 5 | Text 6 | 7 | # Asterisk can be used for lists 8 | 9 | One :: The first number. 10 | Two :: The second number. 11 | Three :: The second number. 12 | 13 | # Corner cases of definition lists 14 | 15 | The following examples show how org-ruby behave 16 | when handling some cases of definition lists. 17 | (Many thanks to [vonavi](https://github.com/vonavi) for his contributions here) 18 | 19 | ## Definition List Items 20 | 21 | * Regular list 22 | Key :: Value (k1) 23 | Key :: Value (k2) 24 | Key :: Value (k3) 25 | 26 | * Semicolon as part of key 27 | K::e::y :: Value (k1) 28 | K::e::y :: Value (k2) 29 | 30 | * Paragraph break after key 31 | Key :: 32 | Value (k1) 33 | Key :: 34 | Value (k2) 35 | 36 | * Many semicolons in same line 37 | Key :: Value :: Still value (k1) 38 | Key :: Value :: Still value (k2) 39 | 40 | * Semicolon placement cases 41 | * Case 1 42 | Key ::MoreKey :: Value (k1) 43 | * Case 2 44 | Key:: MoreKey :: Value (k2) 45 | * Case 3 46 | :: Key :: Value (k3) 47 | 48 | ## Not Definition List Items 49 | 50 | The following cases will not be considered as definition lists 51 | but just regular lists. 52 | 53 | * Key:: Value (n1) 54 | * Key ::Value (n2) 55 | * Key::Value (n3) 56 | * Key:: 57 | Value (n4) 58 | * Key 59 | :: Value (n5) 60 | 61 | ## Definition List Item without Definition 62 | 63 | ??? will be shown in this case 64 | 65 | * Example list 66 | Key :: Value :: Still value (k1) 67 | Paragraph :: with :: no value 68 | Key :: Value :: Still value (k1) :: 69 | Paragraph :: with :: no value :: 70 | :: 71 | Paragraph :: with :: no value 72 | -------------------------------------------------------------------------------- /spec/markdown_examples/deflist.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Hallo 2 | 3 | - a :: hello 4 | - b :: world 5 | 6 | Text 7 | 8 | * Asterisk can be used for lists 9 | 10 | * One :: The first number. 11 | * Two :: The second number. 12 | * Three :: The second number. 13 | 14 | * Corner cases of definition lists 15 | 16 | The following examples show how org-ruby behave 17 | when handling some cases of definition lists. 18 | (Many thanks to [[https://github.com/vonavi][vonavi]] for his contributions here) 19 | 20 | ** Definition List Items 21 | 22 | - Regular list 23 | + Key :: Value (k1) 24 | + Key :: Value (k2) 25 | + Key :: Value (k3) 26 | 27 | - Semicolon as part of key 28 | - K::e::y :: Value (k1) 29 | - K::e::y :: Value (k2) 30 | 31 | - Paragraph break after key 32 | + Key :: 33 | Value (k1) 34 | + Key :: 35 | Value (k2) 36 | 37 | - Many semicolons in same line 38 | + Key :: Value :: Still value (k1) 39 | + Key :: Value :: Still value (k2) 40 | 41 | - Semicolon placement cases 42 | + Case 1 43 | * Key ::MoreKey :: Value (k1) 44 | + Case 2 45 | * Key:: MoreKey :: Value (k2) 46 | + Case 3 47 | * :: Key :: Value (k3) 48 | 49 | ** Not Definition List Items 50 | 51 | The following cases will not be considered as definition lists 52 | but just regular lists. 53 | 54 | - Key:: Value (n1) 55 | - Key ::Value (n2) 56 | - Key::Value (n3) 57 | - Key:: 58 | Value (n4) 59 | - Key 60 | :: Value (n5) 61 | 62 | ** Definition List Item without Definition 63 | 64 | ??? will be shown in this case 65 | 66 | - Example list 67 | + Key :: Value :: Still value (k1) 68 | Paragraph :: with :: no value 69 | + Key :: Value :: Still value (k1) :: 70 | Paragraph :: with :: no value :: 71 | + :: 72 | Paragraph :: with :: no value 73 | -------------------------------------------------------------------------------- /spec/markdown_examples/escape-pre.md: -------------------------------------------------------------------------------- 1 | ``` 2 |