├── .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 | {Build Status}[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 | # => "

Hello world!

\n" 28 | 29 | # Renders Textile 30 | Orgmode::Parser.new("* Hello world!").to_textile 31 | # => "h1. Hello world!\n" 32 | 33 | # Renders Markdown 34 | Orgmode::Parser.new("* Hello world!").to_markdown 35 | # => "# Hello world!\n" 36 | 37 | It can also be used from the command line: 38 | 39 | org-ruby sample.org --translate html 40 | 41 | ...will output a HTML version of sample.org. 42 | 43 | org-ruby --translate textile sample.org 44 | 45 | ...will output a textile version of sample.org. 46 | 47 | org-ruby --translate markdown sample.org 48 | 49 | ...will output a markdown version of sample.org. 50 | 51 | == Features 52 | 53 | * Converts org-mode files to HTML or Textile 54 | * Supports tables, block quotes, code blocks, and html blocks 55 | * Supports bold, italic, underline, strikethrough, and code inline formatting. 56 | * Supports hyperlinks that are in double-brackets 57 | * Supports definition lists 58 | * Supports footnotes 59 | * Supports +.org+ views in Rails through Tilt. 60 | * Code syntax highlight of code blocks using Pygments.rb or Coderay when available 61 | 62 | == License 63 | 64 | (The MIT License) 65 | 66 | Copyright (c) 2009 Brian Dewey 67 | 68 | Permission is hereby granted, free of charge, to any person obtaining 69 | a copy of this software and associated documentation files (the 70 | 'Software'), to deal in the Software without restriction, including 71 | without limitation the rights to use, copy, modify, merge, publish, 72 | distribute, sublicense, and/or sell copies of the Software, and to 73 | permit persons to whom the Software is furnished to do so, subject to 74 | the following conditions: 75 | 76 | The above copyright notice and this permission notice shall be 77 | included in all copies or substantial portions of the Software. 78 | 79 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 80 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 81 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 82 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 83 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 84 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 85 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rspec/core' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |spec| 5 | spec.pattern = FileList['spec/**/*_spec.rb'] 6 | spec.rspec_opts = ["--format", "documentation", "--colour"] 7 | end 8 | 9 | Dir['tasks/*'].each {|task| import task } 10 | 11 | task :default => 'test' 12 | -------------------------------------------------------------------------------- /bench/Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | # Bench with the current version in development 4 | gem 'org-ruby', :path => '..' 5 | -------------------------------------------------------------------------------- /bench/Gemfile_6_0: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'org-ruby', '0.6.0' 4 | -------------------------------------------------------------------------------- /bench/Gemfile_6_1: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'org-ruby', '0.6.1' 4 | -------------------------------------------------------------------------------- /bench/Gemfile_6_2: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'org-ruby', '0.6.2' 4 | -------------------------------------------------------------------------------- /bench/Gemfile_6_3: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'org-ruby', '0.6.3' 4 | -------------------------------------------------------------------------------- /bench/Gemfile_redcarpet: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'redcarpet' 4 | -------------------------------------------------------------------------------- /bench/parsing_redcarpet_test.rb: -------------------------------------------------------------------------------- 1 | require 'redcarpet' 2 | require 'benchmark' 3 | 4 | def run_benchmark(n=30) 5 | org_content = File.open('bench.org').read 6 | 7 | puts "Parsing #{n} times" 8 | markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) 9 | Benchmark.bmbm do |x| 10 | x.report('html conversion with Redcarpet') do 11 | n.times do 12 | markdown.render(org_content) 13 | end 14 | end 15 | end 16 | end 17 | 18 | puts "Running benchmark with RedCarpet with Ruby #{RUBY_VERSION} (n=30)" 19 | run_benchmark 20 | -------------------------------------------------------------------------------- /bench/parsing_test.rb: -------------------------------------------------------------------------------- 1 | require 'org-ruby' 2 | require 'benchmark' 3 | 4 | def run_html_output_benchmark(n=30) 5 | org_content = File.open('bench.org').read 6 | 7 | puts "Parsing #{n} times" 8 | Benchmark.bmbm do |x| 9 | 10 | x.report('html conversion') do 11 | n.times do 12 | Orgmode::Parser.new(org_content).to_html 13 | end 14 | end 15 | end 16 | end 17 | 18 | def run_textile_output_benchmark(n=30) 19 | org_content = File.open('bench.org').read 20 | 21 | puts "Parsing #{n} times" 22 | x.report('textile conversion') do 23 | n.times do 24 | Orgmode::Parser.new(content).to_textile 25 | end 26 | end 27 | end 28 | 29 | def run_parsing_file_benchmark(n=30) 30 | puts "Parsing #{n} times" 31 | x.report('textile conversion') do 32 | n.times do 33 | Orgmode::Parser.load('bench.org') 34 | end 35 | end 36 | end 37 | 38 | puts "Running benchmark using OrgRuby version #{OrgRuby::VERSION} with Ruby #{RUBY_VERSION}" 39 | run_html_output_benchmark 40 | # run_textile_output_benchmark 41 | # run_parsing_file_benchmark 42 | -------------------------------------------------------------------------------- /bin/org-ruby: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'org-ruby' 3 | require 'optparse' 4 | 5 | options = {} 6 | options_parser = OptionParser.new do |opts| 7 | options[:help] = false 8 | options[:format] = :html 9 | 10 | opts.banner = "Usage: org-ruby [options]" 11 | 12 | opts.on("-h", "--help", "Show this message") do |v| 13 | options[:help] = true 14 | end 15 | 16 | opts.on("-d", "--debug", "Run with $DEBUG true") do |v| 17 | options[:debug] = true 18 | end 19 | 20 | opts.on("-t", "--translate FORMAT", [:html, :textile, :markdown], 21 | "Translate the ORG file to the specified format.") do |v| 22 | options[:format] = v 23 | end 24 | 25 | opts.on("-v", "--version", "Print version") do |v| 26 | options[:version] = true 27 | end 28 | end 29 | 30 | begin 31 | options_parser.parse! 32 | 33 | if options[:version] 34 | puts OrgRuby::VERSION 35 | exit 36 | end 37 | 38 | if (ARGV.length == 0) then 39 | puts options_parser 40 | else 41 | data = IO.read(ARGV[0]) 42 | p = Orgmode::Parser.new(data) 43 | $DEBUG = true if options[:debug] 44 | puts p.to_html if options[:format] == :html 45 | puts p.to_textile if options[:format] == :textile 46 | puts p.to_markdown if options[:format] == :markdown 47 | end 48 | rescue OptionParser::ParseError 49 | puts options_parser 50 | end 51 | -------------------------------------------------------------------------------- /lib/org-ruby.rb: -------------------------------------------------------------------------------- 1 | $:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed 2 | 3 | # internal requires 4 | require 'org-ruby/version' 5 | require 'org-ruby/parser' 6 | require 'org-ruby/regexp_helper' 7 | require 'org-ruby/line' 8 | require 'org-ruby/headline' 9 | require 'org-ruby/output_buffer' 10 | 11 | # HTML exporter 12 | require 'org-ruby/html_output_buffer' 13 | require 'org-ruby/html_symbol_replace' 14 | 15 | # Textile exporter 16 | require 'org-ruby/textile_output_buffer' 17 | require 'org-ruby/textile_symbol_replace' 18 | 19 | # Markdown exporter 20 | require 'org-ruby/markdown_output_buffer' 21 | 22 | # Tilt support 23 | require 'org-ruby/tilt' 24 | 25 | module OrgRuby 26 | 27 | # :stopdoc: 28 | LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR 29 | PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR 30 | # :startdoc: 31 | 32 | # Returns the version string for the library. 33 | # 34 | def self.version 35 | VERSION 36 | end 37 | 38 | # Utility method used to require all files ending in .rb that lie in the 39 | # directory below this file that has the same name as the filename passed 40 | # in. Optionally, a specific _directory_ name can be passed in such that 41 | # the _filename_ does not have to be equivalent to the directory. 42 | # 43 | def self.require_all_libs_relative_to( fname, dir = nil ) 44 | dir ||= ::File.basename(fname, '.*') 45 | search_me = ::File.expand_path( 46 | ::File.join(::File.dirname(fname), dir, '**', '*.rb')) 47 | 48 | Dir.glob(search_me).sort.each {|rb| require rb} 49 | end 50 | 51 | end 52 | -------------------------------------------------------------------------------- /lib/org-ruby/markdown_output_buffer.rb: -------------------------------------------------------------------------------- 1 | require 'stringio' 2 | 3 | module Orgmode 4 | 5 | class MarkdownOutputBuffer < OutputBuffer 6 | 7 | def initialize(output) 8 | super(output) 9 | end 10 | 11 | def push_mode(mode, indent) 12 | super(mode, indent) 13 | end 14 | 15 | def pop_mode(mode = nil) 16 | m = super(mode) 17 | @list_indent_stack.pop 18 | m 19 | end 20 | 21 | # Maps org markup to markdown markup. 22 | MarkdownMap = { 23 | "*" => "**", 24 | "/" => "*", 25 | "_" => "*", 26 | "=" => "`", 27 | "~" => "`", 28 | "+" => "~~" 29 | } 30 | 31 | # Handles inline formatting for markdown. 32 | def inline_formatting(input) 33 | @re_help.rewrite_emphasis input do |marker, body| 34 | m = MarkdownMap[marker] 35 | "#{m}#{body}#{m}" 36 | end 37 | @re_help.rewrite_subp input do |type, text| 38 | if type == "_" then 39 | "#{text}" 40 | elsif type == "^" then 41 | "#{text}" 42 | end 43 | end 44 | @re_help.rewrite_links input do |link, defi| 45 | # We don't add a description for images in links, because its 46 | # empty value forces the image to be inlined. 47 | defi ||= link unless link =~ @re_help.org_image_file_regexp 48 | link = link.gsub(/ /, "%%20") 49 | 50 | if defi =~ @re_help.org_image_file_regexp 51 | "![#{defi}](#{defi})" 52 | elsif defi 53 | "[#{defi}](#{link})" 54 | else 55 | "[#{link}](#{link})" 56 | end 57 | end 58 | 59 | # Just reuse Textile special symbols for now? 60 | Orgmode.special_symbols_to_textile(input) 61 | input = @re_help.restore_code_snippets input 62 | input 63 | end 64 | 65 | # TODO: Implement this 66 | def output_footnotes! 67 | return false 68 | end 69 | 70 | # Flushes the current buffer 71 | def flush! 72 | return false if @buffer.empty? and @output_type != :blank 73 | @logger.debug "FLUSH ==========> #{@output_type}" 74 | @buffer.gsub!(/\A\n*/, "") 75 | 76 | case 77 | when mode_is_code?(current_mode) 78 | @output << "```#{@block_lang}\n" 79 | @output << @buffer << "\n" 80 | @output << "```\n" 81 | when preserve_whitespace? 82 | @output << @buffer << "\n" 83 | 84 | when @output_type == :blank 85 | @output << "\n" 86 | 87 | else 88 | case current_mode 89 | when :paragraph 90 | @output << "> " if @mode_stack[0] == :quote 91 | 92 | when :list_item 93 | @output << " " * @mode_stack.count(:list_item) << "* " 94 | 95 | when :horizontal_rule 96 | @output << "---" 97 | 98 | end 99 | @output << inline_formatting(@buffer) << "\n" 100 | end 101 | @buffer = "" 102 | end 103 | 104 | def add_line_attributes headline 105 | @output << "#" * headline.level 106 | @output << " " 107 | end 108 | end # class MarkdownOutputBuffer 109 | end # module Orgmode 110 | -------------------------------------------------------------------------------- /lib/org-ruby/tilt.rb: -------------------------------------------------------------------------------- 1 | begin 2 | require 'tilt' 3 | 4 | module Tilt 5 | class OrgTemplate < Template 6 | def self.engine_initialized? 7 | defined? ::Orgmode 8 | end 9 | 10 | def initialize_engine 11 | require 'org-ruby' 12 | end 13 | 14 | def prepare 15 | @engine = Orgmode::Parser.new(data) 16 | @output = nil 17 | end 18 | 19 | def evaluate(scope, locals, &block) 20 | @output ||= @engine.to_html 21 | end 22 | end 23 | end 24 | 25 | Tilt.register Tilt::OrgTemplate, 'org' 26 | 27 | rescue LoadError 28 | # Tilt is not available. 29 | end 30 | -------------------------------------------------------------------------------- /lib/org-ruby/version.rb: -------------------------------------------------------------------------------- 1 | module OrgRuby 2 | VERSION = '0.9.1' 3 | end 4 | -------------------------------------------------------------------------------- /org-ruby.gemspec: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | $:.push File.expand_path("../lib", __FILE__) 3 | require "org-ruby/version" 4 | 5 | Gem::Specification.new do |s| 6 | s.name = "org-ruby" 7 | s.version = OrgRuby::VERSION 8 | 9 | s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= 10 | s.authors = ["Brian Dewey"] 11 | s.date = Time.now.strftime("%Y-%m-%d") 12 | s.description = "An Org mode parser written in Ruby." 13 | s.email = "bdewey@gmail.com" 14 | s.executables = ["org-ruby"] 15 | s.extra_rdoc_files = ["History.txt", "README.rdoc", "bin/org-ruby"] 16 | s.files = ["History.txt", "README.rdoc", "bin/org-ruby", "lib/org-ruby.rb", "lib/org-ruby/headline.rb", "lib/org-ruby/html_output_buffer.rb", "lib/org-ruby/html_symbol_replace.rb", "lib/org-ruby/line.rb", "lib/org-ruby/output_buffer.rb", "lib/org-ruby/parser.rb", "lib/org-ruby/regexp_helper.rb", "lib/org-ruby/markdown_output_buffer.rb", "lib/org-ruby/textile_output_buffer.rb", "lib/org-ruby/textile_symbol_replace.rb", "lib/org-ruby/tilt.rb", "lib/org-ruby/version.rb"] 17 | s.homepage = "https://github.com/bdewey/org-ruby" 18 | s.require_paths = ["lib"] 19 | s.rubyforge_project = "org-ruby" 20 | s.rubygems_version = "1.8.10" 21 | s.summary = "This gem contains Ruby routines for parsing org-mode files." 22 | s.license = "MIT" 23 | 24 | if s.respond_to? :specification_version then 25 | s.specification_version = 3 26 | 27 | if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then 28 | s.add_runtime_dependency(%q, [">= 0.2.0"]) 29 | else 30 | s.add_dependency(%q, [">= 0.2.0"]) 31 | end 32 | else 33 | s.add_dependency(%q, [">= 0.2.0"]) 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /spec/data/remember.org: -------------------------------------------------------------------------------- 1 | * New Ideas 2 | ** YAML header in Webby 3 | 4 | Make sure you don't have TABS here. Best practice: Configure your 5 | editor to use spaces instaed of tabs, and if you can see whitespace, 6 | even better. 7 | 8 | In emacs, set indent-tabs-mode to NIL. 9 | ** Ruby Gems behind Proxy 10 | 11 | Set the following environment variable: 12 | 13 | So, I added a User Variable for my account called http_proxy with 14 | the value of http://:8080, rebooted, ran plan 15 | old vanillia gem install rails –include-dependencies, and magically, 16 | it worked 17 | ** Hyper-V technical info 18 | 19 | http://technet.microsoft.com/en-us/dd565807.aspx 20 | ** VirtualBox 21 | 22 | Virtualization software from Sun. Looks like it might be more for 23 | dev/test. I'm surprised this hasn't popped at 24 | all. http://www.virtualbox.org/. Backed by Sun. 25 | ** Interesting LaTeX article 26 | 27 | http://nitens.org/taraborelli/latex -- on the virtues of LaTeX 28 | ** XEmacs / Emacs internals 29 | 30 | Looks like an interesting resource if I want to learn how Emacs works. 31 | 32 | http://www.xemacs.org/Documentation/21.5/html/internals_9.html#SEC19 33 | ** MikTeX 34 | 35 | Get it here: http://www.miktex.org/portable/ 36 | ** Orgmode publishing tutorial 37 | 38 | [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php][Publishing Org-mode files to HTML]] 39 | ** Git and Live Mesh 40 | 41 | This is really helpful: 42 | http://whereslou.com/2009/06/04/using-live-mesh-and-git-the-best-of-both-worlds 43 | ** VDI deployment stats 44 | 45 | Key takeaways: 46 | - 74% are using VDI in production or pilot ... but 45% of those using have less than 100 users 47 | - Upward of 55% of the DAC members [project] they will have up to 50% of their users using VDI in 3 years (~1/2 of those will have > 50%) 48 | - No real surprises on the reasons / benefits etc 49 | - Interestingly ... even if TS supported all client apps / supported user-install apps - 100% of the DAC preferred VDI over TS 50 | - Most companies said a portion of their users would have VDI as the primary replacement desktop (60% < 20% of users, 32% 21-50% of users) 51 | ** Hyper-V Scheduler Information 52 | 53 | http://msdn.microsoft.com/en-us/library/bb969782.aspx 54 | -------------------------------------------------------------------------------- /spec/data/tables.org: -------------------------------------------------------------------------------- 1 | * a table with hline at the beginning 2 | |-----+-----| 3 | | foo | bar | 4 | |-----+-----| 5 | | 1 | 2 | 6 | * not a table 7 | -------------------------------------------------------------------------------- /spec/headline_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Orgmode::Headline do 4 | 5 | it "should recognize headlines that start with asterisks" do 6 | Orgmode::Headline.headline?("*** test\n").should_not be_nil 7 | end 8 | 9 | it "should reject headlines without headlines at the start" do 10 | Orgmode::Headline.headline?(" nope!").should be_nil 11 | Orgmode::Headline.headline?(" tricked you!!!***").should be_nil 12 | end 13 | 14 | it "should reject improper initialization" do 15 | lambda { Orgmode::Headline.new " tricked**" }.should raise_error 16 | end 17 | 18 | it "should properly determine headline level" do 19 | samples = ["* one", "** two", "*** three", "**** four"] 20 | expected = 1 21 | samples.each do |sample| 22 | h = Orgmode::Headline.new sample 23 | h.level.should eql(expected) 24 | expected += 1 25 | end 26 | end 27 | 28 | it "should properly determine headline level with offset" do 29 | h = Orgmode::Headline.new("* one", nil, 1) 30 | h.level.should eql(2) 31 | end 32 | 33 | it "should find simple headline text" do 34 | h = Orgmode::Headline.new "*** sample" 35 | h.headline_text.should eql("sample") 36 | end 37 | 38 | it "should understand tags" do 39 | h = Orgmode::Headline.new "*** sample :tag:tag2:\n" 40 | h.headline_text.should eql("sample") 41 | h.should have(2).tags 42 | h.tags[0].should eql("tag") 43 | h.tags[1].should eql("tag2") 44 | end 45 | 46 | it "should understand a single tag" do 47 | h = Orgmode::Headline.new "*** sample :tag:\n" 48 | h.headline_text.should eql("sample") 49 | h.should have(1).tags 50 | h.tags[0].should eql("tag") 51 | end 52 | 53 | it "should understand keywords" do 54 | h = Orgmode::Headline.new "*** TODO Feed cat :home:" 55 | h.headline_text.should eql("Feed cat") 56 | h.keyword.should eql("TODO") 57 | end 58 | 59 | it "should recognize headlines marked as COMMENT" do 60 | h = Orgmode::Headline.new "* COMMENT This headline is a comment" 61 | h.comment_headline?.should_not be_nil 62 | end 63 | end 64 | 65 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/advanced-code-no-color.html: -------------------------------------------------------------------------------- 1 |

advanced-code.org

2 |

Turns out there’s more way to do code than just BEGIN_EXAMPLE.

3 |

1 Inline examples

4 |

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 |

2 BEGIN_SRC

18 |

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 |

3 It should be possible to write a colon at the beginning of an example

53 |
54 |

I really love to write about 55 | :symbols. They sure are the 56 | best things in the world!

57 |
58 |
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 |

Simple Code Syntax highlighting test

2 |
 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 |

When including a file as an src code file

15 |
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 = <Simple Code Syntax highlighting test 2 |
 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 |

When including a file as an src code file

36 |
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 = <Simple Code Syntax highlighting test 2 |
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 | 
13 |

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 | 
33 |

When including a file as an src code file

34 |
- 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 | 
38 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/code-pygments.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 = <Removing the prepended comma from Org mode src blocks 2 |

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 |

Here the prepended comma will be removed.

7 |
* Hello
 8 | ** Goodbye
 9 |  *** Not a headline, but prepended comma still removed.
10 | * I am a headline
11 | 
12 |

Here the prepended comma is should not be removed.

13 |
14 | {
15 |   "one":   1
16 | , "two":   2
17 | , "three": 3
18 | , "four":  4
19 | }
20 | 
21 |

Here the prepended comma is also removed

22 |

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 |

Here the prepended comma will be remove for the Hello world headline

31 |
32 | ,  ,* Hi
33 | ,  
34 | ,  ,* This will be appended a comma
35 | * Hello world  
36 | ,  
37 | 
38 |

Here the prepended comma will be removed

39 |
#+TITLE: "Hello world"
40 | 
41 |

This will be rendered as normal

42 |
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 , 4 | when at the beginning of the line there is either ",*" or ",#+" 5 | this prepended comma should be removed before parsing. 6 | 7 | (Fixes ) 8 | 9 | ** DONE Here the prepended comma will be removed. 10 | 11 | #+begin_src org 12 | ,* Hello 13 | ,** Goodbye 14 | , *** Not a headline, but prepended comma still removed. 15 | ,* I am a headline 16 | #+end_src 17 | 18 | ** DONE Here the prepended comma is should not be removed. 19 | 20 | #+begin_src js 21 | { 22 | "one": 1 23 | , "two": 2 24 | , "three": 3 25 | , "four": 4 26 | } 27 | #+end_src 28 | 29 | ** DONE Here the prepended comma is also removed 30 | Emacs Org mode implementation also removes it. 31 | 32 | #+begin_src ruby 33 | text = <Removing the prepended comma from Org mode src blocks 2 |

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 |

Here the prepended comma will be removed.

7 |
* Hello
 8 | ** Goodbye
 9 |  *** Not a headline, but prepended comma still removed.
10 | * I am a headline
11 | 
12 |

Here the prepended comma is should not be removed.

13 |
14 | {
15 |   "one":   1
16 | , "two":   2
17 | , "three": 3
18 | , "four":  4
19 | }
20 | 
21 |

Here the prepended comma is also removed

22 |

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 |

Here the prepended comma will be remove for the Hello world headline

31 |
32 | ,  ,* Hi
33 | ,  
34 | ,  ,* This will be appended a comma
35 | * Hello world  
36 | ,  
37 | 
38 |

Here the prepended comma will be removed

39 |
#+TITLE: "Hello world"
40 | 
41 |

This will be rendered as normal

42 |
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 , 4 | when at the beginning of the line there is either ",*" or ",#+" 5 | this prepended comma should be removed before parsing. 6 | 7 | (Fixes ) 8 | 9 | ** DONE Here the prepended comma will be removed. 10 | 11 | #+begin_src org 12 | ,* Hello 13 | ,** Goodbye 14 | , *** Not a headline, but prepended comma still removed. 15 | ,* I am a headline 16 | #+end_src 17 | 18 | ** DONE Here the prepended comma is should not be removed. 19 | 20 | #+begin_src js 21 | { 22 | "one": 1 23 | , "two": 2 24 | , "three": 3 25 | , "four": 4 26 | } 27 | #+end_src 28 | 29 | ** DONE Here the prepended comma is also removed 30 | Emacs Org mode implementation also removes it. 31 | 32 | #+begin_src ruby 33 | text = <Removing the prepended comma from Org mode src blocks 2 |

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 |

Here the prepended comma will be removed.

7 |
* Hello
 8 | ** Goodbye
 9 |  *** Not a headline, but prepended comma still removed.
10 | * I am a headline
11 | 
12 |

Here the prepended comma is should not be removed.

13 |
{
14 |   "one":   1
15 | , "two":   2
16 | , "three": 3
17 | , "four":  4
18 | }
19 | 
20 |

Here the prepended comma is also removed

21 |

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 | 
28 |

Here the prepended comma will be remove for the Hello world headline

29 |
,  ,* Hi
30 | ,  
31 | ,  ,* This will be appended a comma
32 | * Hello world  
33 | ,  
34 | 
35 |

Here the prepended comma will be removed

36 |
#+TITLE: "Hello world"
37 | 
38 |

This will be rendered as normal

39 |
,,,,,,,,,,,,,,,,,*Hello world
40 | 
41 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/prepended-comma-pygments.org: -------------------------------------------------------------------------------- 1 | * Removing the prepended comma from Org mode src blocks 2 | 3 | As mentioned in , 4 | when at the beginning of the line there is either ",*" or ",#+" 5 | this prepended comma should be removed before parsing. 6 | 7 | (Fixes ) 8 | 9 | ** DONE Here the prepended comma will be removed. 10 | 11 | #+begin_src org 12 | ,* Hello 13 | ,** Goodbye 14 | , *** Not a headline, but prepended comma still removed. 15 | ,* I am a headline 16 | #+end_src 17 | 18 | ** DONE Here the prepended comma is should not be removed. 19 | 20 | #+begin_src js 21 | { 22 | "one": 1 23 | , "two": 2 24 | , "three": 3 25 | , "four": 4 26 | } 27 | #+end_src 28 | 29 | ** DONE Here the prepended comma is also removed 30 | Emacs Org mode implementation also removes it. 31 | 32 | #+begin_src ruby 33 | text = <begin src in lists should work 2 |
    3 |
  • Foo 4 |
     5 | class Hello
     6 |   def say
     7 |     puts 'cheers'
     8 |   end
     9 | end
    10 |     
    11 |
  • 12 |
  • Bar 13 |
    14 | puts "This should not get lumped into the above line Example"
    15 |     
    16 |

    A paragraph should go here.

    17 |
      18 |
    • A sublist goes here with another example 19 |
      20 | echo "Hello"
      21 |         
      22 |

      And this is a paragraph

      23 |
    • 24 |
    25 |
  • 26 |
  • Hello
  • 27 |
28 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/src-code-list-coderay.org: -------------------------------------------------------------------------------- 1 | * begin src in lists should work 2 | 3 | - Foo 4 | #+begin_src ruby 5 | class Hello 6 | def say 7 | puts 'cheers' 8 | end 9 | end 10 | #+end_src 11 | 12 | - Bar 13 | 14 | #+begin_src ruby 15 | puts "This should not get lumped into the above line Example" 16 | #+end_src 17 | 18 | A paragraph should go here. 19 | 20 | + A sublist goes here with another example 21 | #+begin_src sh 22 | echo "Hello" 23 | #+end_src 24 | 25 | And this is a paragraph 26 | - Hello 27 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/src-code-list-no-color.html: -------------------------------------------------------------------------------- 1 |

begin src in lists should work

2 |
    3 |
  • Foo 4 |
     5 | class Hello
     6 |   def say
     7 |     puts 'cheers'
     8 |   end
     9 | end
    10 |     
    11 |
  • 12 |
  • Bar 13 |
    14 | puts "This should not get lumped into the above line Example"
    15 |     
    16 |

    A paragraph should go here.

    17 |
      18 |
    • A sublist goes here with another example 19 |
      20 | echo "Hello"
      21 |         
      22 |

      And this is a paragraph

      23 |
    • 24 |
    25 |
  • 26 |
  • Hello
  • 27 |
28 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/src-code-list-no-color.org: -------------------------------------------------------------------------------- 1 | * begin src in lists should work 2 | 3 | - Foo 4 | #+begin_src ruby 5 | class Hello 6 | def say 7 | puts 'cheers' 8 | end 9 | end 10 | #+end_src 11 | 12 | - Bar 13 | 14 | #+begin_src ruby 15 | puts "This should not get lumped into the above line Example" 16 | #+end_src 17 | 18 | A paragraph should go here. 19 | 20 | + A sublist goes here with another example 21 | #+begin_src sh 22 | echo "Hello" 23 | #+end_src 24 | 25 | And this is a paragraph 26 | - Hello 27 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/src-code-list-pygments.html: -------------------------------------------------------------------------------- 1 |

begin src in lists should work

2 |
    3 |
  • Foo 4 |
    class Hello
     5 |   def say
     6 |     puts 'cheers'
     7 |   end
     8 | end
     9 | 
    10 |
  • 11 |
  • Bar 12 |
    puts "This should not get lumped into the above line Example"
    13 | 
    14 |

    A paragraph should go here.

    15 |
      16 |
    • A sublist goes here with another example 17 |
      echo "Hello"
      18 | 
      19 |

      And this is a paragraph

      20 |
    • 21 |
    22 |
  • 23 |
  • Hello
  • 24 |
25 | -------------------------------------------------------------------------------- /spec/html_code_syntax_highlight_examples/src-code-list-pygments.org: -------------------------------------------------------------------------------- 1 | * begin src in lists should work 2 | 3 | - Foo 4 | #+begin_src ruby 5 | class Hello 6 | def say 7 | puts 'cheers' 8 | end 9 | end 10 | #+end_src 11 | 12 | - Bar 13 | 14 | #+begin_src ruby 15 | puts "This should not get lumped into the above line Example" 16 | #+end_src 17 | 18 | A paragraph should go here. 19 | 20 | + A sublist goes here with another example 21 | #+begin_src sh 22 | echo "Hello" 23 | #+end_src 24 | 25 | And this is a paragraph 26 | - Hello 27 | -------------------------------------------------------------------------------- /spec/html_examples/advanced-lists.html: -------------------------------------------------------------------------------- 1 |

Advanced Lists

2 |

org-ruby supports the following list features of org-mode:

3 |

Nested lists

4 |
    5 |
  • You can have nested lists
  • 6 |
  • This is first-level 7 |
      8 |
    • This is a nested item
    • 9 |
    • This is another nested item
    • 10 |
    11 |
  • 12 |
  • Back to the first level
  • 13 |
  • Another first level item 14 |
      15 |
    1. This is a numbered list nested within the unordered list
    2. 16 |
    3. This is another numbered item
    4. 17 |
    18 |
  • 19 |
20 |

Note the list ends just some more text. Make sure both list blocks 21 | are closed.

22 |

Multi-paragraph list items

23 |

This list will end with the end-of-file. Make sure all blocks are closed.

24 |
    25 |
  • This is a list item
  • 26 |
  • This list item has multiple paragraphs. 27 |

    This is paragraph two.

    28 |

    And paragraph three.

    29 |
  • 30 |
  • Back to a list item. 31 |
      32 |
    • Nested, just for grins!
    • 33 |
    • woo hoo!
    • 34 |
    35 |
  • 36 |
37 |

Hyphen, Plus and Asterisk can be used to create lists

38 |
    39 |
  • One 40 |
      41 |
    • uno 42 |
        43 |
      • ichi
      • 44 |
      45 |
    • 46 |
    • uno
    • 47 |
    48 |
  • 49 |
  • Two 50 |
      51 |
    • dos 52 |
        53 |
      • ni
      • 54 |
      • ni
      • 55 |
      56 |
    • 57 |
    58 |
  • 59 |
  • Three
  • 60 |
  • Four
  • 61 |
62 | -------------------------------------------------------------------------------- /spec/html_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/html_examples/block_code.html: -------------------------------------------------------------------------------- 1 |

Block Code

2 |

I need to get block code examples working. In orgmode, they look 3 | like this:

4 |
 5 | 
 6 | def initialize(output)
 7 |   @output = output
 8 |   @buffer = ""
 9 |   @output_type = :start
10 |   @list_indent_stack = []
11 |   @paragraph_modifier = nil
12 | 
13 |   @logger = Logger.new(STDERR)
14 |   @logger.level = Logger::WARN
15 | end
16 | 
17 | 
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 |
    27 |
  • My list should cancel this.
  • 28 |
  • Another list line.
  • 29 |
30 | -------------------------------------------------------------------------------- /spec/html_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/html_examples/blockcomment.html: -------------------------------------------------------------------------------- 1 |

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 |

Example:

5 |

This is blockquote text.

6 |
7 |

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 |
4 |

center

5 |
6 |

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 |

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 |
    13 |
  • List starts 14 |
      15 |
    • Block without indentation 16 |
      17 | puts "test"
      18 |         
      19 |
    • 20 |
    21 |
  • 22 |
  • List continues here 23 |
      24 |
    • and finished here
    • 25 |
    26 |
  • 27 |
28 |

Code block indented

29 |
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 |
    39 |
  • List starts 40 |
      41 |
    • Block without indentation 42 |
      43 | puts "test"
      44 |         
      45 |
    • 46 |
    47 |
  • 48 |
  • List continues here 49 |
      50 |
    • and finished here
    • 51 |
    52 |
  • 53 |
54 |

Indentation level in example block

55 |
56 | - Indentation of a begin_example code block
57 |  #+begin_example
58 |    (+ 3 5)
59 |  #+end_example
60 | 
61 | 
62 |
    63 |
  • Indentation of a begin_example code block 64 |
    65 | (+ 3 5)
    66 |     
    67 |
  • 68 |
69 | -------------------------------------------------------------------------------- /spec/html_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/html_examples/code-comment.html: -------------------------------------------------------------------------------- 1 |

Code Comment

2 |

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 |

normal list should work

2 |
    3 |
  • one 4 | text in the same line 5 |

    This is a paragraph

    6 |
      7 |
    • A sublist 8 |
        9 |
      • Another sublist 10 |

        Sublist paragraph

        11 |
      • 12 |
      13 |
    • 14 |
    • 2nd sublist 15 |
        16 |
      • 2nd sublist item 17 |

        Paragraph from 2nd sublist

        18 |
      • 19 |
      20 |
    • 21 |
    22 |
  • 23 |
  • two 24 |
      25 |
    1. a new list 26 |

      paragraph

      27 |
    2. 28 |
    3. another sublist
    4. 29 |
    30 |
  • 31 |
  • final list
  • 32 |
33 |

paragraphs in lists should work

34 |
    35 |
  • Foo 36 |
      37 |
    • How does this work? 38 |

      uno dos tres

      39 |
    • 40 |
    • Should not this be a paragraph?
    • 41 |
    42 |
  • 43 |
  • Bar
  • 44 |
45 |

begin example in lists should work

46 |
    47 |
  • Foo 48 |
     49 | class Hello
     50 |   def say
     51 |     puts 'cheers'
     52 |   end
     53 | end
     54 |     
    55 |
  • 56 |
  • Bar 57 |
     58 | This gets lumped in to the above line "Example"
     59 |     
    60 |
  • 61 |
  • Hello
  • 62 |
63 |

begin quote in lists should work

64 |
    65 |
  • Example 66 |
      67 |
    • Uno 68 | Lorem 69 |
      70 |

      A quote!!!

      71 |
      72 |

      dolor

      73 |
    • 74 |
    • Dos
    • 75 |
    76 |
  • 77 |
78 |

tables in lists should work

79 |
    80 |
  • Example 81 |
      82 |
    • Table 83 |

      This table:

      84 | 85 | 86 | 87 | 88 |
      ab
      01
      12
      89 |
    • 90 |
    91 |
  • 92 |
  • After the table 93 |

    The table should be above

    94 |
  • 95 |
96 |

definition lists should work

97 |
    98 |
  • Example 99 |
    100 |
    Hello
    Hola 101 | Paragrap continues here 102 |
    103 |

    Cuando me desperte, el dinosaurio estaba alli.

    104 |
    105 |
    106 |
    Dog
    Perro 107 | Paragraph
    108 |
    109 |
      110 |
    • Last sublist
    • 111 |
    112 |
  • 113 |
  • Another list 114 |
      115 |
    • with a sublist
    • 116 |
    117 |
  • 118 |
119 | -------------------------------------------------------------------------------- /spec/html_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/html_examples/comment-trees.html: -------------------------------------------------------------------------------- 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/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 |

TODO Sample

6 |
    7 |
  • State “CANCELED” from “INPROGRESS” [2009-12-29 Tue 22:26]
    8 | I gave up.
  • 9 |
  • State “WAITING” from “” [2009-12-29 Tue 22:25]
    10 | huh?
  • 11 |
12 |

INPROGRESS this one’s in progress

13 |

WAITING who am I waiting on?

14 |

DONE Finished this one!

15 |

CANCELED I gave up here.

16 |

DONT be fooled by just a random word in all caps.

17 |

todo <== this word doesn’t match because the case doesn’t match.

18 |

TODOX

19 |

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 |

TODO Sample

6 |
    7 |
  • State “CANCELED” from “INPROGRESS” [2009-12-29 Tue 22:26]
    8 | I gave up.
  • 9 |
  • State “WAITING” from “” [2009-12-29 Tue 22:25]
    10 | huh?
  • 11 |
12 |

INPROGRESS this one’s in progress

13 |

WAITING who am I waiting on?

14 |

DONE Finished this one!

15 |

CANCELED I gave up here.

16 |

DONT be fooled by just a random word in all caps.

17 |

todo <== this word doesn’t match because the case doesn’t match.

18 |

TODOX

19 |

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 |

TODO Sample

6 |
    7 |
  • State “CANCELED” from “INPROGRESS” [2009-12-29 Tue 22:26]
    8 | I gave up.
  • 9 |
  • State “WAITING” from “” [2009-12-29 Tue 22:25]
    10 | huh?
  • 11 |
12 |

INPROGRESS this one’s in progress

13 |

WAITING who am I waiting on?

14 |

DONE Finished this one!

15 |

CANCELED I gave up here.

16 |

DONT be fooled by just a random word in all caps.

17 |

todo <== this word doesn’t match because the case doesn’t match.

18 |

TODOX

19 |

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 |
3 |
a
hello
4 |
b
world
5 |
6 |

Text

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 |

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 |

Definition List Items

18 |
    19 |
  • Regular list 20 |
    21 |
    Key
    Value (k1)
    22 |
    Key
    Value (k2)
    23 |
    Key
    Value (k3)
    24 |
    25 |
  • 26 |
  • Semicolon as part of key 27 |
    28 |
    K::e::y
    Value (k1)
    29 |
    K::e::y
    Value (k2)
    30 |
    31 |
  • 32 |
  • Paragraph break after key 33 |
    34 |
    Key
    35 | Value (k1)
    36 |
    Key
    37 | Value (k2)
    38 |
    39 |
  • 40 |
  • Many semicolons in same line 41 |
    42 |
    Key :: Value
    Still value (k1)
    43 |
    Key :: Value
    Still value (k2)
    44 |
    45 |
  • 46 |
  • Semicolon placement cases 47 |
      48 |
    • Case 1 49 |
      50 |
      Key ::MoreKey
      Value (k1)
      51 |
      52 |
    • 53 |
    • Case 2 54 |
      55 |
      Key:: MoreKey
      Value (k2)
      56 |
      57 |
    • 58 |
    • Case 3 59 |
      60 |
      :: Key
      Value (k3)
      61 |
      62 |
    • 63 |
    64 |
  • 65 |
66 |

Not Definition List Items

67 |

The following cases will not be considered as definition lists 68 | but just regular lists.

69 |
    70 |
  • Key:: Value (n1)
  • 71 |
  • Key ::Value (n2)
  • 72 |
  • Key::Value (n3)
  • 73 |
  • Key:: 74 | Value (n4)
  • 75 |
  • Key 76 | :: Value (n5)
  • 77 |
78 |

Definition List Item without Definition

79 |

??? will be shown in this case

80 |
    81 |
  • Example list 82 |
    83 |
    Key :: Value
    Still value (k1) 84 | Paragraph :: with :: no value
    85 |
    Key :: Value :: Still value (k1)
    86 | Paragraph :: with :: no value ::
    87 |
    ???
    88 | Paragraph :: with :: no value
    89 |
    90 |
  • 91 |
92 |

Definition List with markup inline

93 |
94 |
Description
bold
95 |
Description
italic
96 |
Description
code
97 |
Description
verbatim
98 |
Description
underline
99 |
Description
strikethrough
100 |
More than 2 cases
bold, italic, code, verbatim, underline, strikethrough.
101 |
102 | -------------------------------------------------------------------------------- /spec/html_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 | 74 | ** Definition List with markup inline 75 | 76 | - Description :: *bold* 77 | - Description :: /italic/ 78 | - Description :: =code= 79 | - Description :: ~verbatim~ 80 | - Description :: _underline_ 81 | - Description :: +strikethrough+ 82 | 83 | - More than 2 cases :: *bold*, /italic/, =code=, ~verbatim~, _underline_, +strikethrough+. 84 | -------------------------------------------------------------------------------- /spec/html_examples/escape-pre.html: -------------------------------------------------------------------------------- 1 |
2 | <li>[ ] &#8220;smart quotes&#8221;</li> 
3 | <li>[ ] I think I need this for &#8216;single quotes&#8217; too. Don&#8217;t I?</li> 
4 | <li>[ ] Em dashes would be great &#8212; wouldn&#8217;t they?</li> 
5 | <li>[ ] I hope to develop an en dash sometime in 2010 &#8211; 2011.</li> 
6 | 
7 | -------------------------------------------------------------------------------- /spec/html_examples/escape-pre.org: -------------------------------------------------------------------------------- 1 | #+BEGIN_EXAMPLE 2 |
  • [ ] “smart quotes”
  • 3 |
  • [ ] I think I need this for ‘single quotes’ too. Don’t I?
  • 4 |
  • [ ] Em dashes would be great — wouldn’t they?
  • 5 |
  • [ ] I hope to develop an en dash sometime in 2010 – 2011.
  • 6 | #+END_EXAMPLE 7 | -------------------------------------------------------------------------------- /spec/html_examples/export-exclude-only.html: -------------------------------------------------------------------------------- 1 |

    export-headline-levels.org

    2 |

    What happens when you exceed the number of headline levels to export?

    3 |

    1 Headline 1

    4 |

    1.1 Headline 2

    5 |

    This bit of body should get exported.

    6 |

    1.1.1 Headline 3

    7 |

    This bit of body gets exported.

    8 |

    1.1.1.1 Headline 4 (include)

    9 |

    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 |

    1.1.2 Another headline 3

    25 |

    This one should not get exported!!

    26 |

    1.1.2.1 Another headline 4

    27 |

    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 |

    1 TODO This is a todo item.

    4 |

    2 DONE this item is done!

    5 | -------------------------------------------------------------------------------- /spec/html_examples/export-keywords.org: -------------------------------------------------------------------------------- 1 | #+TITLE: export-keywords.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: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 | Testing that I can export keywords. 16 | 17 | * TODO This is a todo item. 18 | * DONE this item is done! 19 | -------------------------------------------------------------------------------- /spec/html_examples/export-tags.html: -------------------------------------------------------------------------------- 1 |

    export-headline-levels.org

    2 |

    What happens when you exceed the number of headline levels to export?

    3 |

    1 Headline 1

    4 |

    1.1 Headline 2

    5 |

    1.1.1 Headline 3

    6 |

    This bit of body gets exported.

    7 |

    1.1.1.1 Headline 4 (include)

    8 |

    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.

    4 | -------------------------------------------------------------------------------- /spec/html_examples/export-title.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Export Title 2 | 3 | This simple org document should get a title from the =TITLE= option at 4 | the front of the file. 5 | -------------------------------------------------------------------------------- /spec/html_examples/footnotes.html: -------------------------------------------------------------------------------- 1 |

    Footnotes

    2 |

    Footnotes

    3 |

    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 |
    9 |

    Footnotes:

    10 |
    11 |

    abcdefinition of abc

    12 |

    1blub

    13 |
    14 |
    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 |
    4 |

    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 |

    Basic tests

    3 |

    Within a commented block

    4 |

    Within a center block

    5 |
    6 |

    The following included file will be centered:

    7 |
    8 |

    Within a blockquote

    9 |

    This is similar to the center block:

    10 |
    11 |

    Before

    12 |

    After

    13 |
    14 |

    Within an example block, it should not be possible to include a file.

    15 |
    16 | #+INCLUDE: "./spec/html_examples/only-list.org"
    17 | 
    18 |

    Within a list

    19 |
      20 |
    • A list that has an included file directive 21 |
        22 |
      • Only go to the first level 23 |
          24 |
        • when included it always goes to the first level and absorbs next list items
        • 25 |
        26 |
      • 27 |
      28 |
    • 29 |
    30 |
      31 |
    • 3rd level
    • 32 |
    33 |
      34 |
    • 3rd level, though it should be a different list
    • 35 |
    36 |

    Within a table, cannot be included

    37 | 38 | 39 | 40 | 41 |
    OneTwoThree
    #+INCLUDE: “./spec/html_examples/only-list.org”FiveSix
    SevenEightNine
    42 |

    When including a file as an example

    43 |

    When including a file as an quote

    44 | -------------------------------------------------------------------------------- /spec/html_examples/include-file.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Example of including a file 2 | #+EXPORT_EXCLUDE_TAGS: noexport 3 | 4 | * DONE Basic tests 5 | 6 | #+INCLUDE: "./spec/html_examples/advanced-lists.org" 7 | 8 | #+INCLUDE: "./spec/html_examples/blockcomment.org" 9 | 10 | * DONE Within a commented block 11 | 12 | #+BEGIN_COMMENT 13 | This will be ignored but... 14 | #+INCLUDE: "./spec/html_examples/escape-pre.org" 15 | the included file above will be rendered. 16 | #+END_COMMENT 17 | 18 | * DONE Within a center block 19 | 20 | #+BEGIN_CENTER 21 | The following included file will be centered: 22 | 23 | #+INCLUDE: "./spec/html_examples/inline-images.org" 24 | 25 | #+END_CENTER 26 | 27 | * DONE Within a blockquote 28 | 29 | This is similar to the center block: 30 | 31 | #+begin_quote 32 | Before 33 | #+INCLUDE: "./spec/html_examples/inline-images.org" 34 | After 35 | #+end_quote 36 | 37 | * DONE Within an example block, it should not be possible to include a file. 38 | 39 | : #+INCLUDE: "./spec/html_examples/only-list.org" 40 | 41 | * TODO Within a source code block :noexport: 42 | 43 | It should not be possible to include a file within a source code block. 44 | (Some versions of Emacs Org mode also have this behavior though...) 45 | 46 | #+begin_src ruby :results output 47 | included_file = <Inline Formatting

    2 |

    I want to make sure I handle all inline formatting. I need to handle 3 | bold, italic, code, verbatim, underline, strikethrough.

    4 |

    In addition, I need to make sure I can handle links. We’ve got simple 5 | links, like this:

    6 | 11 |

    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 |
      18 |
    • http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg
    • 19 |
    20 |

    Also, if you make the descriptive text be an image, then it will get formatted 21 | with an image tag, like so:

    22 |
      23 |
    • http://imgs.xkcd.com/comics/t_cells.png
    • 24 |
    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: . 34 | 35 | It should be possible to use both kind of links on the same paragraph: 36 | 37 | This is an angle link and this is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]]. 38 | 39 | This is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]] and this is an angle link . 40 | 41 | This is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]] and this is a bracket link too [[https://github.com/bdewey/org-ruby][to a repository]]. 42 | 43 | This is an angle link and this is an angle link too . 44 | -------------------------------------------------------------------------------- /spec/html_examples/inline-images.html: -------------------------------------------------------------------------------- 1 |

    Inline Images

    2 |

    Per the org-mode spec, you can include inline images as links without 3 | any descriptive link text, like this:

    4 |

    http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg

    5 |

    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 |
      8 |
    • .jpg
    • 9 |
    • .png
    • 10 |
    • .gif
    • 11 |
    • .jpeg
    • 12 |
    13 | -------------------------------------------------------------------------------- /spec/html_examples/inline-images.org: -------------------------------------------------------------------------------- 1 | Inline Images 2 | 3 | Per the org-mode [[http://orgmode.org/manual/Images-and-tables.html#Images-and-tables][spec]], you can include inline images as links without 4 | any descriptive link text, like this: 5 | 6 | [[http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg]] 7 | 8 | I currently do not support the caption/link syntax, but I can include 9 | the inline image. I recognize the following image file types: 10 | 11 | - .jpg 12 | - .png 13 | - .gif 14 | - .jpeg 15 | 16 | -------------------------------------------------------------------------------- /spec/html_examples/link-features.html: -------------------------------------------------------------------------------- 1 |

    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 |

    Links to other org files

    6 |

    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.

    9 |

    Code Comment

    10 |

    Search links

    11 |

    This is a search link into code-comment.org.

    12 |

    Code Comment

    13 |

    Correct handling of .org URIs in HTML markup routine (thanks @rayl!)

    14 | 20 |

    In these links, .org is converted to .html

    21 | 25 |

    Links abbreviations

    26 |

    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 |

    Lists

    2 |

    I want to make sure I have great support for lists.

    3 |
      4 |
    • This is an unordered list
    • 5 |
    • This continues the unordered list
    • 6 |
    7 |

    And this is a paragraph after the list.

    8 |

    Wrapping within the list

    9 |
      10 |
    • This is a single-line list item in the org file.
    • 11 |
    • Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 12 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 13 | erat, sed diam voluptua. At vero eos et accusam et justo duo 14 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 15 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 16 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 17 | invidunt ut labore et dolore magna aliquyam erat, sed diam 18 | voluptua. At vero eos et accusam et justo duo dolores et ea 19 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 20 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 21 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 22 | invidunt ut labore et dolore magna aliquyam erat, sed diam 23 | voluptua. At vero eos et accusam et justo duo dolores et ea 24 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 25 | Lorem ipsum dolor sit amet.
    • 26 |
    • And this is the next item. The previous item needs to be on one 27 | line to keep textile happy.
    • 28 |
    • Ditto the previous line, actually.
    • 29 |
    30 |

    Edge cases

    31 |
      32 |
    • This is a single-line list.
    • 33 |
    34 |

    And this is a separate paragraph. Note the indentation in the org 35 | file.

    36 |

    Invalid lists

    37 |

    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 |

    Metadata, etc.

    2 |

    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 |
      2 |
    • This file has only a list
    • 3 |
    • Note it will end with nothing other than a list item.
    • 4 |
    • the world wants to know: Will org-ruby write the closing ul tag?
    • 5 |
    6 | -------------------------------------------------------------------------------- /spec/html_examples/only-list.org: -------------------------------------------------------------------------------- 1 | - This file has only a list 2 | - Note it will end with nothing other than a list item. 3 | - the world wants to know: Will org-ruby write the closing ul tag? 4 | -------------------------------------------------------------------------------- /spec/html_examples/only-table.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
    OneTwoThreeFour
    FiveSixSevenEight
    NineTenElevenTwelve
    formattextincells
    7 | -------------------------------------------------------------------------------- /spec/html_examples/only-table.org: -------------------------------------------------------------------------------- 1 | | One | Two | Three | Four | 2 | |----------+--------+--------+---------| 3 | | Five | Six | Seven | Eight | 4 | | Nine | Ten | Eleven | Twelve | 5 | | *format* | /text/ | ~in~ | _cells_ | 6 | -------------------------------------------------------------------------------- /spec/html_examples/prepended-comma.html: -------------------------------------------------------------------------------- 1 |

    Removing the prepended comma from Org mode example blocks

    2 |

    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 |

    Here the prepended comma will be removed.

    7 |
    * Hello
     8 | ** Goodbye
     9 |  *** Not a headline, but prepended comma still removed.
    10 | * I am a headline
    11 | 
    12 |

    Here the prepended comma is should not be removed.

    13 |
    14 | {
    15 |   "one":   1
    16 | , "two":   2
    17 | , "three": 3
    18 | , "four":  4
    19 | }
    20 | 
    21 |

    Here the prepended comma is also removed

    22 |

    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 |

    Here the prepended comma will be remove for the Hello world headline

    31 |
    32 | ,  ,* Hi
    33 | ,  
    34 | ,  ,* This will be appended a comma
    35 | * Hello world  
    36 | ,  
    37 | 
    38 |

    Here the prepended comma will be removed

    39 |
    #+TITLE: "Hello world"
    40 | 
    41 |

    This will be rendered as normal

    42 |
    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 | when at the beginning of the line there is either ",*" or ",#+" 5 | this prepended comma should be removed before parsing. 6 | 7 | (Fixes ) 8 | 9 | ** DONE Here the prepended comma will be removed. 10 | 11 | #+begin_example org 12 | ,* Hello 13 | ,** Goodbye 14 | , *** Not a headline, but prepended comma still removed. 15 | ,* I am a headline 16 | #+end_example 17 | 18 | ** DONE Here the prepended comma is should not be removed. 19 | 20 | #+begin_example js 21 | { 22 | "one": 1 23 | , "two": 2 24 | , "three": 3 25 | , "four": 4 26 | } 27 | #+end_example 28 | 29 | ** DONE Here the prepended comma is also removed 30 | Emacs Org mode implementation also removes it. 31 | 32 | #+begin_example ruby 33 | text = <The mount point of the fullest disk 2 |

    query all mounted disks

    3 |
     4 | df \
     5 | 
    6 |

    strip the header row

    7 |
     8 | |sed '1d' \
     9 | 
    10 |

    sort by the percent full

    11 |
    12 | |awk '{print $5 " " $6}'|sort -n |tail -1 \
    13 | 
    14 |

    extract the mount point

    15 |
    16 | |awk '{print $2}'
    17 | 
    18 |

    Properties drawer example

    19 |

    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 |

    Raw html can be embedded

    2 |

    The following will render the tag as is:

    3 | Hello 4 |

    And this will render some Javascript:

    5 | 6 |

    HTML blocks

    7 |

    They behave as follows:

    8 |

    9 |

    10 | 
    11 | Hello.
    12 | 
    13 | 
    14 |

    15 |

    Cases on which html should be escaped

    16 |

    This should be escaped: <html><script type="text/javascript">(function(){})</script></html>

    17 |

    This should be escaped: <html><script type“text/javascript”>(function(){})</script></html>=

    18 |

    This should be escaped: @<script type="text/javascript">(function(){})@</script>

    19 |

    This should be escaped: @<script type“text/javascript”>(function(){})=

    20 | -------------------------------------------------------------------------------- /spec/html_examples/raw-html.org: -------------------------------------------------------------------------------- 1 | * Raw html can be embedded 2 | 3 | The following will render the tag as is: 4 | 5 | #+html: 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 |

    1 First heading

    3 |

    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 |

    Simple table, no header.

    4 | 5 | 6 | 7 |
    Cell oneCell two
    Cell threeCell four
    8 |

    Indented table

    9 | 10 | 11 | 12 |
    Cell one
    Cell two
    13 |

    And here’s some paragraph content. The line breaks will need to get 14 | removed here, but not for the tables.

    15 |

    Table with header

    16 | 17 | 18 | 19 | 20 |
    OneTwoThree
    FourFiveSix
    SevenEightNine
    21 |

    The separator row should not get printed out.

    22 |

    Table with complete box

    23 | 24 | 25 | 26 | 27 |
    OneTwoThree
    FourFiveSix
    SevenEightNine
    28 |

    Only the first row should be a header row.

    29 |

    Table with extra lines

    30 | 31 | 32 | 33 | 34 | 35 |
    OneTwoThree
    FourFiveSix
    SevenEightNine
    TenElevenTwelve
    36 |

    Only the first row should be a header row.

    37 |

    Fix error when table starts with hline (Thanks @til!)

    38 | 39 | 40 | 41 |
    foobar
    12
    42 |

    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 |
  • [ ] “smart quotes”
  • 3 |
  • [ ] I think I need this for ‘single quotes’ too. Don’t I?
  • 4 |
  • [ ] Em dashes would be great — wouldn’t they?
  • 5 |
  • [ ] I hope to develop an en dash sometime in 2010 – 2011.
  • 6 | ``` 7 | -------------------------------------------------------------------------------- /spec/markdown_examples/escape-pre.org: -------------------------------------------------------------------------------- 1 | #+BEGIN_EXAMPLE 2 |
  • [ ] “smart quotes”
  • 3 |
  • [ ] I think I need this for ‘single quotes’ too. Don’t I?
  • 4 |
  • [ ] Em dashes would be great — wouldn’t they?
  • 5 |
  • [ ] I hope to develop an en dash sometime in 2010 – 2011.
  • 6 | #+END_EXAMPLE 7 | -------------------------------------------------------------------------------- /spec/markdown_examples/export-exclude-only.md: -------------------------------------------------------------------------------- 1 | 2 | What happens when you exceed the number of headline levels to export? 3 | 4 | # Headline 1 5 | 6 | ## Headline 2 7 | 8 | This bit of body **should** get exported. 9 | 10 | ### Headline 3 11 | 12 | This bit of body gets exported. 13 | 14 | #### Headline 4 (include) 15 | 16 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 17 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 18 | erat, sed diam voluptua. At vero eos et accusam et justo duo 19 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 20 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 21 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 22 | invidunt ut labore et dolore magna aliquyam erat, sed diam 23 | voluptua. At vero eos et accusam et justo duo dolores et ea 24 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 25 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 26 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 27 | invidunt ut labore et dolore magna aliquyam erat, sed diam 28 | voluptua. At vero eos et accusam et justo duo dolores et ea 29 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 30 | Lorem ipsum dolor sit amet. 31 | 32 | ### Another headline 3 33 | 34 | This one **should not** get exported!! 35 | 36 | #### Another headline 4 37 | 38 | This also **cannot** get exported!! 39 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/export-keywords.md: -------------------------------------------------------------------------------- 1 | Testing that I can export keywords. 2 | 3 | # This is a todo item. 4 | # this item is done! 5 | -------------------------------------------------------------------------------- /spec/markdown_examples/export-keywords.org: -------------------------------------------------------------------------------- 1 | #+TITLE: export-keywords.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: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 | Testing that I can export keywords. 16 | 17 | * TODO This is a todo item. 18 | * DONE this item is done! 19 | -------------------------------------------------------------------------------- /spec/markdown_examples/export-tags.md: -------------------------------------------------------------------------------- 1 | 2 | What happens when you exceed the number of headline levels to export? 3 | 4 | # Headline 1 5 | ## Headline 2 6 | ### Headline 3 7 | 8 | This bit of body gets exported. 9 | 10 | #### Headline 4 (include) 11 | 12 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 13 | nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 14 | erat, sed diam voluptua. At vero eos et accusam et justo duo 15 | dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 16 | sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit 17 | amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 18 | invidunt ut labore et dolore magna aliquyam erat, sed diam 19 | voluptua. At vero eos et accusam et justo duo dolores et ea 20 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 21 | Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 22 | consetetur sadipscing elitr, sed diam nonumy eirmod tempor 23 | invidunt ut labore et dolore magna aliquyam erat, sed diam 24 | voluptua. At vero eos et accusam et justo duo dolores et ea 25 | rebum. Stet clita kasd gubergren, no sea takimata sanctus est 26 | Lorem ipsum dolor sit amet. 27 | 28 | -------------------------------------------------------------------------------- /spec/markdown_examples/export-title.md: -------------------------------------------------------------------------------- 1 | 2 | This simple org document should get a title from the `TITLE` option at 3 | the front of the file. 4 | -------------------------------------------------------------------------------- /spec/markdown_examples/export-title.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Export Title 2 | 3 | This simple org document should get a title from the =TITLE= option at 4 | the front of the file. 5 | -------------------------------------------------------------------------------- /spec/markdown_examples/footnotes.md: -------------------------------------------------------------------------------- 1 | 2 | # Footnotes 3 | 4 | Using numbers [fn:0] 5 | 6 | Using letters and not defined in the footnote [fn:abc] 7 | 8 | Using letters and defined in the footnote [fn:abc:definition of abc] 9 | 10 | Defined in the footnote itself with markup [fn:1:*blub*] 11 | 12 | [fn:0] Definition of first footnote 13 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/horizontal_rule.md: -------------------------------------------------------------------------------- 1 | Useful contribution by [Neil-Smithline](http://www.neilsmithline.com) 2 | 3 | 5 hyphens or more, 4 | -------- 5 | will produce a horizontal rule. 6 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/html-literal.md: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/include-file.md: -------------------------------------------------------------------------------- 1 | 2 | # Basic tests 3 | 4 | 5 | 6 | # Within a commented block 7 | 8 | 9 | # Within a center block 10 | 11 | The following included file will be centered: 12 | 13 | 14 | 15 | # Within a blockquote 16 | 17 | This is similar to the center block: 18 | 19 | > Before 20 | > After 21 | 22 | # Within an example block, it should not be possible to include a file. 23 | 24 | #+INCLUDE: "./spec/html_examples/only-list.org" 25 | 26 | # Within a list 27 | 28 | * A list that has an included file directive 29 | * Only go to the first level 30 | * when included it always goes to the first level and absorbs next list items 31 | * 3rd level 32 | * 3rd level, though it should be a different list 33 | 34 | # Within a table, cannot be included 35 | 36 | | One | Two | Three | 37 | | #+INCLUDE: "./spec/html_examples/only-list.org" | Five | Six | 38 | | Seven | Eight | Nine | 39 | 40 | 41 | # When including a file as an example 42 | 43 | 44 | # When including a file as an quote 45 | 46 | -------------------------------------------------------------------------------- /spec/markdown_examples/include-file.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Example of including a file 2 | #+EXPORT_EXCLUDE_TAGS: noexport 3 | 4 | * DONE Basic tests 5 | 6 | #+INCLUDE: "./spec/html_examples/advanced-lists.org" 7 | 8 | #+INCLUDE: "./spec/html_examples/blockcomment.org" 9 | 10 | * DONE Within a commented block 11 | 12 | #+BEGIN_COMMENT 13 | This will be ignored but... 14 | #+INCLUDE: "./spec/html_examples/escape-pre.org" 15 | the included file above will be rendered. 16 | #+END_COMMENT 17 | 18 | * DONE Within a center block 19 | 20 | #+BEGIN_CENTER 21 | The following included file will be centered: 22 | 23 | #+INCLUDE: "./spec/html_examples/inline-images.org" 24 | 25 | #+END_CENTER 26 | 27 | * DONE Within a blockquote 28 | 29 | This is similar to the center block: 30 | 31 | #+begin_quote 32 | Before 33 | #+INCLUDE: "./spec/html_examples/inline-images.org" 34 | After 35 | #+end_quote 36 | 37 | * DONE Within an example block, it should not be possible to include a file. 38 | 39 | : #+INCLUDE: "./spec/html_examples/only-list.org" 40 | 41 | * TODO Within a source code block :noexport: 42 | 43 | It should not be possible to include a file within a source code block. 44 | (Some versions of Emacs Org mode also have this behavior though...) 45 | 46 | #+begin_src ruby :results output 47 | included_file = <. 34 | 35 | It should be possible to use both kind of links on the same paragraph: 36 | 37 | This is an angle link and this is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]]. 38 | 39 | This is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]] and this is an angle link . 40 | 41 | This is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]] and this is a bracket link too [[https://github.com/bdewey/org-ruby][to a repository]]. 42 | 43 | This is an angle link and this is an angle link too . 44 | -------------------------------------------------------------------------------- /spec/markdown_examples/inline-images.md: -------------------------------------------------------------------------------- 1 | Inline Images 2 | 3 | Per the org-mode [spec](http://orgmode.org/manual/Images-and-tables.html#Images-and-tables), you can include inline images as links without 4 | any descriptive link text, like this: 5 | 6 | [http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg](http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg) 7 | 8 | I currently do not support the caption/link syntax, but I can include 9 | the inline image. I recognize the following image file types: 10 | 11 | * .jpg 12 | * .png 13 | * .gif 14 | * .jpeg 15 | -------------------------------------------------------------------------------- /spec/markdown_examples/inline-images.org: -------------------------------------------------------------------------------- 1 | Inline Images 2 | 3 | Per the org-mode [[http://orgmode.org/manual/Images-and-tables.html#Images-and-tables][spec]], you can include inline images as links without 4 | any descriptive link text, like this: 5 | 6 | [[http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg]] 7 | 8 | I currently do not support the caption/link syntax, but I can include 9 | the inline image. I recognize the following image file types: 10 | 11 | - .jpg 12 | - .png 13 | - .gif 14 | - .jpeg 15 | 16 | -------------------------------------------------------------------------------- /spec/markdown_examples/link-features.md: -------------------------------------------------------------------------------- 1 | 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 | 6 | # Links to other org files 7 | 8 | This is a link to the `code-comment.org` file in the same 9 | directory. In `emacs`, if you click it, the other file opens. We 10 | want the same behavior in the HTML export. 11 | 12 | [Code Comment](file:code-comment.org) 13 | 14 | # Search links 15 | 16 | This is a search link into code-comment.org. 17 | 18 | [Code Comment](file:code-comment.org::*Code%20Comment) 19 | 20 | # Correct handling of .org URIs in HTML markup routine (thanks @rayl!) 21 | 22 | * [foo.com website](http://foo.com) 23 | 24 | * [foo.org website](http://foo.org) 25 | 26 | * [foo.org/foo.org](http://foo.org/foo.org) 27 | 28 | * [localhost:4567/foo.org](http://localhost:4567/foo.org) 29 | 30 | # In these links, .org is converted to .html 31 | 32 | * [file:path.org label](file:path.org) 33 | 34 | * [file:notes/path.org label](file:notes/path.org) 35 | 36 | # Links abbreviations 37 | 38 | URLs can be abbreviated by a LINK definition in the org file 39 | 40 | 41 | [This is an abbreviated link example](example) 42 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/lists.md: -------------------------------------------------------------------------------- 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/markdown_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/markdown_examples/metadata-comment.md: -------------------------------------------------------------------------------- 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 | ``` 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 | ``` 31 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/only-list.md: -------------------------------------------------------------------------------- 1 | * This file has only a list 2 | * Note it will end with nothing other than a list item. 3 | * the world wants to know: Will org-ruby write the closing ul tag? 4 | -------------------------------------------------------------------------------- /spec/markdown_examples/only-list.org: -------------------------------------------------------------------------------- 1 | - This file has only a list 2 | - Note it will end with nothing other than a list item. 3 | - the world wants to know: Will org-ruby write the closing ul tag? 4 | -------------------------------------------------------------------------------- /spec/markdown_examples/only-table.md: -------------------------------------------------------------------------------- 1 | | One | Two | Three | Four | 2 | | Five | Six | Seven | Eight | 3 | | Nine | Ten | Eleven | Twelve | 4 | | **format** | *text* | `in` | *cells* | 5 | -------------------------------------------------------------------------------- /spec/markdown_examples/only-table.org: -------------------------------------------------------------------------------- 1 | | One | Two | Three | Four | 2 | |----------+--------+--------+---------| 3 | | Five | Six | Seven | Eight | 4 | | Nine | Ten | Eleven | Twelve | 5 | | *format* | /text/ | ~in~ | _cells_ | 6 | -------------------------------------------------------------------------------- /spec/markdown_examples/prepended-comma.md: -------------------------------------------------------------------------------- 1 | # Removing the prepended comma from Org mode example blocks 2 | 3 | As mentioned in [http://orgmode.org/manual/Literal-examples.html](http://orgmode.org/manual/Literal-examples.html), 4 | when at the beginning of the line there is either ",*" or ",#+" 5 | this prepended comma should be removed before parsing. 6 | 7 | (Fixes [https://github.com/bdewey/org-ruby/issues/50](https://github.com/bdewey/org-ruby/issues/50)) 8 | 9 | ## Here the prepended comma will be removed. 10 | 11 | ```org 12 | ,* Hello 13 | ,** Goodbye 14 | , *** Not a headline, but prepended comma still removed. 15 | ,* I am a headline 16 | ``` 17 | 18 | ## Here the prepended comma is should not be removed. 19 | 20 | ```js 21 | { 22 | "one": 1 23 | , "two": 2 24 | , "three": 3 25 | , "four": 4 26 | } 27 | ``` 28 | 29 | ## Here the prepended comma is also removed 30 | Emacs Org mode implementation also removes it. 31 | 32 | ```ruby 33 | text = <, 4 | when at the beginning of the line there is either ",*" or ",#+" 5 | this prepended comma should be removed before parsing. 6 | 7 | (Fixes ) 8 | 9 | ** DONE Here the prepended comma will be removed. 10 | 11 | #+begin_example org 12 | ,* Hello 13 | ,** Goodbye 14 | , *** Not a headline, but prepended comma still removed. 15 | ,* I am a headline 16 | #+end_example 17 | 18 | ** DONE Here the prepended comma is should not be removed. 19 | 20 | #+begin_example js 21 | { 22 | "one": 1 23 | , "two": 2 24 | , "three": 3 25 | , "four": 4 26 | } 27 | #+end_example 28 | 29 | ** DONE Here the prepended comma is also removed 30 | Emacs Org mode implementation also removes it. 31 | 32 | #+begin_example ruby 33 | text = <` 17 | 18 | This should be escaped: `= 19 | 20 | This should be escaped: `@` 21 | 22 | This should be escaped: `@= 23 | -------------------------------------------------------------------------------- /spec/markdown_examples/raw-html.org: -------------------------------------------------------------------------------- 1 | * Raw html can be embedded 2 | 3 | The following will render the tag as is: 4 | 5 | #+html: 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/markdown_examples/skip-header.md: -------------------------------------------------------------------------------- 1 | This is header text. 2 | It exists in the org-file, but shouldn't show up in the HTML output. 3 | 4 | * Same with this list 5 | * Nope, shouldn't be in the output. 6 | 7 | ``` 8 | Even this code snippet shouldn't be there. 9 | Like a ninja. You can't see me. 10 | ``` 11 | 12 | # First heading 13 | 14 | This should be the first text in the output. 15 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/skip-table.md: -------------------------------------------------------------------------------- 1 | 2 | Checking that tables are skipped when directed. 3 | 4 | | One | Two | Three | 5 | | Four | Five | Six | 6 | | Seven | Eight | Nine | 7 | 8 | 9 | For grins, here's another table without a header. Just keep the bases 10 | covered. 11 | 12 | | One | Two | Three | 13 | | Four | Five | Six | 14 | | Seven | Eight | Nine | 15 | 16 | Again, in the HTML output, you should see **no tables**. 17 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/subsupscript-nil.md: -------------------------------------------------------------------------------- 1 | SUBSUPSCRIPT 2 | 3 | ab 4 | 5 | ab 6 | -------------------------------------------------------------------------------- /spec/markdown_examples/subsupscript-nil.org: -------------------------------------------------------------------------------- 1 | #+OPTIONS: ^:nil 2 | SUBSUPSCRIPT 3 | 4 | a^{b} 5 | 6 | a_{b} 7 | -------------------------------------------------------------------------------- /spec/markdown_examples/subsupscript.md: -------------------------------------------------------------------------------- 1 | SUBSUPSCRIPT 2 | 3 | ab 4 | 5 | ab 6 | -------------------------------------------------------------------------------- /spec/markdown_examples/subsupscript.org: -------------------------------------------------------------------------------- 1 | SUBSUPSCRIPT 2 | 3 | a^{b} 4 | 5 | a_{b} 6 | -------------------------------------------------------------------------------- /spec/markdown_examples/tables.md: -------------------------------------------------------------------------------- 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 | | Four | Five | Six | 23 | | Seven | Eight | Nine | 24 | 25 | The separator row should not get printed out. 26 | 27 | # Table with complete box 28 | 29 | | One | Two | Three | 30 | | Four | Five | Six | 31 | | Seven | Eight | Nine | 32 | 33 | Only the first row should be a header row. 34 | 35 | # Table with extra lines 36 | 37 | | One | Two | Three | 38 | | Four | Five | Six | 39 | | Seven | Eight | Nine | 40 | | Ten | Eleven | Twelve | 41 | 42 | Only the first row should be a header row. 43 | 44 | # Fix error when table starts with hline (Thanks @til!) 45 | | foo | bar | 46 | | 1 | 2 | 47 | https://github.com/bdewey/org-ruby/pull/34 48 | -------------------------------------------------------------------------------- /spec/markdown_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/markdown_examples/text.md: -------------------------------------------------------------------------------- 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/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/output_buffer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Orgmode::OutputBuffer do 4 | 5 | it "computes outline level numbering" do 6 | output_buffer = Orgmode::OutputBuffer.new "" 7 | output_buffer.get_next_headline_number(1).should eql("1") 8 | output_buffer.get_next_headline_number(1).should eql("2") 9 | output_buffer.get_next_headline_number(1).should eql("3") 10 | output_buffer.get_next_headline_number(1).should eql("4") 11 | output_buffer.get_next_headline_number(2).should eql("4.1") 12 | output_buffer.get_next_headline_number(2).should eql("4.2") 13 | output_buffer.get_next_headline_number(1).should eql("5") 14 | output_buffer.get_next_headline_number(2).should eql("5.1") 15 | output_buffer.get_next_headline_number(2).should eql("5.2") 16 | output_buffer.get_next_headline_number(4).should eql("5.2.0.1") 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /spec/regexp_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Orgmode::RegexpHelper do 4 | it "should recognize simple markup" do 5 | e = Orgmode::RegexpHelper.new 6 | total = 0 7 | e.match_all("/italic/") do |border, string| 8 | border.should eql("/") 9 | string.should eql("italic") 10 | total += 1 11 | end 12 | total.should eql(1) 13 | 14 | total = 0 15 | borders = %w[* / ~] 16 | strings = %w[bold italic verbatim] 17 | e.match_all("This string contains *bold*, /italic/, and ~verbatim~ text.")\ 18 | do |border, str| 19 | border.should eql(borders[total]) 20 | str.should eql(strings[total]) 21 | total += 1 22 | end 23 | total.should eql(3) 24 | end 25 | 26 | it "should not get confused by links" do 27 | e = Orgmode::RegexpHelper.new 28 | total = 0 29 | # Make sure the slashes in these links aren't treated as italics 30 | e.match_all("[[http://www.bing.com/twitter]]") do |border, str| 31 | total += 1 32 | end 33 | total.should eql(0) 34 | end 35 | 36 | it "should correctly perform substitutions" do 37 | e = Orgmode::RegexpHelper.new 38 | map = { 39 | "*" => "strong", 40 | "/" => "i", 41 | "~" => "code" 42 | } 43 | n = e.rewrite_emphasis("This string contains *bold*, /italic/, and ~verbatim~ text.") do |border, str| 44 | "<#{map[border]}>#{str}" 45 | end 46 | n = e.restore_code_snippets n 47 | 48 | n.should eql("This string contains bold, italic, and verbatim text.") 49 | end 50 | 51 | it "should allow link rewriting" do 52 | e = Orgmode::RegexpHelper.new 53 | str = e.rewrite_links("[[http://www.bing.com]]") do |link,text| 54 | text ||= link 55 | "\"#{text}\":#{link}" 56 | end 57 | str.should eql("\"http://www.bing.com\":http://www.bing.com") 58 | str = e.rewrite_links("") do |link| 59 | "\"#{link}\":#{link}" 60 | end 61 | str.should eql("\"http://www.google.com\":http://www.google.com") 62 | end 63 | end # describe Orgmode::RegexpHelper 64 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'org-ruby' 2 | 3 | RememberFile = File.join(File.dirname(__FILE__), %w[data remember.org]) 4 | FreeformFile = File.join(File.dirname(__FILE__), %w[data freeform.org]) 5 | FreeformExampleFile = File.join(File.dirname(__FILE__), %w[data freeform-example.org]) 6 | 7 | RSpec.configure do |config| 8 | # == Mock Framework 9 | # 10 | # RSpec uses it's own mocking framework by default. If you prefer to 11 | # use mocha, flexmock or RR, uncomment the appropriate line: 12 | # 13 | # config.mock_with :mocha 14 | # config.mock_with :flexmock 15 | # config.mock_with :rr 16 | end 17 | -------------------------------------------------------------------------------- /spec/textile_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/textile_examples/block_code.textile: -------------------------------------------------------------------------------- 1 | h1. Block Code 2 | 3 | p. I need to get block code examples working. In @orgmode@, they look 4 | like this: 5 | 6 | bc. 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 | p. Putting in another paragraph for good measure. 21 | 22 | 23 | p. Code should also get cancelled by a list, thus: 24 | 25 | bc. This is my code! 26 | 27 | Another line! 28 | 29 | * My list should cancel this. 30 | * Another list line. 31 | -------------------------------------------------------------------------------- /spec/textile_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/textile_examples/blockquote.textile: -------------------------------------------------------------------------------- 1 | p. BLOCKQUOTE 2 | 3 | p. Testing that I can have block quotes: 4 | 5 | 6 | 7 | bq. _Example:_ 8 | 9 | bq. This is blockquote text. 10 | 11 | 12 | 13 | p. And now I'm back to normal text! 14 | -------------------------------------------------------------------------------- /spec/textile_examples/center.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Fou 2 | 3 | not center 4 | #+BEGIN_CENTER 5 | center 6 | #+END_CENTER 7 | not center, again 8 | -------------------------------------------------------------------------------- /spec/textile_examples/center.textile: -------------------------------------------------------------------------------- 1 | 2 | p. not center 3 | 4 | p=. center 5 | 6 | p. not center, again 7 | -------------------------------------------------------------------------------- /spec/textile_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/textile_examples/footnotes.textile: -------------------------------------------------------------------------------- 1 | 2 | h1. Footnotes 3 | 4 | p. Using numbers [0] 5 | 6 | p. Using letters and not defined in the footnote [1] 7 | 8 | p. Using letters and defined in the footnote [1] 9 | 10 | p. Defined in the footnote itself with markup [2] 11 | 12 | p. [0] Definition of first footnote 13 | 14 | fn0. DEFINITION NOT FOUND 15 | 16 | fn1. definition of abc 17 | 18 | fn2. *blub* 19 | -------------------------------------------------------------------------------- /spec/textile_examples/keywords.org: -------------------------------------------------------------------------------- 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. 14 | -------------------------------------------------------------------------------- /spec/textile_examples/keywords.textile: -------------------------------------------------------------------------------- 1 | p. KEYWORDS 2 | 3 | p. By default, I don't want keywords exported to textile. 4 | 5 | h1. Recognize standard keywords 6 | 7 | p. The standard @orgmode@ keywords are TODO and DONE. Recognize those. 8 | 9 | h1. Recongize buffer-specific keywords 10 | 11 | p. There's a way to define a custom keyword list in a buffer. Research 12 | that and handle it. 13 | -------------------------------------------------------------------------------- /spec/textile_examples/links.org: -------------------------------------------------------------------------------- 1 | LINKS 2 | 3 | [[http://www.bing.com]] 4 | 5 | * Supported Link Styles 6 | 7 | - [[http://www.hotmail.com]] => Simple 8 | - [[http://www.hotmail.com][Hotmail]] => With link text 9 | - [[http://url/with spaces][with spaces]] 10 | - [[http://url/with spaces]] 11 | 12 | -------------------------------------------------------------------------------- /spec/textile_examples/links.textile: -------------------------------------------------------------------------------- 1 | p. LINKS 2 | 3 | p. "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 11 | -------------------------------------------------------------------------------- /spec/textile_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 | -------------------------------------------------------------------------------- /spec/textile_examples/lists.textile: -------------------------------------------------------------------------------- 1 | h1. Lists 2 | 3 | p. 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 | p. 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 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 | h2. Edge cases 33 | 34 | * This is a single-line list. 35 | p. And this is a *separate paragraph.* Note the indentation in the org 36 | file. 37 | -------------------------------------------------------------------------------- /spec/textile_examples/single-space-plain-list.org: -------------------------------------------------------------------------------- 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/). 14 | -------------------------------------------------------------------------------- /spec/textile_examples/single-space-plain-list.textile: -------------------------------------------------------------------------------- 1 | h2. Anatomy of a BVP 2 | 3 | p. 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 | p. The following sections walk through each section and give an 12 | example from one of our BVPs, "Resource-Smart Virtualization 13 | Infrastructure":http://windows/hyper-v/initiatives/Value%20Propositions/DynamicDatacenter-ValueProp.docx (also called _Dynamic Datacenter_). 14 | -------------------------------------------------------------------------------- /spec/textile_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 | -------------------------------------------------------------------------------- /spec/textile_examples/tables.textile: -------------------------------------------------------------------------------- 1 | p. TABLES 2 | 3 | p. 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 | 11 | h1. Indented table 12 | 13 | | Cell one | 14 | | Cell two | 15 | 16 | p. And here's some paragraph content. The line breaks will need to get 17 | removed here, but not for the tables. 18 | 19 | h1. Table with header 20 | 21 | | One | Two | Three | 22 | | Four | Five | Six | 23 | | Seven | Eight | Nine | 24 | 25 | p. The separator row should not get printed out. 26 | 27 | h1. Table with complete box 28 | 29 | | One | Two | Three | 30 | | Four | Five | Six | 31 | | Seven | Eight | Nine | 32 | 33 | p. Only the first row should be a header row. 34 | 35 | h1. Table with extra lines 36 | 37 | | One | Two | Three | 38 | | Four | Five | Six | 39 | | Seven | Eight | Nine | 40 | | Ten | Eleven | Twelve | 41 | 42 | p. Only the first row should be a header row. 43 | -------------------------------------------------------------------------------- /spec/textile_output_buffer_spec.rb: -------------------------------------------------------------------------------- 1 | require '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 22 | -------------------------------------------------------------------------------- /util/gen-special-replace.el: -------------------------------------------------------------------------------- 1 | ;; This code creates ruby code to replace special symbols with the corresponding utf8/html code 2 | 3 | (require 'org-entities) 4 | 5 | (defvar gen-use-entities-user t) 6 | (defvar gen-file-name "replace-entities.rb") 7 | 8 | (defun generate-replace-inbuffer (what) 9 | (insert " " (capitalize what) "Entities = {\n") 10 | (let ((ll (if gen-use-entities-user 11 | (append org-entities-user org-entities) 12 | org-entities)) 13 | (to (if (string= what "html") 3 14 | 6)) ; use utf8 for textile 15 | (beg (point))) 16 | (insert (mapconcat 17 | (lambda (entity) 18 | (let ((symb (nth to entity))) 19 | ;; escape backslashes and quotation marks 20 | (setq symb (replace-regexp-in-string "\\(\\\\\\|\\\"\\)" "\\\\\\&" symb)) 21 | ;; escape percent marks from further formatting 22 | (setq symb (replace-regexp-in-string "%" "%%" symb)) 23 | (concat " \"" (car entity) "\" => \"" symb "\""))) 24 | (remove-if-not 'listp ll) 25 | ",\n") 26 | "\n") 27 | (align-regexp beg (point) "\\(\\s-+\\)=>" 1 1 t)) 28 | (insert " }\n")) 29 | 30 | (defun generate-replace-header (what) 31 | (insert 32 | "# Autogenerated by util/gen-special-replace.el\n\n" 33 | "module Orgmode\n")) 34 | 35 | (defun generate-replace-footer (what) 36 | (insert 37 | " @org_entities_regexp = /\\\\(there4|sup[123]|frac[13][24]|[a-zA-Z]+)($|\\{\\}|[^a-zA-Z])/\n\n" 38 | " def Orgmode.special_symbols_to_" what " str\n" 39 | " str.gsub! @org_entities_regexp do |match|\n" 40 | " if " (capitalize what) "Entities[$1]\n" 41 | " if $2 == \"{}\" then \"#{" (capitalize what) "Entities[$1]}\"\n" 42 | " else \"#{" (capitalize what) "Entities[$1]}#{$2}\"\n" 43 | " end\n" 44 | " else\n" 45 | " $&\n" 46 | " end\n" 47 | " end\n" 48 | " end\n" 49 | "end # module Orgmode\n")) 50 | 51 | (defun generate-replace (file-name what) 52 | (let ((file (expand-file-name file-name))) 53 | (with-temp-buffer 54 | (generate-replace-header what) 55 | (generate-replace-inbuffer what) 56 | (generate-replace-footer what) 57 | (write-file file)))) 58 | 59 | (generate-replace "../lib/org-ruby/html_symbol_replace.rb" "html") 60 | (generate-replace "../lib/org-ruby/textile_symbol_replace.rb" "textile") 61 | --------------------------------------------------------------------------------