pax_global_header00006660000000000000000000000064121057110760014512gustar00rootroot0000000000000052 comment=018286054861ed13cc0e5ecddf450f6a995bdeb8 ruby-org-0.8.0/000077500000000000000000000000001210571107600132655ustar00rootroot00000000000000ruby-org-0.8.0/.gitignore000066400000000000000000000000471210571107600152560ustar00rootroot00000000000000*.tmproj /util/gen-special-replace.elc ruby-org-0.8.0/.travis.yml000066400000000000000000000002271210571107600153770ustar00rootroot00000000000000language: ruby rvm: - 1.9.3 - 1.9.2 - 1.8.7 - jruby-18mode - jruby-19mode - rbx-18mode - rbx-19mode - ruby-head - jruby-head - ree ruby-org-0.8.0/Gemfile000066400000000000000000000002671210571107600145650ustar00rootroot00000000000000source :rubygems gemspec group :development, :test do gem 'rake' gem 'rspec' gem 'tilt' end group :coderay do gem 'coderay' end group :pygments do gem 'pygments.rb' end ruby-org-0.8.0/History.txt000066400000000000000000000115221210571107600154700ustar00rootroot00000000000000== 0.8.0 / 2013-02-10 * A lot of refactoring work and bugfixes contributed by vonavi (many thanks!) * Raw HTML is supported with #+html * Code indentation for code blocks is fixed now * Support for definition lists is improved * Bugfix for when including headlines in center and quote blocks. * Indentation of HTML output improved * Improvements to entities support for Textile and HTML outputs == 0.7.2 / 2012-10-07 * Many fixes to the regular expressions used for emphasis, contributed by [[http://github.com/vonavi][vonavi]] * Bug fix for when a table starts with a headline, thanks to [[http://github/til][til]] * Asterisk can be used for definition lists too * Use text lexer as default option for Pygments and Coderay when no language is specified == 0.7.1 / 2012-08-04 * Make source code blocks from lisp dialects use Pygments scheme lexer * Bugfix: Make Coderay fallback to text lexer when unsupported lang is set == 0.7.0 / 2012-07-08 * Highlight source code blocks using Pygments or CodeRay when available == 0.6.4 / 2012-07-08 * Fixed lists behavior when code fragments, tables and examples were present * Remove code tags with lang class and use instead src-:lang like org-exporter * Fixed property drawers to consider properties with hyphens like :noweb-ref: == 0.6.3 / 2012-05-22 * Minor enhancement: Correct handling of .org URIs in HTML markup routine (thanks, rayl) == 0.6.1 / 2012-04-14 * Added encoding directive to support Ruby 1.9.2 * Headlines with the COMMENT keyword, and the PROPERTIES drawer are not exported * Angle links in org-mode are embedded in anchor tags on html output * #+BEGIN/END_SRC lang code blocks are embedded in code tags with class that specifies the coding language * Fixed bug in code blocks when a colon was at the beginning * More than five dashes create an horizontal rule in html output == 0.6.0 / 2011-09-03 * Added support for a "header offset" -- turns one star into an H2, etc. (thanks, niku) * The anchor text for a link can now be an image, and will get an img tag (thanks, punchagan) * Fixed bug in tables; only the first row is a header even if others have divider lines (thanks, leathekd) * Fixed bug in the list regular expression; lists require a space after the item delimiter (thanks, punchagan) * Lots from ruediger: * subscript / superscript * definition lists * centered text * symbol replacement == 0.5.3 / 2010-02-15 * Minor enhancement: Displays inline images == 0.5.2 / 2010-01-05 * Refactored to improve layering. == 0.5.1 / 2009-12-30 * Minor enhancement: Recognize lines starting with ":" as examples. * Minor enhancement: Recognize #+BEGIN_SRC as source blocks * Minor enhancement: Add "src" and "example" classes to
 blocks.

== 0.5.0 / 2009-12-30

* Parse (but not necessarily *use*) in-buffer settings. The following
  in-buffer settings *are* used:
  * Understand the #+TITLE: directive.
  * Exporting todo keywords (option todo:t)
  * Numbering headlines (option num:t)
  * Skipping text before the first headline (option skip:t)
  * Skipping tables (option |:nil)
  * Custom todo keywords
  * EXPORT_SELECT_TAGS and EXPORT_EXLUDE_TAGS for controlling parts of
    the tree to export
* Rewrite "file:(blah).org" links to "http:(blah).html" links. This
  makes the inter-links to other org-mode files work.
* Uses  tags inside table rows that precede table separators.
* Bugfixes:
  * Headings now have HTML escaped.

== 0.4.2 / 2009-12-29

* Got rid of the extraneous newline at the start of code blocks.
* Everything now shows up in code blocks, even org-mode metadata.
* Fixed bugs:
  * Regressed smart double quotes with HTML escaping. Added a test
    case and fixed the regression.

== 0.4.1 / 2009-12-29

* HTML is now escaped by default
* org-mode comments will show up in a code block.

== 0.4.0 / 2009-12-28

* The first thing output in HTML gets the class "title"
* HTML output is now indented
* Proper support for multi-paragraph list items.
* Fixed bugs:
  * "rake spec" wouldn't work on Linux. Needed "require 'rubygems'".

== 0.3.0 / 2009-12-27

* Uses rubypants to get better typography (smart quotes, elipses, etc.).
* Fixed bugs:
  * Tables and lists did not get properly closed at the end of file
  * You couldn't do inline formatting inside table cells
  * Characters in PRE blocks were not HTML escaped.

== 0.2.0 / 2009-12-26

* Renamed the gem to org-ruby
* Added +to_html+ for HTML output
* Now supports the following inline markup: 
  * bold
  * italic
  * code
  * verbatim
  * underline
  * strikethrough
* Continued code cleanup and refactoring

== 0.1.0 / 2009-12-23

* Added support for block code
* Added support for list items that wrap in the org source
* Major code cleanup:
  Added +OutputBuffer+ class that should make the code more maintainable.

== 0.0.2 / 2009-12-21

* Initial version. Handles tables (but not headers), headlines,
  paragraphs, block quotes, strong & emphasis formatting.
ruby-org-0.8.0/README.rdoc000066400000000000000000000051111210571107600150710ustar00rootroot00000000000000= org-ruby
Originally by Brian Dewey (http://github.com/bdewey/org-ruby)

{Build Status}[http://travis-ci.org/wallyqs/org-ruby]

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.
Currently, you cannot do much to customize the conversion. The supplied textile conversion is optimized for extracting 
“content” from the orgfile as opposed to “metadata.”

== Installation

     gem install org-ruby

== Usage

From Ruby code:

     require 'org-ruby'

     # Renders HTML
     Orgmode::Parser.new("* Hello world!).to_html
     # => "

Hello world!

\n" # Renders Textile Orgmode::Parser.new("* Hello world!).to_textile # => "h1. Hello world!\n" It can also be used from the command line: org-ruby sample.org --translate html ...will output a HTML version of sample.org. org-ruby --translate textile sample.org ...will output a textile version of sample.org. == Features * Converts org-mode files to HTML or Textile * Supports tables, block quotes, code blocks, and html blocks * Supports bold, italic, underline, strikethrough, and code inline formatting. * Supports hyperlinks that are in double-brackets * Supports definition lists * Supports footnotes * Supports +.org+ views in Rails through Tilt. * Code syntax highlight of code blocks using Pygments.rb or Coderay when available == License (The MIT License) Copyright (c) 2009 Brian Dewey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ruby-org-0.8.0/Rakefile000066400000000000000000000004251210571107600147330ustar00rootroot00000000000000require 'rspec/core' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = FileList['spec/**/*_spec.rb'] spec.rspec_opts = ["--format", "documentation", "--colour"] end Dir['tasks/*'].each {|task| import task } task :default => 'test' ruby-org-0.8.0/announcement.txt000066400000000000000000000012011210571107600165120ustar00rootroot00000000000000org-ruby version 0.8.0 by Brian Dewey http://github.com/bdewey/org-ruby == DESCRIPTION This gem contains Ruby routines for parsing org-mode files.The most significant thing this library does today is convert org-mode files to HTML or textile. == CHANGES * A lot of refactoring work and bugfixes contributed by vonavi (many thanks!) * Raw HTML is supported with #+html * Code indentation for code blocks is fixed now * Support for definition lists is improved * Bugfix for when including headlines in center and quote blocks. * Indentation of HTML output improved * Improvements to entities support for Textile and HTML outputs ruby-org-0.8.0/bench/000077500000000000000000000000001210571107600143445ustar00rootroot00000000000000ruby-org-0.8.0/bench/Gemfile000066400000000000000000000001401210571107600156320ustar00rootroot00000000000000source :rubygems # Bench with the current version in development gem 'org-ruby', :path => '..' ruby-org-0.8.0/bench/Gemfile_6_0000066400000000000000000000000521210571107600163000ustar00rootroot00000000000000source :rubygems gem 'org-ruby', '0.6.0' ruby-org-0.8.0/bench/Gemfile_6_1000066400000000000000000000000521210571107600163010ustar00rootroot00000000000000source :rubygems gem 'org-ruby', '0.6.1' ruby-org-0.8.0/bench/Gemfile_6_2000066400000000000000000000000521210571107600163020ustar00rootroot00000000000000source :rubygems gem 'org-ruby', '0.6.2' ruby-org-0.8.0/bench/Gemfile_6_3000066400000000000000000000000521210571107600163030ustar00rootroot00000000000000source :rubygems gem 'org-ruby', '0.6.3' ruby-org-0.8.0/bench/Gemfile_redcarpet000066400000000000000000000000421210571107600176640ustar00rootroot00000000000000source :rubygems gem 'redcarpet' ruby-org-0.8.0/bench/bench.org000066400000000000000000000241401210571107600161350ustar00rootroot00000000000000* OrgRuby benchmarks ** How to run the benchmarks (or trying out org-babel) Within this folder there is a =parsing_test.rb= script which can be used to profile a quick benchmark of the current performance of the org-ruby library. What follows are the results of my benchmark by using the built-in support for org-babel included in Emacs 24. (press C-c C-c when over the block to update the benchmark) ** Platform: 1.8.7 For some reason performance is a bit better when using Ruby 1.8.7 than when using 1.9.2. *** OrgRuby 0.6.0 #+BEGIN_SRC sh :results verbatim source ~/.bashrc rvm use 1.8.7 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_6_0" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_6_0" bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.0 with Ruby 1.8.7 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 1.820000 0.040000 1.860000 ( 1.894356) : ------------------------------------------ total: 1.860000sec : : user system total real : html conversion 1.840000 0.010000 1.850000 ( 1.878953) *** OrgRuby 0.6.2 #+BEGIN_SRC sh :results verbatim source ~/.bashrc rvm use 1.8.7 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_6_2" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_6_2" bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.2 with Ruby 1.8.7 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 2.060000 0.030000 2.090000 ( 2.123677) : ------------------------------------------ total: 2.090000sec : : user system total real : html conversion 2.080000 0.030000 2.110000 ( 2.135976) *** OrgRuby 0.6.3 #+BEGIN_SRC sh :results verbatim source ~/.bashrc rvm use 1.8.7 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_6_3" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_6_3" bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.3 with Ruby 1.8.7 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 2.060000 0.040000 2.100000 ( 2.126579) : ------------------------------------------ total: 2.100000sec : : user system total real : html conversion 2.090000 0.030000 2.120000 ( 2.139272) *** DEV #+BEGIN_SRC sh :results verbatim source ~/.bashrc rvm use 1.8.7 > /dev/null rvm info | grep full_version bundle install > /dev/null bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.3 with Ruby 1.8.7 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 2.050000 0.030000 2.080000 ( 2.147836) : ------------------------------------------ total: 2.080000sec : : user system total real : html conversion 2.050000 0.030000 2.080000 ( 2.102787) ** Platform: 1.9.2 Remember that 1.9.2 is sensible to encoding issues. (e.g. あいうえお) *** OrgRuby 0.6.0 #+BEGIN_SRC sh :results verbatim source ~/.bashrc export LANG=en_US.UTF-8 rvm use 1.9.2 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_6_0" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_6_0" bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.0 with Ruby 1.9.2 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 3.250000 0.020000 3.270000 ( 3.313767) : ------------------------------------------ total: 3.270000sec : : user system total real : html conversion 3.220000 0.020000 3.240000 ( 3.307011) *** OrgRuby 0.6.2 #+BEGIN_SRC sh :results verbatim source ~/.bashrc export LANG=en_US.UTF-8 rvm use 1.9.2 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_6_2" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_6_2" bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.2 with Ruby 1.9.2 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 3.440000 0.030000 3.470000 ( 3.529776) : ------------------------------------------ total: 3.470000sec : : user system total real : html conversion 3.440000 0.030000 3.470000 ( 3.519090) *** OrgRuby 0.6.3 #+BEGIN_SRC sh :results verbatim source ~/.bashrc export LANG=en_US.UTF-8 rvm use 1.9.2 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_6_3" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_6_3" bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.3 with Ruby 1.9.2 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 3.430000 0.030000 3.460000 ( 3.526293) : ------------------------------------------ total: 3.460000sec : : user system total real : html conversion 3.440000 0.030000 3.470000 ( 3.525800) *** DEV #+BEGIN_SRC sh :results verbatim source ~/.bashrc export LANG=en_US.UTF-8 rvm use 1.9.2 > /dev/null rvm info | grep full_version bundle install > /dev/null bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.3 with Ruby 1.9.2 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 3.380000 0.020000 3.400000 ( 3.469689) : ------------------------------------------ total: 3.400000sec : : user system total real : html conversion 3.380000 0.030000 3.410000 ( 3.441502) ** Platform: 1.9.3 #+BEGIN_SRC sh :results verbatim source ~/.bashrc export LANG=en_US.UTF-8 rvm use 1.9.3 > /dev/null rvm info | grep full_version bundle install > /dev/null bundle exec ruby parsing_test.rb #+END_SRC #+RESULTS: : full_version: "ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]" : Running benchmark with OrgRuby version 0.6.3 with Ruby 1.9.3 : Parsing 30 times : Rehearsal --------------------------------------------------- : html conversion 3.810000 0.020000 3.830000 ( 3.960345) : ------------------------------------------ total: 3.830000sec : : user system total real : html conversion 3.790000 0.020000 3.810000 ( 3.848413) ** Other benchmarks *** Similar benchmark using other markup libraries **** Markdown using Redcarpet in Ruby 1.8.7 #+BEGIN_SRC sh :results verbatim source ~/.bashrc rvm use 1.8.7 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_redcarpet" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_redcarpet" bundle exec ruby parsing_redcarpet_test.rb #+END_SRC #+RESULTS: #+begin_example full_version: "ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.2.0]" Running benchmark with RedCarpet with Ruby 1.8.7 (n=30) Parsing 30 times Rehearsal ------------------------------------------------------------------ html conversion with Redcarpet 0.010000 0.000000 0.010000 ( 0.007885) --------------------------------------------------------- total: 0.010000sec user system total real html conversion with Redcarpet 0.010000 0.000000 0.010000 ( 0.007482) 0.010000 0.000000 0.010000 ( 0.007482) #+end_example **** Markdown using Redcarpet in Ruby 1.9.2 #+BEGIN_SRC sh :results verbatim source ~/.bashrc rvm use 1.9.2 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_redcarpet" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_redcarpet" bundle exec ruby parsing_redcarpet_test.rb #+END_SRC #+RESULTS: #+begin_example full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]" Running benchmark with RedCarpet with Ruby 1.9.2 (n=30) Parsing 30 times Rehearsal ------------------------------------------------------------------ html conversion with Redcarpet 0.010000 0.000000 0.010000 ( 0.007588) --------------------------------------------------------- total: 0.010000sec user system total real html conversion with Redcarpet 0.010000 0.000000 0.010000 ( 0.007063) 0.010000 0.000000 0.010000 ( 0.007063) #+end_example **** Markdown using Redcarpet in Ruby 1.9.3 #+BEGIN_SRC sh :results verbatim source ~/.bashrc rvm use 1.9.3 > /dev/null rvm info | grep full_version BUNDLE_GEMFILE="Gemfile_redcarpet" bundle install > /dev/null BUNDLE_GEMFILE="Gemfile_redcarpet" bundle exec ruby parsing_redcarpet_test.rb #+END_SRC #+RESULTS: #+begin_example full_version: "ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]" Running benchmark with RedCarpet with Ruby 1.9.3 (n=30) Parsing 30 times Rehearsal ------------------------------------------------------------------ html conversion with Redcarpet 0.010000 0.000000 0.010000 ( 0.007438) --------------------------------------------------------- total: 0.010000sec user system total real html conversion with Redcarpet 0.010000 0.000000 0.010000 ( 0.006909) 0.010000 0.000000 0.010000 ( 0.006909) #+end_example *** TODO Encoding benchmarks **** Not setting default Encoding **** Setting Encoding::UTF_8 as default **** Setting Encoding::ASCII_8BIT as default ruby-org-0.8.0/bench/parsing_redcarpet_test.rb000066400000000000000000000007001210571107600214210ustar00rootroot00000000000000require 'redcarpet' require 'benchmark' def run_benchmark(n=30) org_content = File.open('bench.org').read puts "Parsing #{n} times" markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) Benchmark.bmbm do |x| x.report('html conversion with Redcarpet') do n.times do markdown.render(org_content) end end end end puts "Running benchmark with RedCarpet with Ruby #{RUBY_VERSION} (n=30)" run_benchmark ruby-org-0.8.0/bench/parsing_test.rb000066400000000000000000000015741210571107600174020ustar00rootroot00000000000000require 'org-ruby' require 'benchmark' def run_html_output_benchmark(n=30) org_content = File.open('bench.org').read puts "Parsing #{n} times" Benchmark.bmbm do |x| x.report('html conversion') do n.times do Orgmode::Parser.new(org_content).to_html end end end end def run_textile_output_benchmark(n=30) org_content = File.open('bench.org').read puts "Parsing #{n} times" x.report('textile conversion') do n.times do Orgmode::Parser.new(content).to_textile end end end def run_parsing_file_benchmark(n=30) puts "Parsing #{n} times" x.report('textile conversion') do n.times do Orgmode::Parser.load('bench.org') end end end puts "Running benchmark using OrgRuby version #{OrgRuby::VERSION} with Ruby #{RUBY_VERSION}" run_html_output_benchmark # run_textile_output_benchmark # run_parsing_file_benchmark ruby-org-0.8.0/bin/000077500000000000000000000000001210571107600140355ustar00rootroot00000000000000ruby-org-0.8.0/bin/org-ruby000077500000000000000000000020631210571107600155320ustar00rootroot00000000000000#!/usr/bin/env ruby require 'org-ruby' require 'optparse' options = {} options_parser = OptionParser.new do |opts| options[:help] = false options[:format] = :html opts.banner = "Usage: org-ruby [options]" opts.on("-h", "--help", "Show this message") do |v| options[:help] = true end opts.on("-d", "--debug", "Run with $DEBUG true") do |v| options[:debug] = true end opts.on("-t", "--translate FORMAT", [:html, :textile], "Translate the ORG file to the specified format.") do |v| options[:format] = v end opts.on("-v", "--version", "Print version") do |v| options[:version] = true end end begin options_parser.parse! if options[:version] puts OrgRuby::VERSION exit end if (ARGV.length == 0) then puts options_parser else data = IO.read(ARGV[0]) p = Orgmode::Parser.new(data) $DEBUG = true if options[:debug] puts p.to_html if options[:format] == :html puts p.to_textile if options[:format] == :textile end rescue OptionParser::ParseError puts options_parser end ruby-org-0.8.0/lib/000077500000000000000000000000001210571107600140335ustar00rootroot00000000000000ruby-org-0.8.0/lib/org-ruby.rb000066400000000000000000000024601210571107600161300ustar00rootroot00000000000000$:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed # internal requires require 'org-ruby/parser' require 'org-ruby/regexp_helper' require 'org-ruby/line' require 'org-ruby/headline' require 'org-ruby/output_buffer' # HTML exporter require 'org-ruby/html_output_buffer' require 'org-ruby/html_symbol_replace' # Textile exporter require 'org-ruby/textile_output_buffer' require 'org-ruby/textile_symbol_replace' # Tilt support require 'org-ruby/tilt' module OrgRuby # :stopdoc: VERSION = '0.8.0' LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR # :startdoc: # Returns the version string for the library. # def self.version VERSION end # Utility method used to require all files ending in .rb that lie in the # directory below this file that has the same name as the filename passed # in. Optionally, a specific _directory_ name can be passed in such that # the _filename_ does not have to be equivalent to the directory. # def self.require_all_libs_relative_to( fname, dir = nil ) dir ||= ::File.basename(fname, '.*') search_me = ::File.expand_path( ::File.join(::File.dirname(fname), dir, '**', '*.rb')) Dir.glob(search_me).sort.each {|rb| require rb} end end ruby-org-0.8.0/lib/org-ruby/000077500000000000000000000000001210571107600156015ustar00rootroot00000000000000ruby-org-0.8.0/lib/org-ruby/headline.rb000066400000000000000000000060061210571107600177010ustar00rootroot00000000000000module Orgmode # Represents a headline in an orgmode file. class Headline < Line # This is the "level" of the headline attr_reader :level # This is the headline text -- the part of the headline minus the leading # asterisks, the keywords, and the tags. attr_reader :headline_text # This contains the lines that "belong" to the headline. attr_reader :body_lines # These are the headline tags attr_reader :tags # Optional keyword found at the beginning of the headline. attr_reader :keyword # Valid states for partial export. # exclude:: The entire subtree from this heading should be excluded. # headline_only:: The headline should be exported, but not the body. # all:: Everything should be exported, headline/body/children. ValidExportStates = [:exclude, :headline_only, :all] # The export state of this headline. See +ValidExportStates+. attr_accessor :export_state # This is the regex that matches a line LineRegexp = /^\*+\s+/ # This matches the tags on a headline TagsRegexp = /\s*:[\w:]*:\s*$/ # Special keywords allowed at the start of a line. Keywords = %w[TODO DONE] KeywordsRegexp = Regexp.new("^(#{Keywords.join('|')})\$") # This matches a headline marked as COMMENT CommentHeadlineRegexp = /^COMMENT\s+/ def initialize(line, parser = nil, offset=0) super(line, parser) @body_lines = [] @tags = [] @export_state = :exclude if (@line =~ LineRegexp) then @level = $&.strip.length + offset @headline_text = $'.strip if (@headline_text =~ TagsRegexp) then @tags = $&.split(/:/) # split tag text on semicolon @tags.delete_at(0) # the first item will be empty; discard @headline_text.gsub!(TagsRegexp, "") # Removes the tags from the headline end @keyword = nil parse_keywords else raise "'#{line}' is not a valid headline" end end # Override Line.output_text. For a heading, @headline_text # is what we should output. def output_text return @headline_text end # Determines if a line is an orgmode "headline": # A headline begins with one or more asterisks. def self.headline?(line) line =~ LineRegexp end # Determines if a headline has the COMMENT keyword. def comment_headline? @headline_text =~ CommentHeadlineRegexp end # Overrides Line.paragraph_type. def paragraph_type :"heading#{@level}" end ###################################################################### private def parse_keywords re = @parser.custom_keyword_regexp if @parser re ||= KeywordsRegexp words = @headline_text.split if words.length > 0 && words[0] =~ re then @keyword = words[0] @headline_text.sub!(Regexp.new("^#{@keyword}\s*"), "") end end end # class Headline end # class Orgmode ruby-org-0.8.0/lib/org-ruby/html_output_buffer.rb000066400000000000000000000256601210571107600220540ustar00rootroot00000000000000begin require 'pygments' rescue LoadError # Pygments is not supported so we try instead with CodeRay begin require 'coderay' rescue LoadError # No code syntax highlighting end end module Orgmode class HtmlOutputBuffer < OutputBuffer HtmlBlockTag = { :paragraph => "p", :ordered_list => "ol", :unordered_list => "ul", :list_item => "li", :definition_list => "dl", :definition_term => "dt", :definition_descr => "dd", :table => "table", :table_row => "tr", :quote => "blockquote", :example => "pre", :src => "pre", :inline_example => "pre", :center => "div", :heading1 => "h1", :heading2 => "h2", :heading3 => "h3", :heading4 => "h4", :heading5 => "h5", :heading6 => "h6" } attr_reader :options def initialize(output, opts = {}) super(output) if opts[:decorate_title] then @title_decoration = " class=\"title\"" else @title_decoration = "" end @buffer_tag = "HTML" @options = opts @new_paragraph = :start @footnotes = {} @unclosed_tags = [] @logger.debug "HTML export options: #{@options.inspect}" end # Output buffer is entering a new mode. Use this opportunity to # write out one of the block tags in the HtmlBlockTag constant to # put this information in the HTML stream. def push_mode(mode, indent) super(mode) @list_indent_stack.push(indent) if HtmlBlockTag[mode] unless ((mode_is_table?(mode) and skip_tables?) or (mode == :src and defined? Pygments)) css_class = case when (mode == :src and @block_lang.empty?) " class=\"src\"" when (mode == :src and not @block_lang.empty?) " class=\"src src-#{@block_lang}\"" when (mode == :example || mode == :inline_example) " class=\"example\"" when mode == :center " style=\"text-align: center\"" else @title_decoration end add_paragraph unless @new_paragraph == :start @new_paragraph = true @logger.debug "#{mode}: <#{HtmlBlockTag[mode]}#{css_class}>" @output << "<#{HtmlBlockTag[mode]}#{css_class}>" # Entering a new mode obliterates the title decoration @title_decoration = "" end end end # We are leaving a mode. Close any tags that were opened when # entering this mode. def pop_mode(mode = nil) m = super(mode) if HtmlBlockTag[m] unless ((mode_is_table?(m) and skip_tables?) or (m == :src and defined? Pygments)) add_paragraph if @new_paragraph @new_paragraph = true @logger.debug "" @output << "" end end @list_indent_stack.pop end def flush! return false if @buffer.empty? case when preserve_whitespace? strip_code_block! if mode_is_code? current_mode # NOTE: CodeRay and Pygments already escape the html once, so # no need to escape_string!(@buffer) case when (current_mode == :src and defined? Pygments) lang = normalize_lang @block_lang @output << "\n" unless @new_paragraph == :start begin @buffer = Pygments.highlight(@buffer, :lexer => lang) rescue # Not supported lexer from Pygments, we fallback on using the text lexer @buffer = Pygments.highlight(@buffer, :lexer => 'text') end when (current_mode == :src and defined? CodeRay) lang = normalize_lang @block_lang # CodeRay might throw a warning when unsupported lang is set, # then fallback to using the text lexer silence_warnings do begin @buffer = CodeRay.scan(@buffer, lang).html(:wrap => nil, :css => :style) rescue ArgumentError @buffer = CodeRay.scan(@buffer, 'text').html(:wrap => nil, :css => :style) end end when (current_mode == :html or current_mode == :raw_text) @buffer.gsub!(/\A\n/, "") if @new_paragraph == :start @new_paragraph = true else escape_string! @buffer end # Whitespace is significant in :code mode. Always output the # buffer and do not do any additional translation. @logger.debug "FLUSH CODE ==========> #{@buffer.inspect}" @output << @buffer when (mode_is_table? current_mode and skip_tables?) @logger.debug "SKIP ==========> #{current_mode}" else @buffer.lstrip! @new_paragraph = nil @logger.debug "FLUSH ==========> #{current_mode}" case current_mode when :definition_term d = @buffer.split(/\A(.*[ \t]+|)::(|[ \t]+.*?)$/, 4) d[1] = d[1].strip unless d[1].empty? @output << inline_formatting(d[1]) else @output << "???" end indent = @list_indent_stack.last pop_mode @new_paragraph = :start push_mode(:definition_descr, indent) @output << inline_formatting(d[2].strip + d[3]) @new_paragraph = nil when :horizontal_rule add_paragraph unless @new_paragraph == :start @new_paragraph = true @output << "
" else @output << inline_formatting(@buffer) end end @buffer = "" end def add_line_attributes headline if @options[:export_heading_number] then level = headline.level heading_number = get_next_headline_number(level) @output << "#{heading_number} " end if @options[:export_todo] and headline.keyword then keyword = headline.keyword @output << "#{keyword} " end end def output_footnotes! return false unless @options[:export_footnotes] and not @footnotes.empty? @output << "\n
\n

Footnotes:

\n
\n" @footnotes.each do |name, defi| @output << "

#{name}" \ << inline_formatting(defi) \ << "

\n" end @output << "
\n
" return true end # Test if we're in an output mode in which whitespace is significant. def preserve_whitespace? super or current_mode == :html end ###################################################################### private def skip_tables? @options[:skip_tables] end def mode_is_table?(mode) (mode == :table or mode == :table_row or mode == :table_separator or mode == :table_header) end # Escapes any HTML content in the output accumulation buffer @buffer. def escape_string! str str.gsub!(/&/, "&") # Escapes the left and right angular brackets but construction # @ which is formatted to str.gsub! /<([^<>\n]*)/ do |match| if $`[-1..-1] == "@" and $'[0..0] == ">" then $& else "<#{$1}" end end str.gsub! /([^<>\n]*)>/ do |match| if $`[-2..-1] == "@<" then $& else "#{$1}>" end end str.gsub!(/@(<[^<>\n]*>)/, "\\1") end def buffer_indentation indent = " " * @list_indent_stack.length @buffer << indent end def add_paragraph indent = " " * (@list_indent_stack.length - 1) @output << "\n" << indent end Tags = { "*" => { :open => "b", :close => "b" }, "/" => { :open => "i", :close => "i" }, "_" => { :open => "span style=\"text-decoration:underline;\"", :close => "span" }, "=" => { :open => "code", :close => "code" }, "~" => { :open => "code", :close => "code" }, "+" => { :open => "del", :close => "del" } } # Applies inline formatting rules to a string. def inline_formatting(str) @re_help.rewrite_emphasis str do |marker, s| "@<#{Tags[marker][:open]}>#{s}@" end if @options[:use_sub_superscripts] then @re_help.rewrite_subp str do |type, text| if type == "_" then "@#{text}@" elsif type == "^" then "@#{text}@" end end end @re_help.rewrite_links str do |link, defi| [link, defi].compact.each do |text| # We don't support search links right now. Get rid of it. text.sub!(/\A(file:[^\s]+)::[^\s]*?\Z/, "\\1") text.sub!(/\A(file:[^\s]+)\.org\Z/i, "\\1.html") text.sub!(/\Afile:(?=[^\s]+\Z)/, "") end # We don't add a description for images in links, because its # empty value forces the image to be inlined. defi ||= link unless link =~ @re_help.org_image_file_regexp if defi =~ @re_help.org_image_file_regexp defi = "@\"#{defi}\"" end if defi "@#{defi}@" else "@\"#{link}\"" end end if @output_type == :table_row str.gsub!(/^\|\s*/, "@") str.gsub!(/\s*\|$/, "@") str.gsub!(/\s*\|\s*/, "@@") end if @output_type == :table_header str.gsub!(/^\|\s*/, "@") str.gsub!(/\s*\|$/, "@") str.gsub!(/\s*\|\s*/, "@@") end if @options[:export_footnotes] then @re_help.rewrite_footnote str do |name, defi| # TODO escape name for url? @footnotes[name] = defi if defi "@@#{name}@@" end end escape_string! str Orgmode.special_symbols_to_html str str = @re_help.restore_code_snippets str end def normalize_lang(lang) case lang when 'emacs-lisp', 'common-lisp', 'lisp' 'scheme' when '' 'text' else lang end end # Helper method taken from Rails # https://github.com/rails/rails/blob/c2c8ef57d6f00d1c22743dc43746f95704d67a95/activesupport/lib/active_support/core_ext/kernel/reporting.rb#L10 def silence_warnings warn_level = $VERBOSE $VERBOSE = nil yield ensure $VERBOSE = warn_level end def strip_code_block! strip_regexp = Regexp.new("^" + " " * @code_block_indent) @buffer.gsub!(strip_regexp, "") @code_block_indent = nil end end # class HtmlOutputBuffer end # module Orgmode ruby-org-0.8.0/lib/org-ruby/html_symbol_replace.rb000066400000000000000000000216071210571107600221600ustar00rootroot00000000000000# Autogenerated by util/gen-special-replace.el module Orgmode HtmlEntities = { "Agrave" => "À", "agrave" => "à", "Aacute" => "Á", "aacute" => "á", "Acirc" => "Â", "acirc" => "â", "Atilde" => "Ã", "atilde" => "ã", "Auml" => "Ä", "auml" => "ä", "Aring" => "Å", "AA" => "Å", "aring" => "å", "AElig" => "Æ", "aelig" => "æ", "Ccedil" => "Ç", "ccedil" => "ç", "Egrave" => "È", "egrave" => "è", "Eacute" => "É", "eacute" => "é", "Ecirc" => "Ê", "ecirc" => "ê", "Euml" => "Ë", "euml" => "ë", "Igrave" => "Ì", "igrave" => "ì", "Iacute" => "Í", "iacute" => "í", "Icirc" => "Î", "icirc" => "î", "Iuml" => "Ï", "iuml" => "ï", "Ntilde" => "Ñ", "ntilde" => "ñ", "Ograve" => "Ò", "ograve" => "ò", "Oacute" => "Ó", "oacute" => "ó", "Ocirc" => "Ô", "ocirc" => "ô", "Otilde" => "Õ", "otilde" => "õ", "Ouml" => "Ö", "ouml" => "ö", "Oslash" => "Ø", "oslash" => "ø", "OElig" => "Œ", "oelig" => "œ", "Scaron" => "Š", "scaron" => "š", "szlig" => "ß", "Ugrave" => "Ù", "ugrave" => "ù", "Uacute" => "Ú", "uacute" => "ú", "Ucirc" => "Û", "ucirc" => "û", "Uuml" => "Ü", "uuml" => "ü", "Yacute" => "Ý", "yacute" => "ý", "Yuml" => "Ÿ", "yuml" => "ÿ", "fnof" => "ƒ", "real" => "ℜ", "image" => "ℑ", "weierp" => "℘", "Alpha" => "Α", "alpha" => "α", "Beta" => "Β", "beta" => "β", "Gamma" => "Γ", "gamma" => "γ", "Delta" => "Δ", "delta" => "δ", "Epsilon" => "Ε", "epsilon" => "ε", "varepsilon" => "ε", "Zeta" => "Ζ", "zeta" => "ζ", "Eta" => "Η", "eta" => "η", "Theta" => "Θ", "theta" => "θ", "thetasym" => "ϑ", "vartheta" => "ϑ", "Iota" => "Ι", "iota" => "ι", "Kappa" => "Κ", "kappa" => "κ", "Lambda" => "Λ", "lambda" => "λ", "Mu" => "Μ", "mu" => "μ", "nu" => "ν", "Nu" => "Ν", "Xi" => "Ξ", "xi" => "ξ", "Omicron" => "Ο", "omicron" => "ο", "Pi" => "Π", "pi" => "π", "Rho" => "Ρ", "rho" => "ρ", "Sigma" => "Σ", "sigma" => "σ", "sigmaf" => "ς", "varsigma" => "ς", "Tau" => "Τ", "Upsilon" => "Υ", "upsih" => "ϒ", "upsilon" => "υ", "Phi" => "Φ", "phi" => "φ", "Chi" => "Χ", "chi" => "χ", "acutex" => "´x", "Psi" => "Ψ", "psi" => "ψ", "tau" => "τ", "Omega" => "Ω", "omega" => "ω", "piv" => "ϖ", "partial" => "∂", "alefsym" => "ℵ", "ETH" => "Ð", "eth" => "ð", "THORN" => "Þ", "thorn" => "þ", "dots" => "…", "hellip" => "…", "middot" => "·", "iexcl" => "¡", "iquest" => "¿", "shy" => "­", "ndash" => "–", "mdash" => "—", "quot" => """, "acute" => "´", "ldquo" => "“", "rdquo" => "”", "bdquo" => "„", "lsquo" => "‘", "rsquo" => "’", "sbquo" => "‚", "laquo" => "«", "raquo" => "»", "lsaquo" => "‹", "rsaquo" => "›", "circ" => "ˆ", "vert" => "|", "brvbar" => "¦", "sect" => "§", "amp" => "&", "lt" => "<", "gt" => ">", "tilde" => "˜", "slash" => "/", "plus" => "+", "under" => "_", "equal" => "=", "asciicirc" => "^", "dagger" => "†", "Dagger" => "‡", "nbsp" => " ", "ensp" => " ", "emsp" => " ", "thinsp" => " ", "curren" => "¤", "cent" => "¢", "pound" => "£", "yen" => "¥", "euro" => "€", "EUR" => "€", "EURdig" => "€", "EURhv" => "€", "EURcr" => "€", "EURtm" => "€", "copy" => "©", "reg" => "®", "trade" => "™", "minus" => "−", "pm" => "±", "plusmn" => "±", "times" => "×", "frasl" => "⁄", "div" => "÷", "frac12" => "½", "frac14" => "¼", "frac34" => "¾", "permil" => "‰", "sup1" => "¹", "sup2" => "²", "sup3" => "³", "radic" => "√", "sum" => "∑", "prod" => "∏", "micro" => "µ", "macr" => "¯", "deg" => "°", "prime" => "′", "Prime" => "″", "infin" => "∞", "infty" => "∞", "prop" => "∝", "proptp" => "∝", "not" => "¬", "neg" => "¬", "land" => "∧", "wedge" => "∧", "lor" => "∨", "vee" => "∨", "cap" => "∩", "cup" => "∪", "int" => "∫", "there4" => "∴", "sim" => "∼", "cong" => "≅", "simeq" => "≅", "asymp" => "≈", "approx" => "≈", "ne" => "≠", "neq" => "≠", "equiv" => "≡", "le" => "≤", "ge" => "≥", "sub" => "⊂", "subset" => "⊂", "sup" => "⊃", "supset" => "⊃", "nsub" => "⊄", "sube" => "⊆", "nsup" => "⊅", "supe" => "⊇", "forall" => "∀", "exist" => "∃", "exists" => "∃", "empty" => "∅", "emptyset" => "∅", "isin" => "∈", "in" => "∈", "notin" => "∉", "ni" => "∋", "nabla" => "∇", "ang" => "∠", "angle" => "∠", "perp" => "⊥", "sdot" => "⋅", "cdot" => "⋅", "lceil" => "⌈", "rceil" => "⌉", "lfloor" => "⌊", "rfloor" => "⌋", "lang" => "⟨", "rang" => "⟩", "larr" => "←", "leftarrow" => "←", "gets" => "←", "lArr" => "⇐", "Leftarrow" => "⇐", "uarr" => "↑", "uparrow" => "↑", "uArr" => "⇑", "Uparrow" => "⇑", "rarr" => "→", "to" => "→", "rightarrow" => "→", "rArr" => "⇒", "Rightarrow" => "⇒", "darr" => "↓", "downarrow" => "↓", "dArr" => "⇓", "Downarrow" => "⇓", "harr" => "↔", "leftrightarrow" => "↔", "hArr" => "⇔", "Leftrightarrow" => "⇔", "crarr" => "↵", "hookleftarrow" => "↵", "arccos" => "arccos", "arcsin" => "arcsin", "arctan" => "arctan", "arg" => "arg", "cos" => "cos", "cosh" => "cosh", "cot" => "cot", "coth" => "coth", "csc" => "csc", "deg" => "°", "det" => "det", "dim" => "dim", "exp" => "exp", "gcd" => "gcd", "hom" => "hom", "inf" => "inf", "ker" => "ker", "lg" => "lg", "lim" => "lim", "liminf" => "liminf", "limsup" => "limsup", "ln" => "ln", "log" => "log", "max" => "max", "min" => "min", "Pr" => "Pr", "sec" => "sec", "sin" => "sin", "sinh" => "sinh", "sup" => "⊃", "tan" => "tan", "tanh" => "tanh", "bull" => "•", "bullet" => "•", "star" => "*", "lowast" => "∗", "ast" => "∗", "odot" => "o", "oplus" => "⊕", "otimes" => "⊗", "checkmark" => "✓", "para" => "¶", "ordf" => "ª", "ordm" => "º", "cedil" => "¸", "oline" => "‾", "uml" => "¨", "zwnj" => "‌", "zwj" => "‍", "lrm" => "‎", "rlm" => "‏", "smile" => "☺", "smiley" => "☺", "blacksmile" => "☻", "sad" => "☹", "clubs" => "♣", "clubsuit" => "♣", "spades" => "♠", "spadesuit" => "♠", "hearts" => "♥", "heartsuit" => "♥", "diams" => "♦", "diamondsuit" => "♦", "Diamond" => "⋄", "loz" => "◊" } @org_entities_regexp = /\\(there4|sup[123]|frac[13][24]|[a-zA-Z]+)($|\{\}|[^a-zA-Z])/ def Orgmode.special_symbols_to_html str str.gsub! @org_entities_regexp do |match| if HtmlEntities[$1] if $2 == "{}" then "#{HtmlEntities[$1]}" else "#{HtmlEntities[$1]}#{$2}" end else $& end end end end # module Orgmode ruby-org-0.8.0/lib/org-ruby/line.rb000066400000000000000000000210651210571107600170610ustar00rootroot00000000000000module Orgmode # Represents a single line of an orgmode file. class Line # This is the line itself. attr_reader :line # The indent level of this line. this is important to properly translate # nested lists from orgmode to textile. # TODO 2009-12-20 bdewey: Handle tabs attr_reader :indent # Backpointer to the parser that owns this line. attr_reader :parser # Paragraph type determined for the line. attr_reader :paragraph_type # Major modes associate paragraphs with a table, list and so on. attr_reader :major_mode # A line can have its type assigned instead of inferred from its # content. For example, something that parses as a "table" on its # own ("| one | two|\n") may just be a paragraph if it's inside # #+BEGIN_EXAMPLE. Set this property on the line to assign its # type. This will then affect the value of +paragraph_type+. attr_accessor :assigned_paragraph_type def initialize(line, parser = nil) @parser = parser @line = line @indent = 0 @line =~ /\s*/ determine_paragraph_type determine_major_mode @assigned_paragraph_type = nil @indent = $&.length unless blank? end def to_s return @line end # Tests if a line is a comment. def comment? return @assigned_paragraph_type == :comment if @assigned_paragraph_type return block_type.casecmp("COMMENT") if begin_block? or end_block? return @line =~ /^#/ end PropertyDrawerRegexp = /^\s*:(PROPERTIES|END):/i def property_drawer_begin_block? @line =~ PropertyDrawerRegexp && $1 =~ /PROPERTIES/ end def property_drawer_end_block? @line =~ PropertyDrawerRegexp && $1 =~ /END/ end def property_drawer? check_assignment_or_regexp(:property_drawer, PropertyDrawerRegexp) end PropertyDrawerItemRegexp = /^\s*:([0-9A-Za-z_\-]+):\s*(.*)$/i def property_drawer_item? @line =~ PropertyDrawerItemRegexp end # Tests if a line contains metadata instead of actual content. def metadata? check_assignment_or_regexp(:metadata, /^\s*(CLOCK|DEADLINE|START|CLOSED|SCHEDULED):/) end def nonprinting? comment? || metadata? || begin_block? || end_block? end def blank? check_assignment_or_regexp(:blank, /^\s*$/) end def plain_list? ordered_list? or unordered_list? or definition_list? end UnorderedListRegexp = /^\s*(-|\+|\s+[*])\s+/ def unordered_list? check_assignment_or_regexp(:unordered_list, UnorderedListRegexp) end def strip_unordered_list_tag @line.sub(UnorderedListRegexp, "") end DefinitionListRegexp = /^\s*(-|\+|\s+[*])\s+(.*\s+|)::($|\s+)/ def definition_list? check_assignment_or_regexp(:definition_list, DefinitionListRegexp) end OrderedListRegexp = /^\s*\d+(\.|\))\s+/ def ordered_list? check_assignment_or_regexp(:ordered_list, OrderedListRegexp) end def strip_ordered_list_tag @line.sub(OrderedListRegexp, "") end HorizontalRuleRegexp = /^\s*-{5,}\s*$/ def horizontal_rule? check_assignment_or_regexp(:horizontal_rule, HorizontalRuleRegexp) end # Extracts meaningful text and excludes org-mode markup, # like identifiers for lists or headings. def output_text return strip_ordered_list_tag if ordered_list? return strip_unordered_list_tag if unordered_list? return @line.sub(InlineExampleRegexp, "") if inline_example? return strip_raw_text_tag if raw_text? return line end def plain_text? not metadata? and not blank? and not plain_list? end def table_row? # for an org-mode table, the first non-whitespace character is a # | (pipe). check_assignment_or_regexp(:table_row, /^\s*\|/) end def table_separator? # an org-mode table separator has the first non-whitespace # character as a | (pipe), then consists of nothing else other # than pipes, hyphens, and pluses. check_assignment_or_regexp(:table_separator, /^\s*\|[-\|\+]*\s*$/) end # Checks if this line is a table header. def table_header? @assigned_paragraph_type == :table_header end def table? table_row? or table_separator? or table_header? end BlockRegexp = /^\s*#\+(BEGIN|END)_(\w*)\s*([0-9A-Za-z_\-]*)?/i def begin_block? @line =~ BlockRegexp && $1 =~ /BEGIN/i end def end_block? @line =~ BlockRegexp && $1 =~ /END/i end def block_type $2 if @line =~ BlockRegexp end def block_lang $3 if @line =~ BlockRegexp end def code_block? block_type =~ /^(EXAMPLE|SRC)$/i end InlineExampleRegexp = /^\s*:\s/ # Test if the line matches the "inline example" case: # the first character on the line is a colon. def inline_example? check_assignment_or_regexp(:inline_example, InlineExampleRegexp) end RawTextRegexp = /^(\s*)#\+(\w+):\s*/ # Checks if this line is raw text. def raw_text? check_assignment_or_regexp(:raw_text, RawTextRegexp) end def raw_text_tag $2.upcase if @line =~ RawTextRegexp end def strip_raw_text_tag @line.sub(RawTextRegexp) { |match| $1 } end InBufferSettingRegexp = /^#\+(\w+):\s*(.*)$/ # call-seq: # line.in_buffer_setting? => boolean # line.in_buffer_setting? { |key, value| ... } # # Called without a block, this method determines if the line # contains an in-buffer setting. Called with a block, the block # will get called if the line contains an in-buffer setting with # the key and value for the setting. def in_buffer_setting? return false if @assigned_paragraph_type && @assigned_paragraph_type != :comment if block_given? then if @line =~ InBufferSettingRegexp yield $1, $2 end else @line =~ InBufferSettingRegexp end end # Determines the paragraph type of the current line. def determine_paragraph_type @paragraph_type = \ case when blank? :blank when definition_list? # order is important! A definition_list is also an unordered_list! :definition_term when (ordered_list? or unordered_list?) :list_item when property_drawer_begin_block? :property_drawer_begin_block when property_drawer_end_block? :property_drawer_end_block when property_drawer_item? :property_drawer_item when metadata? :metadata when block_type case block_type.downcase.to_sym when :center, :comment, :example, :html, :quote, :src block_type.downcase.to_sym else :comment end when raw_text? # order is important! Raw text can be also a comment :raw_text when comment? :comment when table_separator? :table_separator when table_row? :table_row when table_header? :table_header when inline_example? :inline_example when horizontal_rule? :horizontal_rule else :paragraph end end def determine_major_mode @major_mode = \ case when definition_list? # order is important! A definition_list is also an unordered_list! :definition_list when ordered_list? :ordered_list when unordered_list? :unordered_list when table? :table end end ###################################################################### private # This function is an internal helper for determining the paragraph # type of a line... for instance, if the line is a comment or contains # metadata. It's used in routines like blank?, plain_list?, etc. # # What's tricky is lines can have assigned types, so you need to check # the assigned type, if present, or see if the characteristic regexp # for the paragraph type matches if not present. # # call-seq: # check_assignment_or_regexp(assignment, regexp) => boolean # # assignment:: if the paragraph has an assigned type, it will be # checked to see if it equals +assignment+. # regexp:: If the paragraph does not have an assigned type, # the contents of the paragraph will be checked against # this regexp. def check_assignment_or_regexp(assignment, regexp) return @assigned_paragraph_type == assignment if @assigned_paragraph_type return @line =~ regexp end end # class Line end # module Orgmode ruby-org-0.8.0/lib/org-ruby/output_buffer.rb000066400000000000000000000203531210571107600210220ustar00rootroot00000000000000require 'logger' module Orgmode # The OutputBuffer is used to accumulate multiple lines of orgmode # text, and then emit them to the output all in one go. The class # will do the final textile substitution for inline formatting and # add a newline character prior emitting the output. class OutputBuffer # This is the overall output buffer attr_reader :output # This is the current type of output being accumulated. attr_accessor :output_type # Creates a new OutputBuffer object that is bound to an output object. # The output will get flushed to =output=. def initialize(output) # This is the accumulation buffer. It's a holding pen so # consecutive lines of the right type can get stuck together # without intervening newlines. @buffer = "" # This stack is used to do proper outline numbering of # headlines. @headline_number_stack = [] @output = output @output_type = :start @list_indent_stack = [] @mode_stack = [] @code_block_indent = nil @logger = Logger.new(STDERR) if ENV['DEBUG'] or $DEBUG @logger.level = Logger::DEBUG else @logger.level = Logger::WARN end @re_help = RegexpHelper.new end def current_mode @mode_stack.last end def push_mode(mode) @mode_stack.push(mode) end def pop_mode(mode = nil) m = @mode_stack.pop @logger.warn "Modes don't match. Expected to pop #{mode}, but popped #{m}" if mode && mode != m m end def insert(line) # Prepares the output buffer to receive content from a line. # As a side effect, this may flush the current accumulated text. @logger.debug "Looking at #{line.paragraph_type}(#{current_mode}) : #{line.to_s}" # We try to get the lang from #+BEGIN_SRC blocks @block_lang = line.block_lang if line.begin_block? unless should_accumulate_output?(line) flush! maintain_mode_stack(line) end # Adds the current line to the output buffer case when line.raw_text? @buffer << "\n" << line.output_text if line.raw_text_tag == @buffer_tag when preserve_whitespace? @buffer << "\n" << line.output_text unless line.block_type when line.assigned_paragraph_type == :code # If the line is contained within a code block but we should # not preserve whitespaces, then we do nothing. when (line.kind_of? Headline) add_line_attributes line @buffer << "\n" << line.output_text.strip when ([:definition_term, :list_item, :table_row, :table_header, :horizontal_rule].include? line.paragraph_type) @buffer << "\n" << line.output_text.strip when line.paragraph_type == :paragraph @buffer << "\n" buffer_indentation @buffer << line.output_text.strip end if mode_is_code? current_mode and not line.block_type # Determines the amount of whitespaces to be stripped at the # beginning of each line in code block. if @code_block_indent @code_block_indent = [@code_block_indent, line.indent].min else @code_block_indent = line.indent end end @output_type = line.assigned_paragraph_type || line.paragraph_type end # Gets the next headline number for a given level. The intent is # this function is called sequentially for each headline that # needs to get numbered. It does standard outline numbering. def get_next_headline_number(level) raise "Headline level not valid: #{level}" if level <= 0 while level > @headline_number_stack.length do @headline_number_stack.push 0 end while level < @headline_number_stack.length do @headline_number_stack.pop end raise "Oops, shouldn't happen" unless level == @headline_number_stack.length @headline_number_stack[@headline_number_stack.length - 1] += 1 @headline_number_stack.join(".") end # Gets the current list indent level. def list_indent_level @list_indent_stack.length end # Test if we're in an output mode in which whitespace is significant. def preserve_whitespace? [:example, :inline_example, :raw_text, :src].include? current_mode end ###################################################################### private def mode_is_heading?(mode) [:heading1, :heading2, :heading3, :heading4, :heading5, :heading6].include? mode end def mode_is_block?(mode) [:quote, :center, :example, :src].include? mode end def mode_is_code?(mode) [:example, :src].include? mode end def boundary_of_block?(line) # Boundary of inline example return true if ((line.paragraph_type == :inline_example) ^ (@output_type == :inline_example)) # Boundary of begin...end block return true if mode_is_block? @output_type end def maintain_mode_stack(line) # Always close the following lines pop_mode if (mode_is_heading? current_mode or current_mode == :paragraph or current_mode == :horizontal_rule or current_mode == :inline_example or current_mode == :raw_text) # End-block line closes every mode within block if line.end_block? and @mode_stack.include? line.paragraph_type pop_mode until current_mode == line.paragraph_type end if ((not line.paragraph_type == :blank) or @output_type == :blank) # Close previous tags on demand. Two blank lines close all tags. while ((not @list_indent_stack.empty?) and @list_indent_stack.last >= line.indent and # Don't allow an arbitrary line to close block (not mode_is_block? current_mode)) # Item can't close its major mode if (@list_indent_stack.last == line.indent and line.major_mode == current_mode) break else pop_mode end end end # Special case: Only end-block line closes block pop_mode if line.end_block? and line.paragraph_type == current_mode unless line.paragraph_type == :blank if (@list_indent_stack.empty? or @list_indent_stack.last <= line.indent or mode_is_block? current_mode) # Opens the major mode of line if it exists if @list_indent_stack.last != line.indent or mode_is_block? current_mode push_mode(line.major_mode, line.indent) if line.major_mode end # Opens tag that precedes text immediately push_mode(line.paragraph_type, line.indent) unless line.end_block? end end end def output_footnotes! return false end # Tests if the current line should be accumulated in the current # output buffer. def should_accumulate_output? line # Special case: Assign mode if not yet done. return false unless current_mode # Special case: Handles accumulating block content and example lines if mode_is_code? current_mode return true unless (line.end_block? and line.paragraph_type == current_mode) end return false if boundary_of_block? line return true if current_mode == :inline_example # Special case: Don't accumulate the following lines. return false if (mode_is_heading? @output_type or @output_type == :comment or @output_type == :horizontal_rule or @output_type == :raw_text) # Special case: Blank line at least splits paragraphs return false if @output_type == :blank if line.paragraph_type == :paragraph # Paragraph gets accumulated only if its indent level is # greater than the indent level of the previous mode. if @mode_stack[-2] and not mode_is_block? @mode_stack[-2] return false if line.indent <= @list_indent_stack[-2] end # Special case: Multiple "paragraphs" get accumulated. return true end false end def buffer_indentation return false end end # class OutputBuffer end # module Orgmode ruby-org-0.8.0/lib/org-ruby/parser.rb000066400000000000000000000231171210571107600174260ustar00rootroot00000000000000require 'rubypants' module Orgmode ## ## Simple routines for loading / saving an ORG file. ## class Parser # All of the lines of the orgmode file attr_reader :lines # All of the headlines in the org file attr_reader :headlines # These are any lines before the first headline attr_reader :header_lines # This contains any in-buffer settings from the org-mode file. # See http://orgmode.org/manual/In_002dbuffer-settings.html#In_002dbuffer-settings attr_reader :in_buffer_settings # This contains in-buffer options; a special case of in-buffer settings. attr_reader :options # Array of custom keywords. attr_reader :custom_keywords # Regexp that recognizes words in custom_keywords. def custom_keyword_regexp return nil if @custom_keywords.empty? Regexp.new("^(#{@custom_keywords.join('|')})\$") end # A set of tags that, if present on any headlines in the org-file, means # only those headings will get exported. def export_select_tags return Array.new unless @in_buffer_settings["EXPORT_SELECT_TAGS"] @in_buffer_settings["EXPORT_SELECT_TAGS"].split end # A set of tags that, if present on any headlines in the org-file, means # that subtree will not get exported. def export_exclude_tags return Array.new unless @in_buffer_settings["EXPORT_EXCLUDE_TAGS"] @in_buffer_settings["EXPORT_EXCLUDE_TAGS"].split end # Returns true if we are to export todo keywords on headings. def export_todo? "t" == @options["todo"] end # Returns true if we are to export footnotes def export_footnotes? "t" == @options["f"] end # Returns true if we are to export heading numbers. def export_heading_number? "t" == @options["num"] end # Should we skip exporting text before the first heading? def skip_header_lines? "t" == @options["skip"] end # Should we export tables? Defaults to true, must be overridden # with an explicit "nil" def export_tables? "nil" != @options["|"] end # Should we export sub/superscripts? (_{foo}/^{foo}) # only {} mode is currently supported. def use_sub_superscripts? @options["^"] != "nil" end # I can construct a parser object either with an array of lines # or with a single string that I will split along \n boundaries. def initialize(lines, offset=0) if lines.is_a? Array then @lines = lines elsif lines.is_a? String then @lines = lines.split("\n") else raise "Unsupported type for +lines+: #{lines.class}" end @custom_keywords = [] @headlines = Array.new @current_headline = nil @header_lines = [] @in_buffer_settings = { } @options = { } mode = :normal previous_line = nil table_header_set = false @lines.each do |text| line = Line.new text, self mode = :normal if line.end_block? and mode == line.paragraph_type mode = :normal if line.property_drawer_end_block? and mode == :property_drawer case mode when :normal, :quote, :center if Headline.headline? line.line line = Headline.new line.line, self, offset elsif line.table_separator? if previous_line and previous_line.paragraph_type == :table_row and !table_header_set previous_line.assigned_paragraph_type = :table_header table_header_set = true end end table_header_set = false if !line.table? when :example, :html, :src # As long as we stay in code mode, force lines to be code. # Don't try to interpret structural items, like headings and tables. line.assigned_paragraph_type = :code end if mode == :normal @headlines << @current_headline = line if Headline.headline? line.line # If there is a setting on this line, remember it. line.in_buffer_setting? do |key, value| store_in_buffer_setting key.upcase, value end mode = line.paragraph_type if line.begin_block? mode = :property_drawer if line.property_drawer_begin_block? end unless mode == :comment if @current_headline @current_headline.body_lines << line else @header_lines << line end end previous_line = line end # @lines.each end # initialize # Creates a new parser from the data in a given file def self.load(fname) lines = IO.readlines(fname) return self.new(lines) end # Saves the loaded orgmode file as a textile file. def to_textile output = "" output_buffer = TextileOutputBuffer.new(output) translate(@header_lines, output_buffer) @headlines.each do |headline| translate(headline.body_lines, output_buffer) end output end # Converts the loaded org-mode file to HTML. def to_html mark_trees_for_export export_options = { :decorate_title => @in_buffer_settings["TITLE"], :export_heading_number => export_heading_number?, :export_todo => export_todo?, :use_sub_superscripts => use_sub_superscripts?, :export_footnotes => export_footnotes? } export_options[:skip_tables] = true if not export_tables? output = "" output_buffer = HtmlOutputBuffer.new(output, export_options) if @in_buffer_settings["TITLE"] then # If we're given a new title, then just create a new line # for that title. title = Line.new(@in_buffer_settings["TITLE"], self) translate([title], output_buffer) end translate(@header_lines, output_buffer) unless skip_header_lines? # If we've output anything at all, remove the :decorate_title option. export_options.delete(:decorate_title) if (output.length > 0) @headlines.each do |headline| next if headline.export_state == :exclude case headline.export_state when :exclude # NOTHING when :headline_only translate(headline.body_lines[0, 1], output_buffer) when :all translate(headline.body_lines, output_buffer) end end output << "\n" rp = RubyPants.new(output) rp.to_html end ###################################################################### private # Converts an array of lines to the appropriate format. # Writes the output to +output_buffer+. def translate(lines, output_buffer) output_buffer.output_type = :start lines.each { |line| output_buffer.insert(line) } output_buffer.flush! output_buffer.pop_mode while output_buffer.current_mode output_buffer.output_footnotes! output_buffer.output end # Uses export_select_tags and export_exclude_tags to determine # which parts of the org-file to export. def mark_trees_for_export marked_any = false # cache the tags select = export_select_tags exclude = export_exclude_tags inherit_export_level = nil ancestor_stack = [] # First pass: See if any headlines are explicitly selected @headlines.each do |headline| ancestor_stack.pop while not ancestor_stack.empty? and headline.level <= ancestor_stack.last.level if inherit_export_level and headline.level > inherit_export_level headline.export_state = :all else inherit_export_level = nil headline.tags.each do |tag| if (select.include? tag) then marked_any = true headline.export_state = :all ancestor_stack.each { |a| a.export_state = :headline_only unless a.export_state == :all } inherit_export_level = headline.level end end end ancestor_stack.push headline end # If nothing was selected, then EVERYTHING is selected. @headlines.each { |h| h.export_state = :all } unless marked_any # Second pass. Look for things that should be excluded, and get rid of them. @headlines.each do |headline| if inherit_export_level and headline.level > inherit_export_level headline.export_state = :exclude else inherit_export_level = nil headline.tags.each do |tag| if (exclude.include? tag) then headline.export_state = :exclude inherit_export_level = headline.level end end if headline.comment_headline? headline.export_state = :exclude inherit_export_level = headline.level end end end end # Stores an in-buffer setting. def store_in_buffer_setting(key, value) if key == "OPTIONS" then # Options are stored in a hash. Special-case. value.split.each do |opt| if opt =~ /^(.*):(.*?)$/ then @options[$1] = $2 else raise "Unexpected option: #{opt}" end end elsif key =~ /^(TODO|SEQ_TODO|TYP_TODO)$/ then # Handle todo keywords specially. value.split.each do |keyword| keyword.gsub!(/\(.*\)/, "") # Get rid of any parenthetical notes keyword = Regexp.escape(keyword) next if keyword == "\\|" # Special character in the todo format, not really a keyword @custom_keywords << keyword end else @in_buffer_settings[key] = value end end end # class Parser end # module Orgmode ruby-org-0.8.0/lib/org-ruby/regexp_helper.rb000066400000000000000000000152021210571107600207570ustar00rootroot00000000000000require 'logger' module Orgmode # = Summary # # This class contains helper routines to deal with the Regexp "black # magic" you need to properly parse org-mode files. # # = Key methods # # * Use +rewrite_emphasis+ to replace org-mode emphasis strings (e.g., # \/italic/) with the suitable markup for the output. # # * Use +rewrite_links+ to get a chance to rewrite all org-mode # links with suitable markup for the output. # # * Use +rewrite_images+ to rewrite all inline image links with suitable # markup for the output. class RegexpHelper ###################################################################### # EMPHASIS # # I figure it's best to stick as closely to the elisp implementation # as possible for emphasis. org.el defines the regular expression that # is used to apply "emphasis" (in my terminology, inline formatting # instead of block formatting). Here's the documentation from org.el. # # Terminology: In an emphasis string like " *strong word* ", we # call the initial space PREMATCH, the final space POSTMATCH, the # stars MARKERS, "s" and "d" are BORDER characters and "trong wor" # is the body. The different components in this variable specify # what is allowed/forbidden in each part: # # pre Chars allowed as prematch. Line beginning allowed, too. # post Chars allowed as postmatch. Line end will be allowed too. # border The chars *forbidden* as border characters. # body-regexp A regexp like \".\" to match a body character. Don't use # non-shy groups here, and don't allow newline here. # newline The maximum number of newlines allowed in an emphasis exp. attr_reader :org_image_file_regexp def initialize # Set up the emphasis regular expression. @pre_emphasis = ' \t\(\'"\{' @post_emphasis = '- \t\.,:!\?;\'"\)\}\\\\' @border_forbidden = '\s,"\'' @body_regexp = '.*?' @max_newlines = 1 @body_regexp = "#{@body_regexp}" + "(?:\\n#{@body_regexp}){0,#{@max_newlines}}" if @max_newlines > 0 @markers = '\*\/_=~\+' @code_snippet_stack = [] @logger = Logger.new(STDERR) @logger.level = Logger::WARN build_org_emphasis_regexp build_org_link_regexp @org_subp_regexp = /([_^])\{(.*?)\}/ @org_footnote_regexp = /\[fn:(.+?)(:(.*?))?\]/ end # Finds all emphasis matches in a string. # Supply a block that will get the marker and body as parameters. def match_all(str) str.scan(@org_emphasis_regexp) do |match| yield $2, $3 end end # Compute replacements for all matching emphasized phrases. # Supply a block that will get the marker and body as parameters; # return the replacement string from your block. # # = Example # # re = RegexpHelper.new # result = re.rewrite_emphasis("*bold*, /italic/, =code=") do |marker, body| # "<#{map[marker]}>#{body}" # end # # In this example, the block body will get called three times: # # 1. Marker: "*", body: "bold" # 2. Marker: "/", body: "italic" # 3. Marker: "=", body: "code" # # The return from this block is a string that will be used to # replace "*bold*", "/italic/", and "=code=", # respectively. (Clearly this sample string will use HTML-like # syntax, assuming +map+ is defined appropriately.) def rewrite_emphasis str # escape the percent signs for safe restoring code snippets str.gsub!(/%/, "%%") format_str = "%s" str.gsub! @org_emphasis_regexp do |match| # preserve the code snippet from further formatting inner = if $2 == "=" or $2 == "~" @code_snippet_stack.push $3 yield $2, format_str else yield $2, $3 end "#{$1}#{inner}" end end # rewrite subscript and superscript (_{foo} and ^{bar}) def rewrite_subp str # :yields: type ("_" for subscript and "^" for superscript), text str.gsub! @org_subp_regexp do |match| yield $1, $2 end end # rewrite footnotes def rewrite_footnote str # :yields: name, definition or nil str.gsub! @org_footnote_regexp do |match| yield $1, $3 end end # = Summary # # Rewrite org-mode links in a string to markup suitable to the # output format. # # = Usage # # Give this a block that expect the link and optional friendly # text. Return how that link should get formatted. # # = Example # # re = RegexpHelper.new # result = re.rewrite_links("[[http://www.bing.com]] and [[http://www.hotmail.com][Hotmail]]") do |link, text} # text ||= link # "#{text}" # end # # In this example, the block body will get called two times. In the # first instance, +text+ will be nil (the org-mode markup gives no # friendly text for the link +http://www.bing.com+. In the second # instance, the block will get text of *Hotmail* and the link # +http://www.hotmail.com+. In both cases, the block returns an # HTML-style link, and that is how things will get recorded in # +result+. def rewrite_links str # :yields: link, text str.gsub! @org_link_regexp do |match| yield $1, $3 end str.gsub! @org_angle_link_text_regexp do |match| yield $1, nil end str # for testing end def restore_code_snippets str str = str % @code_snippet_stack @code_snippet_stack = [] str end private def build_org_emphasis_regexp @org_emphasis_regexp = Regexp.new("([#{@pre_emphasis}]|^)" + "([#{@markers}])(?!\\2)" + "([^#{@border_forbidden}]|" + "[^#{@border_forbidden}]#{@body_regexp}" + "[^#{@border_forbidden}])\\2" + "(?=[#{@post_emphasis}]|$)") @logger.debug "Just created regexp: #{@org_emphasis_regexp}" end def build_org_link_regexp @org_link_regexp = /\[\[ ([^\]\[]+) # This is the URL \](\[ ([^\]\[]+) # This is the friendly text \])?\]/x @org_angle_link_text_regexp = /<(\w+:[^\]\s<>]+)>/ @org_image_file_regexp = /\.(gif|jpe?g|p(?:bm|gm|n[gm]|pm)|svg|tiff?|x[bp]m)/i end end # class Emphasis end # module Orgmode ruby-org-0.8.0/lib/org-ruby/textile_output_buffer.rb000066400000000000000000000105611210571107600225600ustar00rootroot00000000000000require 'stringio' module Orgmode class TextileOutputBuffer < OutputBuffer def initialize(output) super(output) @add_paragraph = true @support_definition_list = true # TODO this should be an option @footnotes = [] end def push_mode(mode, indent) @list_indent_stack.push(indent) super(mode) @output << "bc. " if mode_is_code? mode if mode == :center or mode == :quote @add_paragraph = false @output << "\n" end end def pop_mode(mode = nil) m = super(mode) @list_indent_stack.pop if m == :center or m == :quote @add_paragraph = true @output << "\n" end m end # Maps org markup to textile markup. TextileMap = { "*" => "*", "/" => "_", "_" => "_", "=" => "@", "~" => "@", "+" => "+" } # Handles inline formatting for textile. def inline_formatting(input) @re_help.rewrite_emphasis input do |marker, body| m = TextileMap[marker] "#{m}#{body}#{m}" end @re_help.rewrite_subp input do |type, text| if type == "_" then "~#{text}~" elsif type == "^" then "^#{text}^" end end @re_help.rewrite_links input do |link, defi| [link, defi].compact.each do |text| # We don't support search links right now. Get rid of it. text.sub!(/\A(file:[^\s]+)::[^\s]*?\Z/, "\\1") text.sub!(/\A(file:[^\s]+)\.org\Z/i, "\\1.textile") text.sub!(/\Afile:(?=[^\s]+\Z)/, "") end # We don't add a description for images in links, because its # empty value forces the image to be inlined. defi ||= link unless link =~ @re_help.org_image_file_regexp link = link.gsub(/ /, "%%20") if defi =~ @re_help.org_image_file_regexp defi = "!#{defi}(#{defi})!" elsif defi defi = "\"#{defi}\"" end if defi "#{defi}:#{link}" else "!#{link}(#{link})!" end end @re_help.rewrite_footnote input do |name, definition| # textile only support numerical names, so we need to do some conversion # Try to find the footnote and use its index footnote = @footnotes.select {|f| f[:name] == name }.first if footnote # The latest definition overrides other ones footnote[:definition] = definition if definition and not footnote[:definition] else # There is no footnote with the current name so we add it footnote = { :name => name, :definition => definition } @footnotes << footnote end "[#{@footnotes.index(footnote)}]" end Orgmode.special_symbols_to_textile(input) input = @re_help.restore_code_snippets input input end def output_footnotes! return false if @footnotes.empty? @footnotes.each do |footnote| index = @footnotes.index(footnote) @output << "\nfn#{index}. #{footnote[:definition] || 'DEFINITION NOT FOUND' }\n" end return true end # Flushes the current buffer def flush! return false if @buffer.empty? and @output_type != :blank @logger.debug "FLUSH ==========> #{@output_type}" @buffer.gsub!(/\A\n*/, "") case when preserve_whitespace? @output << @buffer << "\n" when @output_type == :blank @output << "\n" else case current_mode when :paragraph @output << "p. " if @add_paragraph @output << "p=. " if @mode_stack[0] == :center @output << "bq. " if @mode_stack[0] == :quote when :list_item if @mode_stack[-2] == :ordered_list @output << "#" * @mode_stack.count(:list_item) << " " else # corresponds to unordered list @output << "*" * @mode_stack.count(:list_item) << " " end when :definition_term if @support_definition_list @output << "-" * @mode_stack.count(:definition_term) << " " @buffer.sub!("::", ":=") end end @output << inline_formatting(@buffer) << "\n" end @buffer = "" end def add_line_attributes headline @output << "h#{headline.level}. " end end # class TextileOutputBuffer end # module Orgmode ruby-org-0.8.0/lib/org-ruby/textile_symbol_replace.rb000066400000000000000000000172551210571107600226760ustar00rootroot00000000000000# -*- coding: utf-8 -*- # Autogenerated by util/gen-special-replace.el module Orgmode TextileEntities = { "Agrave" => "À", "agrave" => "à", "Aacute" => "Á", "aacute" => "á", "Acirc" => "Â", "acirc" => "â", "Atilde" => "Ã", "atilde" => "ã", "Auml" => "Ä", "auml" => "ä", "Aring" => "Å", "AA" => "Å", "aring" => "å", "AElig" => "Æ", "aelig" => "æ", "Ccedil" => "Ç", "ccedil" => "ç", "Egrave" => "È", "egrave" => "è", "Eacute" => "É", "eacute" => "é", "Ecirc" => "Ê", "ecirc" => "ê", "Euml" => "Ë", "euml" => "ë", "Igrave" => "Ì", "igrave" => "ì", "Iacute" => "Í", "iacute" => "í", "Icirc" => "Î", "icirc" => "î", "Iuml" => "Ï", "iuml" => "ï", "Ntilde" => "Ñ", "ntilde" => "ñ", "Ograve" => "Ò", "ograve" => "ò", "Oacute" => "Ó", "oacute" => "ó", "Ocirc" => "Ô", "ocirc" => "ô", "Otilde" => "Õ", "otilde" => "õ", "Ouml" => "Ö", "ouml" => "ö", "Oslash" => "Ø", "oslash" => "ø", "OElig" => "Œ", "oelig" => "œ", "Scaron" => "Š", "scaron" => "š", "szlig" => "ß", "Ugrave" => "Ù", "ugrave" => "ù", "Uacute" => "Ú", "uacute" => "ú", "Ucirc" => "Û", "ucirc" => "û", "Uuml" => "Ü", "uuml" => "ü", "Yacute" => "Ý", "yacute" => "ý", "Yuml" => "Ÿ", "yuml" => "ÿ", "fnof" => "ƒ", "real" => "ℜ", "image" => "ℑ", "weierp" => "℘", "Alpha" => "Α", "alpha" => "α", "Beta" => "Β", "beta" => "β", "Gamma" => "Γ", "gamma" => "γ", "Delta" => "Δ", "delta" => "δ", "Epsilon" => "Ε", "epsilon" => "ε", "varepsilon" => "ε", "Zeta" => "Ζ", "zeta" => "ζ", "Eta" => "Η", "eta" => "η", "Theta" => "Θ", "theta" => "θ", "thetasym" => "ϑ", "vartheta" => "ϑ", "Iota" => "Ι", "iota" => "ι", "Kappa" => "Κ", "kappa" => "κ", "Lambda" => "Λ", "lambda" => "λ", "Mu" => "Μ", "mu" => "μ", "nu" => "ν", "Nu" => "Ν", "Xi" => "Ξ", "xi" => "ξ", "Omicron" => "Ο", "omicron" => "ο", "Pi" => "Π", "pi" => "π", "Rho" => "Ρ", "rho" => "ρ", "Sigma" => "Σ", "sigma" => "σ", "sigmaf" => "ς", "varsigma" => "ς", "Tau" => "Τ", "Upsilon" => "Υ", "upsih" => "ϒ", "upsilon" => "υ", "Phi" => "Φ", "phi" => "φ", "Chi" => "Χ", "chi" => "χ", "acutex" => "𝑥́", "Psi" => "Ψ", "psi" => "ψ", "tau" => "τ", "Omega" => "Ω", "omega" => "ω", "piv" => "ϖ", "partial" => "∂", "alefsym" => "ℵ", "ETH" => "Ð", "eth" => "ð", "THORN" => "Þ", "thorn" => "þ", "dots" => "…", "hellip" => "…", "middot" => "·", "iexcl" => "¡", "iquest" => "¿", "shy" => "", "ndash" => "–", "mdash" => "—", "quot" => "\"", "acute" => "´", "ldquo" => "“", "rdquo" => "”", "bdquo" => "„", "lsquo" => "‘", "rsquo" => "’", "sbquo" => "‚", "laquo" => "«", "raquo" => "»", "lsaquo" => "‹", "rsaquo" => "›", "circ" => "ˆ", "vert" => "|", "brvbar" => "¦", "sect" => "§", "amp" => "&", "lt" => "<", "gt" => ">", "tilde" => "~", "slash" => "/", "plus" => "+", "under" => "_", "equal" => "=", "asciicirc" => "^", "dagger" => "†", "Dagger" => "‡", "nbsp" => " ", "ensp" => " ", "emsp" => " ", "thinsp" => " ", "curren" => "¤", "cent" => "¢", "pound" => "£", "yen" => "¥", "euro" => "€", "EUR" => "€", "EURdig" => "€", "EURhv" => "€", "EURcr" => "€", "EURtm" => "€", "copy" => "©", "reg" => "®", "trade" => "™", "minus" => "−", "pm" => "±", "plusmn" => "±", "times" => "×", "frasl" => "⁄", "div" => "÷", "frac12" => "½", "frac14" => "¼", "frac34" => "¾", "permil" => "‰", "sup1" => "¹", "sup2" => "²", "sup3" => "³", "radic" => "√", "sum" => "∑", "prod" => "∏", "micro" => "µ", "macr" => "¯", "deg" => "°", "prime" => "′", "Prime" => "″", "infin" => "∞", "infty" => "∞", "prop" => "∝", "proptp" => "∝", "not" => "¬", "neg" => "¬", "land" => "∧", "wedge" => "∧", "lor" => "∨", "vee" => "∨", "cap" => "∩", "cup" => "∪", "int" => "∫", "there4" => "∴", "sim" => "∼", "cong" => "≅", "simeq" => "≅", "asymp" => "≈", "approx" => "≈", "ne" => "≠", "neq" => "≠", "equiv" => "≡", "le" => "≤", "ge" => "≥", "sub" => "⊂", "subset" => "⊂", "sup" => "⊃", "supset" => "⊃", "nsub" => "⊄", "sube" => "⊆", "nsup" => "⊅", "supe" => "⊇", "forall" => "∀", "exist" => "∃", "exists" => "∃", "empty" => "∅", "emptyset" => "∅", "isin" => "∈", "in" => "∈", "notin" => "∉", "ni" => "∋", "nabla" => "∇", "ang" => "∠", "angle" => "∠", "perp" => "⊥", "sdot" => "⋅", "cdot" => "⋅", "lceil" => "⌈", "rceil" => "⌉", "lfloor" => "⌊", "rfloor" => "⌋", "lang" => "⟨", "rang" => "⟩", "larr" => "←", "leftarrow" => "←", "gets" => "←", "lArr" => "⇐", "Leftarrow" => "⇐", "uarr" => "↑", "uparrow" => "↑", "uArr" => "⇑", "Uparrow" => "⇑", "rarr" => "→", "to" => "→", "rightarrow" => "→", "rArr" => "⇒", "Rightarrow" => "⇒", "darr" => "↓", "downarrow" => "↓", "dArr" => "⇓", "Downarrow" => "⇓", "harr" => "↔", "leftrightarrow" => "↔", "hArr" => "⇔", "Leftrightarrow" => "⇔", "crarr" => "↵", "hookleftarrow" => "↵", "arccos" => "arccos", "arcsin" => "arcsin", "arctan" => "arctan", "arg" => "arg", "cos" => "cos", "cosh" => "cosh", "cot" => "cot", "coth" => "coth", "csc" => "csc", "deg" => "deg", "det" => "det", "dim" => "dim", "exp" => "exp", "gcd" => "gcd", "hom" => "hom", "inf" => "inf", "ker" => "ker", "lg" => "lg", "lim" => "lim", "liminf" => "liminf", "limsup" => "limsup", "ln" => "ln", "log" => "log", "max" => "max", "min" => "min", "Pr" => "Pr", "sec" => "sec", "sin" => "sin", "sinh" => "sinh", "sup" => "sup", "tan" => "tan", "tanh" => "tanh", "bull" => "•", "bullet" => "•", "star" => "⋆", "lowast" => "∗", "ast" => "*", "odot" => "ʘ", "oplus" => "⊕", "otimes" => "⊗", "checkmark" => "✓", "para" => "¶", "ordf" => "ª", "ordm" => "º", "cedil" => "¸", "oline" => "‾", "uml" => "¨", "zwnj" => "‌", "zwj" => "‍", "lrm" => "‎", "rlm" => "‏", "smile" => "⌣", "smiley" => "☺", "blacksmile" => "☻", "sad" => "☹", "clubs" => "♣", "clubsuit" => "♣", "spades" => "♠", "spadesuit" => "♠", "hearts" => "♥", "heartsuit" => "♥", "diams" => "♦", "diamondsuit" => "♦", "Diamond" => "⋄", "loz" => "◊" } @org_entities_regexp = /\\(there4|sup[123]|frac[13][24]|[a-zA-Z]+)($|\{\}|[^a-zA-Z])/ def Orgmode.special_symbols_to_textile str str.gsub! @org_entities_regexp do |match| if TextileEntities[$1] if $2 == "{}" then "#{TextileEntities[$1]}" else "#{TextileEntities[$1]}#{$2}" end else $& end end end end # module Orgmode ruby-org-0.8.0/lib/org-ruby/tilt.rb000066400000000000000000000007621210571107600171070ustar00rootroot00000000000000begin require 'tilt' module Tilt class OrgTemplate < Template def self.engine_initialized? defined? ::Orgmode end def initialize_engine require 'org-ruby' end def prepare @engine = Orgmode::Parser.new(data) @output = nil end def evaluate(scope, locals, &block) @output ||= @engine.to_html end end end Tilt.register Tilt::OrgTemplate, 'org' rescue LoadError # Tilt is not available. end ruby-org-0.8.0/org-ruby.gemspec000066400000000000000000000033551210571107600164060ustar00rootroot00000000000000# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "org-ruby" s.version = "0.8.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Brian Dewey"] s.date = "2012-10-07" s.description = "This gem contains Ruby routines for parsing org-mode files.The most\nsignificant thing this library does today is convert org-mode files to\nHTML or textile. Currently, you cannot do much to customize the\nconversion. The supplied textile conversion is optimized for\nextracting \"content\" from the orgfile as opposed to \"metadata.\" " s.email = "bdewey@gmail.com" s.executables = ["org-ruby"] s.extra_rdoc_files = ["History.txt", "README.rdoc", "bin/org-ruby"] 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/textile_output_buffer.rb", "lib/org-ruby/textile_symbol_replace.rb", "lib/org-ruby/tilt.rb"] s.homepage = "http://github.com/bdewey/org-ruby" s.rdoc_options = ["--main", "README.rdoc"] s.require_paths = ["lib"] s.rubyforge_project = "org-ruby" s.rubygems_version = "1.8.10" s.summary = "This gem contains Ruby routines for parsing org-mode files." if s.respond_to? :specification_version then s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q, [">= 0.2.0"]) else s.add_dependency(%q, [">= 0.2.0"]) end else s.add_dependency(%q, [">= 0.2.0"]) end end ruby-org-0.8.0/spec/000077500000000000000000000000001210571107600142175ustar00rootroot00000000000000ruby-org-0.8.0/spec/data/000077500000000000000000000000001210571107600151305ustar00rootroot00000000000000ruby-org-0.8.0/spec/data/freeform-example.org000066400000000000000000000077051210571107600211100ustar00rootroot00000000000000#+BEGIN_EXAMPLE #+TITLE: Freeform #+AUTHOR: #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-20 Sun #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: #+END_EXAMPLE Freeform This is my todo list, research file, and log record from working on the Freeform project. * Future ideas :someday: - Add *posts* - Enforce uniqueness of url_token - Add FeedSync support - Auto-recognize URLs - Edit in place - Import/export of content. I want it to be safe to store real content on the site. - Page reordering. - AtomPub support. - Organization: - Move pages around - Add tags and navigation by tags - Add a breadcrumb bar * TODO Add versioning support :current:feature: ** DONE UI rough-in CLOSED: [2009-11-26 Thu] ** DONE Author logging CLOSED: [2009-11-27 Fri] ** DONE Version table and model updates CLOSED: [2009-11-28 Sat 22:40] CLOCK: [2009-11-28 Sat 21:35]--[2009-11-28 Sat 22:40] => 1:05 CLOCK: [2009-11-28 Sat 21:01]--[2009-11-28 Sat 21:25] => 0:24 CLOCK: [2009-11-28 Sat 19:46]--[2009-11-28 Sat 20:54] => 1:08 CLOCK: [2009-11-28 Sat 14:38]--[2009-11-28 Sat 15:08] => 0:30 CLOCK: [2009-11-28 Sat 13:21]--[2009-11-28 Sat 14:37] => 1:16 OK, my current thinking is to have each idea have many Changes. A change has many change records. A change record is a list of specific attributes that change, and includes the old and the new values. I'll use callbacks on the Idea model to maintain the changes. *** DONE Create version method CLOSED: [2009-11-28 Sat 22:40] *** DONE Make current method CLOSED: [2009-11-28 Sat 22:40] ** Update pages controller *** DONE Show versions CLOSED: [2009-11-30 Mon 00:34] CLOCK: [2009-11-29 Sun 21:27]--[2009-11-29 Sun 21:54] => 0:27 CLOCK: [2009-11-29 Sun 15:40]--[2009-11-29 Sun 15:44] => 0:04 CLOCK: [2009-11-28 Sat 22:44]--[2009-11-28 Sat 23:50] => 1:06 I'm now at the point where I *list* versions, but I can't show them. - [X] I currently suspect that I broke my version recovery code when I switched the order of the idea_changes. I need to investigate why nothing's failing in the tests; I expected failures. Possible addition to test: start looking at those version numbers. OK, here's what was going on: In the test, you need to reload the idea_changes array from the database to get the database sort order. I also make sure I do this inside the Idea methods. **** DONE Write a test for Idea::attributes_for_change CLOSED: [2009-11-29 Sun 23:59] CLOCK: [2009-11-29 Sun 23:47]--[2009-11-29 Sun 23:58] => 0:11 CLOCK: [2009-11-29 Sun 22:02]--[2009-11-29 Sun 23:42] => 1:40 CLOCK: [2009-11-29 Sun 21:54]--[2009-11-29 Sun 21:56] => 0:02 *** DONE Write integration tests that cover versions. CLOSED: [2009-12-11 Fri 23:25] CLOCK: [2009-12-11 Fri 20:27]--[2009-12-11 Fri 23:25] => 2:58 *** DONE Recover versions CLOSED: [2009-12-12 Sat 22:09] CLOCK: [2009-12-12 Sat 21:02]--[2009-12-12 Sat 22:09] => 1:07 CLOCK: [2009-12-12 Sat 20:13]--[2009-12-12 Sat 21:00] => 0:47 *** DONE Move to recycle bin CLOSED: [2009-12-12 Sat 22:59] CLOCK: [2009-12-12 Sat 22:23]--[2009-12-12 Sat 22:59] => 0:36 Note I'm avoiding logging delete operations because I'm presuming there will be a recycle bin, and therefore the *pages* controller will never actually delete files. At some point, when I want to support full FeedSync, I'll need to tackle this. The other timebomb: I don't know how well my logging scheme will work when pages move. I don't yet know if I will address this in the current sprint. ruby-org-0.8.0/spec/data/freeform.org000066400000000000000000000076471210571107600174640ustar00rootroot00000000000000#+TITLE: Freeform #+AUTHOR: #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-20 Sun #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: Freeform This is my todo list, research file, and log record from working on the Freeform project. * Future ideas :someday: - Add *posts* - Enforce uniqueness of url_token - Add FeedSync support - Auto-recognize URLs - Edit in place - Import/export of content. I want it to be safe to store real content on the site. - Page reordering. - AtomPub support. - Organization: - Move pages around - Add tags and navigation by tags - Add a breadcrumb bar * TODO Add versioning support :current:feature: ** DONE UI rough-in CLOSED: [2009-11-26 Thu] ** DONE Author logging CLOSED: [2009-11-27 Fri] ** DONE Version table and model updates CLOSED: [2009-11-28 Sat 22:40] CLOCK: [2009-11-28 Sat 21:35]--[2009-11-28 Sat 22:40] => 1:05 CLOCK: [2009-11-28 Sat 21:01]--[2009-11-28 Sat 21:25] => 0:24 CLOCK: [2009-11-28 Sat 19:46]--[2009-11-28 Sat 20:54] => 1:08 CLOCK: [2009-11-28 Sat 14:38]--[2009-11-28 Sat 15:08] => 0:30 CLOCK: [2009-11-28 Sat 13:21]--[2009-11-28 Sat 14:37] => 1:16 OK, my current thinking is to have each idea have many Changes. A change has many change records. A change record is a list of specific attributes that change, and includes the old and the new values. I'll use callbacks on the Idea model to maintain the changes. *** DONE Create version method CLOSED: [2009-11-28 Sat 22:40] *** DONE Make current method CLOSED: [2009-11-28 Sat 22:40] ** Update pages controller *** DONE Show versions CLOSED: [2009-11-30 Mon 00:34] CLOCK: [2009-11-29 Sun 21:27]--[2009-11-29 Sun 21:54] => 0:27 CLOCK: [2009-11-29 Sun 15:40]--[2009-11-29 Sun 15:44] => 0:04 CLOCK: [2009-11-28 Sat 22:44]--[2009-11-28 Sat 23:50] => 1:06 I'm now at the point where I *list* versions, but I can't show them. - [X] I currently suspect that I broke my version recovery code when I switched the order of the idea_changes. I need to investigate why nothing's failing in the tests; I expected failures. Possible addition to test: start looking at those version numbers. OK, here's what was going on: In the test, you need to reload the idea_changes array from the database to get the database sort order. I also make sure I do this inside the Idea methods. **** DONE Write a test for Idea::attributes_for_change CLOSED: [2009-11-29 Sun 23:59] CLOCK: [2009-11-29 Sun 23:47]--[2009-11-29 Sun 23:58] => 0:11 CLOCK: [2009-11-29 Sun 22:02]--[2009-11-29 Sun 23:42] => 1:40 CLOCK: [2009-11-29 Sun 21:54]--[2009-11-29 Sun 21:56] => 0:02 *** DONE Write integration tests that cover versions. CLOSED: [2009-12-11 Fri 23:25] CLOCK: [2009-12-11 Fri 20:27]--[2009-12-11 Fri 23:25] => 2:58 *** DONE Recover versions CLOSED: [2009-12-12 Sat 22:09] CLOCK: [2009-12-12 Sat 21:02]--[2009-12-12 Sat 22:09] => 1:07 CLOCK: [2009-12-12 Sat 20:13]--[2009-12-12 Sat 21:00] => 0:47 *** DONE Move to recycle bin CLOSED: [2009-12-12 Sat 22:59] CLOCK: [2009-12-12 Sat 22:23]--[2009-12-12 Sat 22:59] => 0:36 Note I'm avoiding logging delete operations because I'm presuming there will be a recycle bin, and therefore the *pages* controller will never actually delete files. At some point, when I want to support full FeedSync, I'll need to tackle this. The other timebomb: I don't know how well my logging scheme will work when pages move. I don't yet know if I will address this in the current sprint. ruby-org-0.8.0/spec/data/hyp-planning.org000066400000000000000000000573421210571107600202600ustar00rootroot00000000000000#+TITLE: Introduction to Hyper-V Pre-Planning and Planning #+AUTHOR: Brian Dewey #+EMAIL: bdewey@microsoft.com #+DATE: December 9, 2009 #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:nil #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:nil #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: * DONE Introduction CLOSED: [2009-12-09 Wed 15:18] CLOCK: [2009-12-09 Wed 15:00]--[2009-12-09 Wed 15:18] => 0:18 CLOCK: [2009-12-09 Wed 10:02]--[2009-12-09 Wed 10:14] => 0:12 The pre-planning activities for Hyper-V proceeded in three phases. In the first phase, we identified and wrote down a set of /business value propositions./ These are things we could pitch to customers as new value they would get from using Windows 8. To wrap up phase one, we worked with Mike Neil's team in Windows Server to rank the business value propositions. This step ensured that COSD and Windows Server operated from a common, agreed-upon set of priorities. For the second phase of pre-planning, we brainstormed all of the features we would need to implement to deliver on the value propositions from phase one. We captured a short description of each potential feature in a one-page spec. In the final phase of pre-planning, the dev team estimated how much dev effort would be required to implement each feature. By the numbers, our pre-planning work generated: - 19 different value propositions - 159 one-page specs - A 770-line spreadsheet containing dev estimates - 4.5 times the amount of dev work than we can tackle in a single release Moving from pre-planning to planning, our objective has been to understand and to shape overall Windows priorities so we can pick the /right/ 20% of work to commit to for Windows 8. This document gives an overview of the different pre-planning activities we did. It provides pointers to the pre-planning artefacts we produced and shows how we've been able to map our pre-planning work into planning. * Business Value Propositions CLOCK: [2009-12-07 Mon 09:09]--[2009-12-07 Mon 09:50] => 0:41 CLOSED: [2009-12-01 Tue 10:52] One of the first pre-planning activities we did in Hyper-V was define a set of /business value propositions/ (BVPs). A business value proposition is an end-to-end hook that can convince a customer that Windows 8 is worth buying. Our BVPs are stored in the [[http://windows/hyper-v/initiatives/Value%20Propositions/Forms/AllItems.aspx][Hyper-V Portal]]. ** Anatomy of a BVP Each BVP followed a simple, one-page template with the following parts: - Customer Summary - Storyboard - Requirements - Partner teams The following sections walk through each section and give an example from one of our BVPs, [[http://windows/hyper-v/initiatives/Value Propositions/DynamicDatacenter-ValueProp.docx][Resource-Smart Virtualization Infrastructure]] (also called /Dynamic Datacenter/). *** Customer Summary The /customer summary/ section is a one-sentence description of the customer value proposition, written from the customer's point of view. Each customer summary starts with the phrase, /I want.../ The purpose of this section is to make sure we can give a concise description of what we expect the customer to accomplish. #+BEGIN_QUOTE /Example:/ I want to add or remove computing resources to company owned virtualization infrastructure automatically, on-demand in response to rapidly changing business needs without any loss of business availability. #+END_QUOTE *** Storyboard To help people understand the customer scenario, the /storyboard/ section walks through the steps the customer would take to get the new value from Windows 8. #+BEGIN_QUOTE /Example:/ Comsco warehouse IT provides access to multitudes of different workloads including database servers, LOB applications, and homegrown three-tier distributed applications spread across two sites. Tim, administrator at Comsco IT, wants to see VM life cycle management (create, deploy, service, move and destroy) utilizing their existing tools and want it to be more efficient process than managing physical servers. Tim wants Microsoft software to automatically create new VM on server from a pool of physical servers and deploy workload in the VM when combined criteria of load balancing and resource utilization he defined are met. While Tim will continue to monitor real-time usage and Joe, who works in CIO office, wants historical trending of resource utilization of CPU, memory, power, storage, network bandwidth, storage bandwidth and backup bandwidth for selected VMs and workloads across all the servers. Based on historical trend analysis, Tim receives business logic requirements from the office of CIO and he defines per VM multi dimensional policy in Microsoft software to automatically control resource usage allocation, resource prioritization and resource move for above resource types. Tim also wants to service storage hardware without any downtime to running workloads. Tim wants MS software to freely move workloads between his primary site and across the town secondary site as needed without any downtime. #+END_QUOTE *** Requirements This section captures the core requirements for delivering the customer value. Knowing we would not be able to do everything, we categorized requirements into those needed for delivering good value, a better value, and best value. To minimize the randomization that could come from the bucketing, we identified the customers who would be satisfied by a given level of value. #+BEGIN_QUOTE /Example:/ | Target Level | Customer | Example Requirements | |--------------+-----------------------------------------+-----------------------------------------------| | Good | Large/medium enterprises | Storage migration with zero business downtime | | Better | Early adopters at the Dyanmic I/O model | VM migration for load balancing | | Best | Hosters | Chargeback infrastructure | #+END_QUOTE *** Partner teams Because BVPs describe end-to-end value, none can be delivered just from the Hyper-V team. This section notes the partner teams we would need to reach out to. #+BEGIN_QUOTE /Example:/ SCVMM, Failover clustering, Kernel, Intel & AMD #+END_QUOTE ** BVP Ranking Working with Mike Neil's team, the Hyper-V trio and PM leads ranked the BVPs based on the information we'd gathered through CFD sessions and on the importance of competing with VMWare. The consensus opinion is stored in a spreadsheet [[http://windows/hyper-v/initiatives/Value Propositions/ValueProposition-BucketTemplate-Master.xlsx][here]]. For each BVP, we also identified the target value level -- would we aim for good value, better value, or best value? Here's our ranked BVP list. | Value Proposition | Customer Statement | Target Bucket | |----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------| | Resource-Smart Virtualization Infrastructure | I want to add or remove computing resources to company owned virtualization infrastructure automatically, on-demand in response to rapidly changing business needs without any loss of business availability. | Best | | Server High Availability | I want to ensure that my server applications are highly available. | Better | | Server Disaster Recovery | I want to ensure my business can quickly resume operations in the event of a disaster. | Better | | Platform Extensibility | I want a rich ecosystem so I'm not locked into a single vendor for storage, networking, etc. | Better | | Hosting | I need to be able to deploy thousands of physical servers into one or more farms dedicated for hosting. Provisioning of virtual machines must integrate fully into my back end network topology. Virtual machines must have strong network isolation. I must be able to monitor, change, charge for and throttle usage dynamically. I must be able to move virtual machines to another server in my farm with little or no downtime. | Better | | Scale Up | I want to get the maximum utilization from my hardware investment. | Better | | VDI | I want to control cost by deploying thin desktops and letting employees connect to a completely virtualized desktop. | Better | | Cloud Integration | I want to be able to dynamically enable movement of workloads between on premise and off premise without changing the operational or application model. | Better | | Security | I want to enhance the security of my system by making it more difficult for malicious programs to attack my operating system core. | Good | | Deployment | I want to increase efficiency in managing my datacenter & desktop infrastructure. | Better | | Green IT | I want to increase energy efficiency in my datacenter infrastructure. | Good | | Server test/dev | I want to quickly and easily create and test server applications. | Good | | Appliance Development Model | I want to reduce development costs by shipping a server application in a pre-configured VM. | Good | | Application Compatibility | I want users to have access to old applications even when I upgrade their desktop operating systems. | Cut | | Client test/dev | I want to quickly and easily create and test desktop applications | Cut | | Integration Testing | I want to quickly and easily test new applications and updates before deploying them | Cut | | Employee-owned hardware | I want to let employees use their own hardware to run corporate applications and connect to the corporate network in a secure way. | Cut | * DONE One-Page Specs SCHEDULED: <2009-12-07 Mon> CLOSED: [2009-12-07 Mon 16:39] CLOCK: [2009-12-07 Mon 16:26]--[2009-12-07 Mon 16:39] => 0:13 Armed with the prioritized list of customer value propositions to consider for Windows 8, we started work on the next level of detail: What features would we need to implement to deliver the value proposition? Two main tasks refined our thinking in this area. First, we brainstormed all of the features required to deliver the target level of value in the BVP. Then, to reduce ambiguity, we wrote a /one page spec/ for each feature. What exactly does /cross-cluster live migration/ mean? The one-page spec tells you. The goal of the one page spec was to capture just enough information that a developer could estimate how expensive the feature would be to implement. Our one-page spec library is [[http://windows/hyper-v/w8/Specs/Forms/AllItems.aspx][here]]. #+BEGIN_QUOTE /Example: Cross-cluster live migration/ Key customer scenario: An enterprise is building large scale Hyper-V based infrastructure to run vast majority of server workloads with High-Availability is a requirement. Customer builds multiple clusters for one or more of the following business needs: # NOTE, for formatting reasons, don't fill the following. - To keep cluster size to be manageable based on preconceived perception of node failure time is linearly proportional to cluster size, - Due to increased business need they need to build new cluster once maximum supported cluster size is reached, - There are departmental clusters and temporarily there is a need to use extra capacity of a cluster when one cluster experiences capacity peaks. Customer would like ability to live migrate, quick migrate or move VMs from one cluster to other cluster for above mentioned needs. The goal is to provide more flexibility in VM mobility space without cluster as a boundary. Hyper-V needs to perform two operations in a transaction: - Live migrate VM from one cluster node to destination cluster node. - Live migrate VM’s storage from one cluster’s shared storage to another cluster’s shared storage. If any of the above fails, VM must continue to run on the source node. A user should be able to orchestrate live migration through Hyper-V manager, Failover cluster UI, WMI or Powershell. Live migration should perform necessary checks to ensure live migration requirements are met. Some of the examples in addition to other migration checks are, performing estimation of time to migrate VM, access to the VM storage and same IP network on destination to ensure VM will be able to migrate successfully without dropping a TCP connection. If Hyper-V cannot reliably guaranty retaining TCP connection live migration should fail and must ensure VM continues to run on source node. Administrator should be able to set cluster wide, Hyper-V wide or per VM policies around allowing or denying live migrating one or more VMs from one cluster to any particular cluster or any other cluster. User experience and workflow of orchestrating live migration within a cluster or across the cluster site should be the same. #+END_QUOTE * DONE Feature SWAGS CLOSED: [2009-12-09 Wed 08:57] CLOCK: [2009-12-09 Wed 08:46]--[2009-12-09 Wed 08:57] => 0:11 SCHEDULED: <2009-12-07 Mon> Using the one-page specs, the dev team estimated the dev time it would take to implement each feature identified to deliver on the business value propositions. The estimates are kept in this [[http://windows/hyper-v/w8/BVP/BVP%20Feature%20Expansion.xlsx][spreadsheet]]. The estimaes are fine-grained. To stretch an analogy, instead of t-shirt sizes, we've got estimates of the yards of thread required to make the t-shirt. For each feature we identified in the BVP process, the dev team estimated how to break apart the work and estimated the number of weeks of senior, mid-level, and junior dev time it would take to implement the feature. The key conclusion from the exercise: Our eyes are *way* bigger than our wallets. In the BVP process, we identified about five times as much work as we will be able to deliver in Windows 8. * DONE Moving From Pre-Planning to Planning CLOSED: [2009-12-09 Wed 15:20] CLOCK: [2009-12-09 Wed 09:56]--[2009-12-09 Wed 10:01] => 0:05 CLOCK: [2009-12-09 Wed 09:00]--[2009-12-09 Wed 09:01] => 0:01 Pre-planning identified a significant amount of work we /could/ do in Windows 8. Our challenge in planning has been to identify the 20% of the work on our list that best aligns with the overall Windows vision, so we can commit to this as work we /will/ do for Windows 8. The business value propositions we defined in pre-planning lined up well with planning themes & subthemes. As we moved from pre-planning to planning, we narrowed down the list of BVPs that we focused on, and we worked through the established theme & subtheme planning. Through the Windows planning process, we have been able to work with our partner teams to find alignment on priorities. The following table shows how we mapped our BVPs to planning themes for the planning process. | BVP | Planning Theme (Subtheme) | |--------------------------------------------------------------------------+----------------------------------------------------------------------------------------| | Resource-Smart Virtualization Infrastructure, Hosting, Cloud Integration | Infrastructure Scaled for SMB, Enterprise, & Service Providers (Hosted Private Clouds) | | Server High Availability | Continuous Availability (Contiuous Availability) | | Server Disaster Recovery | Continuous Availability (Business Continuity) | | Platform Extensibility | Big Bet: Scale for Datacenters | | Scale Up, Green IT | Infrastructure Scaled... (Leverage the Hardware Ecosystem) | | VDI | Work Anywhere (Centralized Desktops) | | Deployment | Management (Solution Deployment) | | Server test/dev, Client test/dev | Streamline the developer experience *or* Desktop for enthusiasts | | Appliance Development Model | Infrastructure Scaled... (Virtual Appliance for Partners) | * TODO Conclusion Because of our pre-planning work, we've had good alignment between COSD (and now Windows Core) and Windows Server on overall Hyper-V priorities and directions. The work on estimating feature costs has enabled us to set realistic expectations on the scope of work we can deliver in Windows 8. Taken together, our pre-planning work should have made Hyper-V a more predictable and transparent partner team to work with in the planning process. ruby-org-0.8.0/spec/data/remember.org000066400000000000000000000040361210571107600174420ustar00rootroot00000000000000* New Ideas ** YAML header in Webby Make sure you don't have TABS here. Best practice: Configure your editor to use spaces instaed of tabs, and if you can see whitespace, even better. In emacs, set indent-tabs-mode to NIL. ** Ruby Gems behind Proxy Set the following environment variable: So, I added a User Variable for my account called http_proxy with the value of http://:8080, rebooted, ran plan old vanillia gem install rails –include-dependencies, and magically, it worked ** Hyper-V technical info http://technet.microsoft.com/en-us/dd565807.aspx ** VirtualBox Virtualization software from Sun. Looks like it might be more for dev/test. I'm surprised this hasn't popped at all. http://www.virtualbox.org/. Backed by Sun. ** Interesting LaTeX article http://nitens.org/taraborelli/latex -- on the virtues of LaTeX ** XEmacs / Emacs internals Looks like an interesting resource if I want to learn how Emacs works. http://www.xemacs.org/Documentation/21.5/html/internals_9.html#SEC19 ** MikTeX Get it here: http://www.miktex.org/portable/ ** Orgmode publishing tutorial [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php][Publishing Org-mode files to HTML]] ** Git and Live Mesh This is really helpful: http://whereslou.com/2009/06/04/using-live-mesh-and-git-the-best-of-both-worlds ** VDI deployment stats Key takeaways: - 74% are using VDI in production or pilot ... but 45% of those using have less than 100 users - 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%) - No real surprises on the reasons / benefits etc - Interestingly ... even if TS supported all client apps / supported user-install apps - 100% of the DAC preferred VDI over TS - 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) ** Hyper-V Scheduler Information http://msdn.microsoft.com/en-us/library/bb969782.aspx ruby-org-0.8.0/spec/data/tables.org000066400000000000000000000001541210571107600171130ustar00rootroot00000000000000* a table with hline at the beginning |-----+-----| | foo | bar | |-----+-----| | 1 | 2 | * not a table ruby-org-0.8.0/spec/headline_spec.rb000066400000000000000000000034521210571107600173330ustar00rootroot00000000000000require 'spec_helper' describe Orgmode::Headline do it "should recognize headlines that start with asterisks" do Orgmode::Headline.headline?("*** test\n").should_not be_nil end it "should reject headlines without headlines at the start" do Orgmode::Headline.headline?(" nope!").should be_nil Orgmode::Headline.headline?(" tricked you!!!***").should be_nil end it "should reject improper initialization" do lambda { Orgmode::Headline.new " tricked**" }.should raise_error end it "should properly determine headline level" do samples = ["* one", "** two", "*** three", "**** four"] expected = 1 samples.each do |sample| h = Orgmode::Headline.new sample h.level.should eql(expected) expected += 1 end end it "should properly determine headline level with offset" do h = Orgmode::Headline.new("* one", nil, 1) h.level.should eql(2) end it "should find simple headline text" do h = Orgmode::Headline.new "*** sample" h.headline_text.should eql("sample") end it "should understand tags" do h = Orgmode::Headline.new "*** sample :tag:tag2:\n" h.headline_text.should eql("sample") h.should have(2).tags h.tags[0].should eql("tag") h.tags[1].should eql("tag2") end it "should understand a single tag" do h = Orgmode::Headline.new "*** sample :tag:\n" h.headline_text.should eql("sample") h.should have(1).tags h.tags[0].should eql("tag") end it "should understand keywords" do h = Orgmode::Headline.new "*** TODO Feed cat :home:" h.headline_text.should eql("Feed cat") h.keyword.should eql("TODO") end it "should recognize headlines marked as COMMENT" do h = Orgmode::Headline.new "* COMMENT This headline is a comment" h.comment_headline?.should_not be_nil end end ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/000077500000000000000000000000001210571107600235105ustar00rootroot00000000000000ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/advanced-code-coderay.html000066400000000000000000000237171210571107600305110ustar00rootroot00000000000000

advanced-code-coderay.org

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

1 Inline examples

This should work:

  fixed width? how does this work?   
                        ...........
                       ............
                                  .
                       .  .   .   .
                       .          ..
                       ....... .....
                           .  .
                           ....

Two ASCII blobs.

2 BEGIN_SRC

And this:

# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
def match_all(str)
  str.scan(@org_emphasis_regexp) do |match|
    yield $2, $3
  end
end

Now let’s test case-insensitive code blocks.

# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
def match_all(str)
  str.scan(@org_emphasis_regexp) do |match|
    yield $2, $3
  end
end
(def fib-seq
  (concat
   [0 1]
   ((fn rfib [a b]
        (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
 
user> (take 20 fib-seq)
(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)

Even if no language is set, it is still wrapped in code tags but class is empty.

echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers

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

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

{
:one => 1,
:two => 2
}
(defproject helloworld "0.1"
:dependencies [[org.clojure/clojure
                 "1.1.0-master-SNAPSHOT"]
              [org.clojure/clojure-contrib
                 "1.0-SNAPSHOT"]]
:main helloworld)

4 Code syntax highlight with Coderay

4.1 No language selected

Nothing to see here

4.2 CSS example

* {
 /* apply a natural box layout model to all elements */
 box-sizing: border-box; 
 -moz-box-sizing: border-box; 
 -webkit-box-sizing: border-box; 
}

4.3 HTML example

<html>
  <head>
    <title>Hello</title>
  </head>
  <body>
    <h1>Hello</h1>
  </body>
</html>

4.4 Ruby example

class Post << ActiveRecord::Base
  def print_title
    puts "#{self.title}"
  end
end

4.5 Python example

import mapnik

m = mapnik.Map(600, 800)
m.background = Map.Color('steelblue')

4.6 Javascript example

exports = this;

(function($){

var Posts = {};

Posts.index = function(){
// TODO
};

})(jQuery);

4.7 JSON example

{ name: "Waldemar"
, surname: "Quevedo"
}

4.8 PHP example

echo "Hello";
phpinfo();
var_dump(some_var);

4.9 Elisp example

(defun hello()
  (interactive)
  (message "hello"))

4.10 Not supported language example

!+!+++!++!++!++!+
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/advanced-code-coderay.org000066400000000000000000000075241210571107600303320ustar00rootroot00000000000000#+TITLE: advanced-code-coderay.org #+AUTHOR: Brian Dewey #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-30 Wed #+DESCRIPTION: More types of code support #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: Turns out there's more way to do code than just BEGIN_EXAMPLE. * Inline examples This should work: : fixed width? how does this work? : ........... : ............ : . : . . . . : . .. : ....... ..... : . . : .... Two ASCII blobs. * BEGIN_SRC :PROPERTIES: :ARCHIVE_TIME: 2009-12-26 Sat 22:16 :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org :ARCHIVE_OLPATH: <%= @page.title %>/Future Development :ARCHIVE_CATEGORY: orgmode_parser :ARCHIVE_TODO: DONE :END: And this: #+BEGIN_SRC ruby # Finds all emphasis matches in a string. # Supply a block that will get the marker and body as parameters. def match_all(str) str.scan(@org_emphasis_regexp) do |match| yield $2, $3 end end #+END_SRC Now let's test case-insensitive code blocks. #+begin_src ruby # Finds all emphasis matches in a string. # Supply a block that will get the marker and body as parameters. def match_all(str) str.scan(@org_emphasis_regexp) do |match| yield $2, $3 end end #+end_src #+begin_src clojure (def fib-seq (concat [0 1] ((fn rfib [a b] (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1))) user> (take 20 fib-seq) (0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181) #+end_src Even if no language is set, it is still wrapped in code tags but class is empty. #+BEGIN_SRC echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers #+END_SRC * It should be possible to write a colon at the beginning of an example #+BEGIN_QUOTE I really love to write about :symbols. They sure are the best things in the world! #+END_QUOTE #+BEGIN_SRC ruby { :one => 1, :two => 2 } #+END_SRC #+BEGIN_SRC clojure (defproject helloworld "0.1" :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"] [org.clojure/clojure-contrib "1.0-SNAPSHOT"]] :main helloworld) #+END_SRC * Code syntax highlight with Coderay ** No language selected #+BEGIN_SRC Nothing to see here #+END_SRC ** CSS example #+BEGIN_SRC css * { /* apply a natural box layout model to all elements */ box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } #+END_SRC ** HTML example #+BEGIN_SRC html Hello

Hello

#+END_SRC ** Ruby example #+BEGIN_SRC ruby class Post << ActiveRecord::Base def print_title puts "#{self.title}" end end #+END_SRC ** Python example #+BEGIN_SRC python import mapnik m = mapnik.Map(600, 800) m.background = Map.Color('steelblue') #+END_SRC ** Javascript example #+BEGIN_SRC javascript exports = this; (function($){ var Posts = {}; Posts.index = function(){ // TODO }; })(jQuery); #+END_SRC ** JSON example #+BEGIN_SRC json { name: "Waldemar" , surname: "Quevedo" } #+END_SRC ** PHP example #+BEGIN_SRC php echo "Hello"; phpinfo(); var_dump(some_var); #+END_SRC ** Elisp example #+BEGIN_SRC emacs-lisp (defun hello() (interactive) (message "hello")) #+END_SRC ** Not supported language example #+BEGIN_SRC notsupported !+!+++!++!++!++!+ #+END_SRC ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/advanced-code-no-color.html000066400000000000000000000042401210571107600306010ustar00rootroot00000000000000

advanced-code.org

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

1 Inline examples

This should work:

  fixed width? how does this work?   
                        ...........
                       ............
                                  .
                       .  .   .   .
                       .          ..
                       ....... .....
                           .  .
                           ....

Two ASCII blobs.

2 BEGIN_SRC

And this:

# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
def match_all(str)
  str.scan(@org_emphasis_regexp) do |match|
    yield $2, $3
  end
end

Now let’s test case-insensitive code blocks.

# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
def match_all(str)
  str.scan(@org_emphasis_regexp) do |match|
    yield $2, $3
  end
end
(def fib-seq
  (concat
   [0 1]
   ((fn rfib [a b]
        (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
 
user> (take 20 fib-seq)
(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)

Even if no language is set, it is still wrapped in code tags but class is empty.

echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers

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

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

{
:one => 1,
:two => 2
}
(defproject helloworld "0.1"
:dependencies [[org.clojure/clojure
                 "1.1.0-master-SNAPSHOT"]
              [org.clojure/clojure-contrib
                 "1.0-SNAPSHOT"]]
:main helloworld)
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/advanced-code-no-color.org000066400000000000000000000051731210571107600304320ustar00rootroot00000000000000#+TITLE: advanced-code.org #+AUTHOR: Brian Dewey #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-30 Wed #+DESCRIPTION: More types of code support #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: Turns out there's more way to do code than just BEGIN_EXAMPLE. * Inline examples This should work: : fixed width? how does this work? : ........... : ............ : . : . . . . : . .. : ....... ..... : . . : .... Two ASCII blobs. * BEGIN_SRC :PROPERTIES: :ARCHIVE_TIME: 2009-12-26 Sat 22:16 :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org :ARCHIVE_OLPATH: <%= @page.title %>/Future Development :ARCHIVE_CATEGORY: orgmode_parser :ARCHIVE_TODO: DONE :END: And this: #+BEGIN_SRC ruby # Finds all emphasis matches in a string. # Supply a block that will get the marker and body as parameters. def match_all(str) str.scan(@org_emphasis_regexp) do |match| yield $2, $3 end end #+END_SRC Now let's test case-insensitive code blocks. #+begin_src ruby # Finds all emphasis matches in a string. # Supply a block that will get the marker and body as parameters. def match_all(str) str.scan(@org_emphasis_regexp) do |match| yield $2, $3 end end #+end_src #+begin_src clojure (def fib-seq (concat [0 1] ((fn rfib [a b] (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1))) user> (take 20 fib-seq) (0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181) #+end_src Even if no language is set, it is still wrapped in code tags but class is empty. #+BEGIN_SRC echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers #+END_SRC * It should be possible to write a colon at the beginning of an example #+BEGIN_QUOTE I really love to write about :symbols. They sure are the best things in the world! #+END_QUOTE #+BEGIN_SRC ruby { :one => 1, :two => 2 } #+END_SRC #+BEGIN_SRC clojure (defproject helloworld "0.1" :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"] [org.clojure/clojure-contrib "1.0-SNAPSHOT"]] :main helloworld) #+END_SRC ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/advanced-code-pygments.html000066400000000000000000000245761210571107600307350ustar00rootroot00000000000000

advanced-code.org

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

1 Inline examples

This should work:

  fixed width? how does this work?   
                        ...........
                       ............
                                  .
                       .  .   .   .
                       .          ..
                       ....... .....
                           .  .
                           ....

Two ASCII blobs.

2 BEGIN_SRC

And this:

# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
def match_all(str)
  str.scan(@org_emphasis_regexp) do |match|
    yield $2, $3
  end
end

Now let’s test case-insensitive code blocks.

# Finds all emphasis matches in a string.
# Supply a block that will get the marker and body as parameters.
def match_all(str)
  str.scan(@org_emphasis_regexp) do |match|
    yield $2, $3
  end
end
(def fib-seq
  (concat
   [0 1]
   ((fn rfib [a b]
        (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
 
user> (take 20 fib-seq)
(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)

Even if no language is set, it is still wrapped in code tags but class is empty.

echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers

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

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

{
:one => 1,
:two => 2
}
(defproject helloworld "0.1"
:dependencies [[org.clojure/clojure
                 "1.1.0-master-SNAPSHOT"]
              [org.clojure/clojure-contrib
                 "1.0-SNAPSHOT"]]
:main helloworld)

4 Code syntax highlight with Pygments

4.1 No language selected

<script>alert('hello world')</script>

4.2 CSS example

* {
 /* apply a natural box layout model to all elements */
 box-sizing: border-box; 
 -moz-box-sizing: border-box; 
 -webkit-box-sizing: border-box; 
}

4.3 HTML example

<html>
  <head>
    <title>Hello</title>
  </head>
  <body>
    <h1>Hello</h1>
  </body>
</html>

4.4 Ruby example

class Post << ActiveRecord::Base
  def print_title
    puts "#{self.title}"
  end
end

4.5 Python example

import mapnik

m = mapnik.Map(600, 800)
m.background = Map.Color('steelblue')

4.6 Javascript example

exports = this;

(function($){

var Posts = {};

Posts.index = function(){
// TODO
};

})(jQuery);

4.7 JSON example

{ name: "Waldemar"
, surname: "Quevedo"
}

4.8 PHP example

echo "Hello";
phpinfo();
var_dump(some_var);

4.9 Elisp example

(defun hello()
  (interactive)
  (message "hello"))

4.10 Not supported language example

!+!+++!++!++!++!+
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/advanced-code-pygments.org000066400000000000000000000075471210571107600305570ustar00rootroot00000000000000#+TITLE: advanced-code.org #+AUTHOR: Brian Dewey #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-30 Wed #+DESCRIPTION: More types of code support #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: Turns out there's more way to do code than just BEGIN_EXAMPLE. * Inline examples This should work: : fixed width? how does this work? : ........... : ............ : . : . . . . : . .. : ....... ..... : . . : .... Two ASCII blobs. * BEGIN_SRC :PROPERTIES: :ARCHIVE_TIME: 2009-12-26 Sat 22:16 :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org :ARCHIVE_OLPATH: <%= @page.title %>/Future Development :ARCHIVE_CATEGORY: orgmode_parser :ARCHIVE_TODO: DONE :END: And this: #+BEGIN_SRC ruby # Finds all emphasis matches in a string. # Supply a block that will get the marker and body as parameters. def match_all(str) str.scan(@org_emphasis_regexp) do |match| yield $2, $3 end end #+END_SRC Now let's test case-insensitive code blocks. #+begin_src ruby # Finds all emphasis matches in a string. # Supply a block that will get the marker and body as parameters. def match_all(str) str.scan(@org_emphasis_regexp) do |match| yield $2, $3 end end #+end_src #+begin_src clojure (def fib-seq (concat [0 1] ((fn rfib [a b] (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1))) user> (take 20 fib-seq) (0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181) #+end_src Even if no language is set, it is still wrapped in code tags but class is empty. #+BEGIN_SRC echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers #+END_SRC * It should be possible to write a colon at the beginning of an example #+BEGIN_QUOTE I really love to write about :symbols. They sure are the best things in the world! #+END_QUOTE #+BEGIN_SRC ruby { :one => 1, :two => 2 } #+END_SRC #+BEGIN_SRC clojure (defproject helloworld "0.1" :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"] [org.clojure/clojure-contrib "1.0-SNAPSHOT"]] :main helloworld) #+END_SRC * Code syntax highlight with Pygments ** No language selected #+BEGIN_SRC #+END_SRC ** CSS example #+BEGIN_SRC css * { /* apply a natural box layout model to all elements */ box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } #+END_SRC ** HTML example #+BEGIN_SRC html Hello

Hello

#+END_SRC ** Ruby example #+BEGIN_SRC ruby class Post << ActiveRecord::Base def print_title puts "#{self.title}" end end #+END_SRC ** Python example #+BEGIN_SRC python import mapnik m = mapnik.Map(600, 800) m.background = Map.Color('steelblue') #+END_SRC ** Javascript example #+BEGIN_SRC javascript exports = this; (function($){ var Posts = {}; Posts.index = function(){ // TODO }; })(jQuery); #+END_SRC ** JSON example #+BEGIN_SRC json { name: "Waldemar" , surname: "Quevedo" } #+END_SRC ** PHP example #+BEGIN_SRC php echo "Hello"; phpinfo(); var_dump(some_var); #+END_SRC ** Elisp example #+BEGIN_SRC emacs-lisp (defun hello() (interactive) (message "hello")) #+END_SRC ** Not supported language example #+BEGIN_SRC notsupported !+!+++!++!++!++!+ #+END_SRC ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/code-coderay.html000066400000000000000000000016361210571107600267420ustar00rootroot00000000000000

Simple Code Syntax highlighting test

class Coderay
  class << self
    def colorize
      # Do colorizing stuff here
      heredoc = <<EOF
    Some text yay!!!
EOF
    end
  end
end
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/code-coderay.org000066400000000000000000000003301210571107600265530ustar00rootroot00000000000000* Simple Code Syntax highlighting test #+BEGIN_SRC ruby class Coderay class << self def colorize # Do colorizing stuff here heredoc = <Simple Code Syntax highlighting test
class Pygments
  class << self
    def colorize
      # Do colorizing stuff here
      heredoc = <<EOF
    Some text yay!!!
EOF
    end
  end
end

Now using EXAMPLE blocks instead:

def hello()
  puts "hello"
end

Small case should work as well:

class Hello
  def say
    puts "hola"
  end
end
class Piano
  def play_note(note)
  # TODO
  end
end
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/code-no-color.org000066400000000000000000000007741210571107600266710ustar00rootroot00000000000000* Simple Code Syntax highlighting test #+BEGIN_SRC ruby class Pygments class << self def colorize # Do colorizing stuff here heredoc = <Simple Code Syntax highlighting test
class Pygments
  class << self
    def colorize
      # Do colorizing stuff here
      heredoc = <<EOF
    Some text yay!!!
EOF
    end
  end
end

Now using EXAMPLE blocks instead:

def hello()
  puts "hello"
end

Small case should work as well:

class Hello
  def say
    puts "hola"
  end
end
class Piano
  def play_note(note)
  # TODO
  end
end
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/code-pygments.org000066400000000000000000000007751210571107600270100ustar00rootroot00000000000000* Simple Code Syntax highlighting test #+BEGIN_SRC ruby class Pygments class << self def colorize # Do colorizing stuff here heredoc = <begin src in lists should work
  • Foo
    class Hello
      def say
        puts 'cheers'
      end
    end
        
  • Bar
    puts "This should not get lumped into the above line Example"
        

    A paragraph should go here.

    • A sublist goes here with another example
      echo "Hello"
              

      And this is a paragraph

  • Hello
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/src-code-list-coderay.org000066400000000000000000000006761210571107600303260ustar00rootroot00000000000000* begin src in lists should work - Foo #+begin_src ruby class Hello def say puts 'cheers' end end #+end_src - Bar #+begin_src ruby puts "This should not get lumped into the above line Example" #+end_src A paragraph should go here. + A sublist goes here with another example #+begin_src sh echo "Hello" #+end_src And this is a paragraph - Hello ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/src-code-list-no-color.html000066400000000000000000000010111210571107600305650ustar00rootroot00000000000000

begin src in lists should work

  • Foo
    class Hello
      def say
        puts 'cheers'
      end
    end
        
  • Bar
    puts "This should not get lumped into the above line Example"
        

    A paragraph should go here.

    • A sublist goes here with another example
      echo "Hello"
              

      And this is a paragraph

  • Hello
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/src-code-list-no-color.org000066400000000000000000000006761210571107600304300ustar00rootroot00000000000000* begin src in lists should work - Foo #+begin_src ruby class Hello def say puts 'cheers' end end #+end_src - Bar #+begin_src ruby puts "This should not get lumped into the above line Example" #+end_src A paragraph should go here. + A sublist goes here with another example #+begin_src sh echo "Hello" #+end_src And this is a paragraph - Hello ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/src-code-list-pygments.html000066400000000000000000000014651210571107600307200ustar00rootroot00000000000000

begin src in lists should work

  • Foo
    class Hello
      def say
        puts 'cheers'
      end
    end
    
  • Bar
    puts "This should not get lumped into the above line Example"
    

    A paragraph should go here.

    • A sublist goes here with another example
      echo "Hello"
      

      And this is a paragraph

  • Hello
ruby-org-0.8.0/spec/html_code_syntax_highlight_examples/src-code-list-pygments.org000066400000000000000000000006761210571107600305460ustar00rootroot00000000000000* begin src in lists should work - Foo #+begin_src ruby class Hello def say puts 'cheers' end end #+end_src - Bar #+begin_src ruby puts "This should not get lumped into the above line Example" #+end_src A paragraph should go here. + A sublist goes here with another example #+begin_src sh echo "Hello" #+end_src And this is a paragraph - Hello ruby-org-0.8.0/spec/html_examples/000077500000000000000000000000001210571107600170615ustar00rootroot00000000000000ruby-org-0.8.0/spec/html_examples/advanced-lists.html000066400000000000000000000025511210571107600226530ustar00rootroot00000000000000

Advanced Lists

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

Nested lists

  • You can have nested lists
  • This is first-level
    • This is a nested item
    • This is another nested item
  • Back to the first level
  • Another first level item
    1. This is a numbered list nested within the unordered list
    2. This is another numbered item

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

Multi-paragraph list items

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

  • This is a list item
  • This list item has multiple paragraphs.

    This is paragraph two.

    And paragraph three.

  • Back to a list item.
    • Nested, just for grins!
    • woo hoo!

Hyphen, Plus and Asterisk can be used to create lists

  • One
    • uno
      • ichi
    • uno
  • Two
    • dos
      • ni
      • ni
  • Three
  • Four
ruby-org-0.8.0/spec/html_examples/advanced-lists.org000066400000000000000000000015671210571107600225040ustar00rootroot00000000000000Advanced Lists =org-ruby= supports the following list features of =org-mode=: * Nested lists - You can have nested lists - This is first-level - This is a nested item - This is another nested item - Back to the first level - Another first level item 1. This is a numbered list nested within the unordered list 2. This is another numbered item Note the list ends just some more text. Make sure both list blocks are closed. * Multi-paragraph list items This list will end with the end-of-file. Make sure all blocks are closed. - This is a list item - This list item has multiple paragraphs. This is paragraph two. And paragraph three. - Back to a list item. - Nested, just for grins! - woo hoo! * Hyphen, Plus and Asterisk can be used to create lists - One * uno + ichi * uno - Two + dos * ni * ni - Three - Four ruby-org-0.8.0/spec/html_examples/block_code.html000066400000000000000000000012551210571107600220360ustar00rootroot00000000000000

Block Code

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


    def initialize(output)
      @output = output
      @buffer = ""
      @output_type = :start
      @list_indent_stack = []
      @paragraph_modifier = nil

      @logger = Logger.new(STDERR)
      @logger.level = Logger::WARN
    end

And now I should be back to normal text.

Putting in another paragraph for good measure.

Code should also get cancelled by a list, thus:

This is my code!

Another line!
  • My list should cancel this.
  • Another list line.
ruby-org-0.8.0/spec/html_examples/block_code.org000066400000000000000000000011521210571107600216550ustar00rootroot00000000000000* Block Code I need to get block code examples working. In =orgmode=, they look like this: #+BEGIN_EXAMPLE def initialize(output) @output = output @buffer = "" @output_type = :start @list_indent_stack = [] @paragraph_modifier = nil @logger = Logger.new(STDERR) @logger.level = Logger::WARN end #+END_EXAMPLE And now I should be back to normal text. Putting in another paragraph for good measure. Code should also get cancelled by a list, thus: #+BEGIN_EXAMPLE This is my code! Another line! #+END_EXAMPLE - My list should cancel this. - Another list line. ruby-org-0.8.0/spec/html_examples/blockcomment.html000066400000000000000000000001401210571107600224170ustar00rootroot00000000000000

BLOCKCOMMENT

Testing that the next part is ignored

And now back to normal!

ruby-org-0.8.0/spec/html_examples/blockcomment.org000066400000000000000000000002361210571107600222500ustar00rootroot00000000000000BLOCKCOMMENT Testing that the next part is ignored #+BEGIN_COMMENT /Foo/ #+BEGIN_SRC c++ int main() { } #+END_SRC #+END_COMMENT And now back to normal! ruby-org-0.8.0/spec/html_examples/blockquote.html000066400000000000000000000003031210571107600221130ustar00rootroot00000000000000

BLOCKQUOTE

Testing that I can have block quotes:

Example:

This is blockquote text.

And now I’m back to normal text!

ruby-org-0.8.0/spec/html_examples/blockquote.org000066400000000000000000000002261210571107600217420ustar00rootroot00000000000000BLOCKQUOTE Testing that I can have block quotes: #+BEGIN_QUOTE /Example:/ This is blockquote text. #+END_QUOTE And now I'm back to normal text! ruby-org-0.8.0/spec/html_examples/center.html000066400000000000000000000001741210571107600212310ustar00rootroot00000000000000

Fou

not center

center

not center, again

ruby-org-0.8.0/spec/html_examples/center.org000066400000000000000000000001161210571107600210500ustar00rootroot00000000000000#+TITLE: Fou not center #+BEGIN_CENTER center #+END_CENTER not center, again ruby-org-0.8.0/spec/html_examples/code-block-lists.html000066400000000000000000000022501210571107600231040ustar00rootroot00000000000000

Code blocks in lists

No spaces in code block

- List starts
 + Block without indentation
   #+begin_example
puts "test"
   #+end_example
- List continues here
 + and finished here
  • List starts
    • Block without indentation
      puts "test"
              
  • List continues here
    • and finished here

Code block indented

- List starts
 + Block without indentation
   #+begin_example ruby
  puts "test"
   #+end_example
- List continues here
 + and finished here
  • List starts
    • Block without indentation
      puts "test"
              
  • List continues here
    • and finished here

Indentation level in example block

- Indentation of a begin_example code block
 #+begin_example
   (+ 3 5)
 #+end_example

  • Indentation of a begin_example code block
    (+ 3 5)
        
ruby-org-0.8.0/spec/html_examples/code-block-lists.org000066400000000000000000000015611210571107600227330ustar00rootroot00000000000000* Code blocks in lists ** No spaces in code block : - List starts : + Block without indentation : #+begin_example : puts "test" : #+end_example : - List continues here : + and finished here - List starts + Block without indentation #+begin_example puts "test" #+end_example - List continues here + and finished here ** Code block indented : - List starts : + Block without indentation : #+begin_example ruby : puts "test" : #+end_example : - List continues here : + and finished here - List starts + Block without indentation #+begin_example puts "test" #+end_example - List continues here + and finished here ** Indentation level in example block : - Indentation of a begin_example code block : #+begin_example : (+ 3 5) : #+end_example : - Indentation of a begin_example code block #+begin_example (+ 3 5) #+end_example ruby-org-0.8.0/spec/html_examples/code-comment.html000066400000000000000000000012101210571107600223130ustar00rootroot00000000000000

Code Comment

I need to be able to export things that look like org-mode comments inside of code blocks, like this:

#+TITLE:     orgmode_parser.org
#+AUTHOR:    
#+EMAIL:     brian@BRIAN-DESK
#+DATE:      2009-12-29 Tue
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
ruby-org-0.8.0/spec/html_examples/code-comment.org000066400000000000000000000011771210571107600221520ustar00rootroot00000000000000* Code Comment I need to be able to export things that look like org-mode comments inside of code blocks, like this: #+BEGIN_EXAMPLE #+TITLE: orgmode_parser.org #+AUTHOR: #+EMAIL: brian@BRIAN-DESK #+DATE: 2009-12-29 Tue #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: #+END_EXAMPLE ruby-org-0.8.0/spec/html_examples/code-lists.html000066400000000000000000000041301210571107600220130ustar00rootroot00000000000000

normal list should work

  • one text in the same line

    This is a paragraph

    • A sublist
      • Another sublist

        Sublist paragraph

    • 2nd sublist
      • 2nd sublist item

        Paragraph from 2nd sublist

  • two
    1. a new list

      paragraph

    2. another sublist
  • final list

paragraphs in lists should work

  • Foo
    • How does this work?

      uno dos tres

    • Should not this be a paragraph?
  • Bar

begin example in lists should work

  • Foo
    class Hello
      def say
        puts 'cheers'
      end
    end
        
  • Bar
    This gets lumped in to the above line "Example"
        
  • Hello

begin quote in lists should work

  • Example
    • Uno Lorem

      A quote!!!

      dolor

    • Dos

tables in lists should work

  • Example
    • Table

      This table:

      ab
      01
      12
  • After the table

    The table should be above

definition lists should work

  • Example
    Hello
    Hola Paragrap continues here

    Cuando me desperte, el dinosaurio estaba alli.

    Dog
    Perro Paragraph
    • Last sublist
  • Another list
    • with a sublist
ruby-org-0.8.0/spec/html_examples/code-lists.org000066400000000000000000000023231210571107600216400ustar00rootroot00000000000000* normal list should work - one text in the same line This is a paragraph + A sublist - Another sublist Sublist paragraph + 2nd sublist - 2nd sublist item Paragraph from 2nd sublist - two 1. a new list paragraph 2. another sublist - final list * paragraphs in lists should work - Foo + How does this work? uno dos tres + Should not this be a paragraph? - Bar * begin example in lists should work - Foo #+begin_example class Hello def say puts 'cheers' end end #+end_example - Bar #+begin_example This gets lumped in to the above line "Example" #+end_example - Hello * begin quote in lists should work - Example + Uno Lorem #+begin_quote A quote!!! #+end_quote dolor + Dos * tables in lists should work - Example + Table This table: | a | b | | 0 | 1 | | 1 | 2 | - After the table The table should be above * definition lists should work - Example + Hello :: Hola Paragrap continues here #+begin_quote Cuando me desperte, el dinosaurio estaba alli. #+end_quote + Dog :: Perro Paragraph + Last sublist - Another list + with a sublist ruby-org-0.8.0/spec/html_examples/comment-trees.html000066400000000000000000000002261210571107600225310ustar00rootroot00000000000000

This headline is in the output

This is in the output

Yet, this is in the output

and this is also part of the output

ruby-org-0.8.0/spec/html_examples/comment-trees.org000066400000000000000000000006001210571107600223500ustar00rootroot00000000000000* This headline is in the output * COMMENT Commented headline should not be in the output This should not be in the output either. ** This should not be in the output. *** Neither this **** nor this ** Not in the output * This is in the output ** COMMENT But this is not This is not in the output *** Neither is this ** Yet, this is in the output and this is also part of the output ruby-org-0.8.0/spec/html_examples/custom-seq-todo.html000066400000000000000000000020641210571107600230140ustar00rootroot00000000000000

custom-todo.org

I copied this todo sequence from Worg. It shows a lot of power of the built-in todo functionality. Now, let’s make sure all of these are recognized (and therefore NOT exported.)

TODO Sample

  • State “CANCELED” from “INPROGRESS” [2009-12-29 Tue 22:26] \ I gave up.
  • State “WAITING” from “” [2009-12-29 Tue 22:25] \ huh?

INPROGRESS this one’s in progress

WAITING who am I waiting on?

DONE Finished this one!

CANCELED I gave up here.

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

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

TODOX

don’t be fooled by the initial substring above!

ruby-org-0.8.0/spec/html_examples/custom-seq-todo.org000066400000000000000000000014731210571107600226420ustar00rootroot00000000000000#+TITLE: custom-todo.org #+DESCRIPTION: Makes sure I can handle custom todo entries #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) #+OPTIONS: todo:t I copied this todo sequence from Worg. It shows a lot of power of the built-in todo functionality. Now, let's make sure all of these are recognized (and therefore NOT exported.) * TODO Sample - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ I gave up. - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ huh? * INPROGRESS this one's in progress * WAITING who am I waiting on? * DONE Finished this one! * CANCELED I gave up here. * DONT be fooled by just a random word in all caps. * todo <== this word doesn't match because the case doesn't match. * TODOX don't be fooled by the initial substring above! ruby-org-0.8.0/spec/html_examples/custom-todo.html000066400000000000000000000020641210571107600222260ustar00rootroot00000000000000

custom-todo.org

I copied this todo sequence from Worg. It shows a lot of power of the built-in todo functionality. Now, let’s make sure all of these are recognized (and therefore NOT exported.)

TODO Sample

  • State “CANCELED” from “INPROGRESS” [2009-12-29 Tue 22:26] \ I gave up.
  • State “WAITING” from “” [2009-12-29 Tue 22:25] \ huh?

INPROGRESS this one’s in progress

WAITING who am I waiting on?

DONE Finished this one!

CANCELED I gave up here.

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

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

TODOX

don’t be fooled by the initial substring above!

ruby-org-0.8.0/spec/html_examples/custom-todo.org000066400000000000000000000014671210571107600220570ustar00rootroot00000000000000#+TITLE: custom-todo.org #+DESCRIPTION: Makes sure I can handle custom todo entries #+TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) #+OPTIONS: todo:t I copied this todo sequence from Worg. It shows a lot of power of the built-in todo functionality. Now, let's make sure all of these are recognized (and therefore NOT exported.) * TODO Sample - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ I gave up. - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ huh? * INPROGRESS this one's in progress * WAITING who am I waiting on? * DONE Finished this one! * CANCELED I gave up here. * DONT be fooled by just a random word in all caps. * todo <== this word doesn't match because the case doesn't match. * TODOX don't be fooled by the initial substring above! ruby-org-0.8.0/spec/html_examples/custom-typ-todo.html000066400000000000000000000020641210571107600230400ustar00rootroot00000000000000

custom-todo.org

I copied this todo sequence from Worg. It shows a lot of power of the built-in todo functionality. Now, let’s make sure all of these are recognized (and therefore NOT exported.)

TODO Sample

  • State “CANCELED” from “INPROGRESS” [2009-12-29 Tue 22:26] \ I gave up.
  • State “WAITING” from “” [2009-12-29 Tue 22:25] \ huh?

INPROGRESS this one’s in progress

WAITING who am I waiting on?

DONE Finished this one!

CANCELED I gave up here.

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

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

TODOX

don’t be fooled by the initial substring above!

ruby-org-0.8.0/spec/html_examples/custom-typ-todo.org000066400000000000000000000014731210571107600226660ustar00rootroot00000000000000#+TITLE: custom-todo.org #+DESCRIPTION: Makes sure I can handle custom todo entries #+TYP_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) #+OPTIONS: todo:t I copied this todo sequence from Worg. It shows a lot of power of the built-in todo functionality. Now, let's make sure all of these are recognized (and therefore NOT exported.) * TODO Sample - State "CANCELED" from "INPROGRESS" [2009-12-29 Tue 22:26] \\ I gave up. - State "WAITING" from "" [2009-12-29 Tue 22:25] \\ huh? * INPROGRESS this one's in progress * WAITING who am I waiting on? * DONE Finished this one! * CANCELED I gave up here. * DONT be fooled by just a random word in all caps. * todo <== this word doesn't match because the case doesn't match. * TODOX don't be fooled by the initial substring above! ruby-org-0.8.0/spec/html_examples/deflist.html000066400000000000000000000043121210571107600214010ustar00rootroot00000000000000

Hallo

a
hello
b
world

Text

Asterisk can be used for lists

One
The first number.
Two
The second number.
Three
The second number.

Corner cases of definition lists

The following examples show how org-ruby behave when handling some cases of definition lists. (Many thanks to vonavi for his contributions here)

Definition List Items

  • Regular list
    Key
    Value (k1)
    Key
    Value (k2)
    Key
    Value (k3)
  • Semicolon as part of key
    K::e::y
    Value (k1)
    K::e::y
    Value (k2)
  • Paragraph break after key
    Key
    Value (k1)
    Key
    Value (k2)
  • Many semicolons in same line
    Key :: Value
    Still value (k1)
    Key :: Value
    Still value (k2)
  • Semicolon placement cases
    • Case 1
      Key ::MoreKey
      Value (k1)
    • Case 2
      Key:: MoreKey
      Value (k2)
    • Case 3
      :: Key
      Value (k3)

Not Definition List Items

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

  • Key:: Value (n1)
  • Key ::Value (n2)
  • Key::Value (n3)
  • Key:: Value (n4)
  • Key :: Value (n5)

Definition List Item without Definition

??? will be shown in this case

  • Example list
    Key :: Value
    Still value (k1) Paragraph :: with :: no value
    Key :: Value :: Still value (k1)
    Paragraph :: with :: no value ::
    ???
    Paragraph :: with :: no value
ruby-org-0.8.0/spec/html_examples/deflist.org000066400000000000000000000025641210571107600212330ustar00rootroot00000000000000#+TITLE: Hallo - a :: hello - b :: world Text * Asterisk can be used for lists * One :: The first number. * Two :: The second number. * Three :: The second number. * Corner cases of definition lists The following examples show how org-ruby behave when handling some cases of definition lists. (Many thanks to [[https://github.com/vonavi][vonavi]] for his contributions here) ** Definition List Items - Regular list + Key :: Value (k1) + Key :: Value (k2) + Key :: Value (k3) - Semicolon as part of key - K::e::y :: Value (k1) - K::e::y :: Value (k2) - Paragraph break after key + Key :: Value (k1) + Key :: Value (k2) - Many semicolons in same line + Key :: Value :: Still value (k1) + Key :: Value :: Still value (k2) - Semicolon placement cases + Case 1 * Key ::MoreKey :: Value (k1) + Case 2 * Key:: MoreKey :: Value (k2) + Case 3 * :: Key :: Value (k3) ** Not Definition List Items The following cases will not be considered as definition lists but just regular lists. - Key:: Value (n1) - Key ::Value (n2) - Key::Value (n3) - Key:: Value (n4) - Key :: Value (n5) ** Definition List Item without Definition ??? will be shown in this case - Example list + Key :: Value :: Still value (k1) Paragraph :: with :: no value + Key :: Value :: Still value (k1) :: Paragraph :: with :: no value :: + :: Paragraph :: with :: no value ruby-org-0.8.0/spec/html_examples/emphasis.html000066400000000000000000001463451210571107600215750ustar00rootroot00000000000000

Inline Formatting test for emphasis

Simple feature test

bold

italic

code

verbatim

underline

strikethrough

http://www.bing.com

http://www.google.com

http://www.gmail.com

helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com

All together in one line

bold italic code verbatim underline strikethrough http://www.bing.com http://www.google.com http://www.gmail.com helpful text link http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://imgs.xkcd.com/comics/t_cells.png http://www.google.com

Within code test

emphasis_tests = [
"*bold*",
"/italic/",
"=code=",
"~verbatim~",
"_underline_ ",
"+strikethrough+",
"[[http://www.bing.com]]",
"[[http://www.google.com]]",
"[[http://www.xkcd.com][helpful text link]]",
"[[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]]",
"[[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]]",
"<http://www.google.com>",
]

all = emphasis_tests.map do |a|
  emphasis_tests.map do |b|
    [b, ' ', a, ' ', b, "\n\n"].join('')
  end
end

all.each {|e| puts e}

Mixed together test

emphasis_tests = ["*","/","=","~","_","+"]

all = emphasis_tests.map do |a|
  emphasis_tests.map do |b|
    [[a, 'Answer: ', b, '42', b, ' ',a, "\n\n"].join(''),
     [a, 'Answer: ', b, '42', b, '',a, "\n\n"].join('')].flatten
  end
end

all.each {|e| puts e}

Answer: *42 *

Answer: *42*

*Answer: 42 *

Answer: /42/

*Answer: 42 *

Answer: =42=

*Answer: 42 *

Answer: ~42~

*Answer: 42 *

Answer: _42_

*Answer: 42 *

Answer: +42+

/Answer: 42 /

Answer: *42*

Answer: /42 /

Answer: /42/

/Answer: 42 /

Answer: =42=

/Answer: 42 /

Answer: ~42~

/Answer: 42 /

Answer: _42_

/Answer: 42 /

Answer: +42+

=Answer: 42 =

Answer: *42*

=Answer: 42 =

Answer: /42/

Answer: =42 =

Answer: =42=

=Answer: 42 =

Answer: ~42~

=Answer: 42 =

Answer: _42_

=Answer: 42 =

Answer: +42+

~Answer: 42 ~

Answer: *42*

~Answer: 42 ~

Answer: /42/

~Answer: 42 ~

Answer: =42=

Answer: ~42 ~

Answer: ~42~

~Answer: 42 ~

Answer: _42_

~Answer: 42 ~

Answer: +42+

_Answer: 42 _

Answer: *42*

_Answer: 42 _

Answer: /42/

_Answer: 42 _

Answer: =42=

_Answer: 42 _

Answer: ~42~

Answer: _42 _

Answer: _42_

_Answer: 42 _

Answer: +42+

+Answer: 42 +

Answer: *42*

+Answer: 42 +

Answer: /42/

+Answer: 42 +

Answer: =42=

+Answer: 42 +

Answer: ~42~

+Answer: 42 +

Answer: _42_

Answer: +42 +

Answer: +42+

Multiline support test :: one line

emphasis_tests = ["*","/","=","~","_","+"]

all = emphasis_tests.map do |a|
  emphasis_tests.map do |b|
    [a, 'Starting the line here ', "\n", b, 'and continuing here to close', b, a, "\n\n"].join('')
  end
end

all.each {|e| puts e}

Starting the line here *and continuing here to close*

Starting the line here /and continuing here to close/

Starting the line here =and continuing here to close=

Starting the line here ~and continuing here to close~

Starting the line here _and continuing here to close_

Starting the line here +and continuing here to close+

Starting the line here *and continuing here to close*

Starting the line here /and continuing here to close/

Starting the line here =and continuing here to close=

Starting the line here ~and continuing here to close~

Starting the line here _and continuing here to close_

Starting the line here +and continuing here to close+

Starting the line here *and continuing here to close*

Starting the line here /and continuing here to close/

Starting the line here =and continuing here to close=

Starting the line here ~and continuing here to close~

Starting the line here _and continuing here to close_

Starting the line here +and continuing here to close+

Starting the line here *and continuing here to close*

Starting the line here /and continuing here to close/

Starting the line here =and continuing here to close=

Starting the line here ~and continuing here to close~

Starting the line here _and continuing here to close_

Starting the line here +and continuing here to close+

Starting the line here *and continuing here to close*

Starting the line here /and continuing here to close/

Starting the line here =and continuing here to close=

Starting the line here ~and continuing here to close~

Starting the line here _and continuing here to close_

Starting the line here +and continuing here to close+

Starting the line here *and continuing here to close*

Starting the line here /and continuing here to close/

Starting the line here =and continuing here to close=

Starting the line here ~and continuing here to close~

Starting the line here _and continuing here to close_

Starting the line here +and continuing here to close+

Multiline support test :: two lines

emphasis_tests = ["*","/","=","~","_","+"]

all = emphasis_tests.map do |a|
  emphasis_tests.map do |b|
    [a, 'Starting the line here ', "\n", b, 'and continuing here', "\n", 'to close', b, a, "\n\n"].join('')
  end
end

all.each {|e| puts e}

*Starting the line here and continuing here to close*

*Starting the line here /and continuing here to close/*

*Starting the line here =and continuing here to close=*

*Starting the line here ~and continuing here to close~*

*Starting the line here _and continuing here to close_*

*Starting the line here +and continuing here to close+*

/Starting the line here *and continuing here to close*/

/Starting the line here and continuing here to close/

/Starting the line here =and continuing here to close=/

/Starting the line here ~and continuing here to close~/

/Starting the line here _and continuing here to close_/

/Starting the line here +and continuing here to close+/

=Starting the line here *and continuing here to close*=

=Starting the line here /and continuing here to close/=

=Starting the line here and continuing here to close=

=Starting the line here ~and continuing here to close~=

=Starting the line here _and continuing here to close_=

=Starting the line here +and continuing here to close+=

~Starting the line here *and continuing here to close*~

~Starting the line here /and continuing here to close/~

~Starting the line here =and continuing here to close=~

~Starting the line here and continuing here to close~

~Starting the line here _and continuing here to close_~

~Starting the line here +and continuing here to close+~

_Starting the line here *and continuing here to close*_

_Starting the line here /and continuing here to close/_

_Starting the line here =and continuing here to close=_

_Starting the line here ~and continuing here to close~_

_Starting the line here and continuing here to close_

_Starting the line here +and continuing here to close+_

+Starting the line here *and continuing here to close*+

+Starting the line here /and continuing here to close/+

+Starting the line here =and continuing here to close=+

+Starting the line here ~and continuing here to close~+

+Starting the line here _and continuing here to close_+

+Starting the line here and continuing here to close+

Together in same paragraph test

bold bold bold

italic bold italic

code bold code

verbatim bold verbatim

underline bold underline

strikethrough bold strikethrough

http://www.bing.com bold http://www.bing.com

http://www.google.com bold http://www.google.com

helpful text link bold helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg bold http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png bold http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com bold http://www.google.com

bold italic bold

italic italic italic

code italic code

verbatim italic verbatim

underline italic underline

strikethrough italic strikethrough

http://www.bing.com italic http://www.bing.com

http://www.google.com italic http://www.google.com

helpful text link italic helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg italic http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png italic http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com italic http://www.google.com

bold code bold

italic code italic

code code code

verbatim code verbatim

underline code underline

strikethrough code strikethrough

http://www.bing.com code http://www.bing.com

http://www.google.com code http://www.google.com

helpful text link code helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg code http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png code http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com code http://www.google.com

bold verbatim bold

italic verbatim italic

code verbatim code

verbatim verbatim verbatim

underline verbatim underline

strikethrough verbatim strikethrough

http://www.bing.com verbatim http://www.bing.com

http://www.google.com verbatim http://www.google.com

helpful text link verbatim helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg verbatim http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png verbatim http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com verbatim http://www.google.com

bold underline bold

italic underline italic

code underline code

verbatim underline verbatim

underline underline underline

strikethrough underline strikethrough

http://www.bing.com underline http://www.bing.com

http://www.google.com underline http://www.google.com

helpful text link underline helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg underline http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png underline http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com underline http://www.google.com

bold strikethrough bold

italic strikethrough italic

code strikethrough code

verbatim strikethrough verbatim

underline strikethrough underline

strikethrough strikethrough strikethrough

http://www.bing.com strikethrough http://www.bing.com

http://www.google.com strikethrough http://www.google.com

helpful text link strikethrough helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg strikethrough http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png strikethrough http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com strikethrough http://www.google.com

bold http://www.bing.com bold

italic http://www.bing.com italic

code http://www.bing.com code

verbatim http://www.bing.com verbatim

underline http://www.bing.com underline

strikethrough http://www.bing.com strikethrough

http://www.bing.com http://www.bing.com http://www.bing.com

http://www.google.com http://www.bing.com http://www.google.com

helpful text link http://www.bing.com helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.bing.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png http://www.bing.com http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com http://www.bing.com http://www.google.com

bold http://www.google.com bold

italic http://www.google.com italic

code http://www.google.com code

verbatim http://www.google.com verbatim

underline http://www.google.com underline

strikethrough http://www.google.com strikethrough

http://www.bing.com http://www.google.com http://www.bing.com

http://www.google.com http://www.google.com http://www.google.com

helpful text link http://www.google.com helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.google.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png http://www.google.com http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com http://www.google.com http://www.google.com

bold helpful text link bold

italic helpful text link italic

code helpful text link code

verbatim helpful text link verbatim

underline helpful text link underline

strikethrough helpful text link strikethrough

http://www.bing.com helpful text link http://www.bing.com

http://www.google.com helpful text link http://www.google.com

helpful text link helpful text link helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg helpful text link http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png helpful text link http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com helpful text link http://www.google.com

bold http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg bold

italic http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg italic

code http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg code

verbatim http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg verbatim

underline http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg underline

strikethrough http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg strikethrough

http://www.bing.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.bing.com

http://www.google.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.google.com

helpful text link http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.google.com

bold http://imgs.xkcd.com/comics/t_cells.png bold

italic http://imgs.xkcd.com/comics/t_cells.png italic

code http://imgs.xkcd.com/comics/t_cells.png code

verbatim http://imgs.xkcd.com/comics/t_cells.png verbatim

underline http://imgs.xkcd.com/comics/t_cells.png underline

strikethrough http://imgs.xkcd.com/comics/t_cells.png strikethrough

http://www.bing.com http://imgs.xkcd.com/comics/t_cells.png http://www.bing.com

http://www.google.com http://imgs.xkcd.com/comics/t_cells.png http://www.google.com

helpful text link http://imgs.xkcd.com/comics/t_cells.png helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://imgs.xkcd.com/comics/t_cells.png http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png http://imgs.xkcd.com/comics/t_cells.png http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com http://imgs.xkcd.com/comics/t_cells.png http://www.google.com

bold http://www.google.com bold

italic http://www.google.com italic

code http://www.google.com code

verbatim http://www.google.com verbatim

underline http://www.google.com underline

strikethrough http://www.google.com strikethrough

http://www.bing.com http://www.google.com http://www.bing.com

http://www.google.com http://www.google.com http://www.google.com

helpful text link http://www.google.com helpful text link

http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.google.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

http://imgs.xkcd.com/comics/t_cells.png http://www.google.com http://imgs.xkcd.com/comics/t_cells.png

http://www.google.com http://www.google.com http://www.google.com

Together within a table

bold bolditalic boldcode boldverbatim boldunderline boldstrikethrough boldhttp://www.bing.com boldhttp://www.google.com boldhelpful text link boldhttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg boldhttp://imgs.xkcd.com/comics/t_cells.png boldhttp://www.google.com bold
bold italicitalic italiccode italicverbatim italicunderline italicstrikethrough italichttp://www.bing.com italichttp://www.google.com italichelpful text link italichttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg italichttp://imgs.xkcd.com/comics/t_cells.png italichttp://www.google.com italic
bold codeitalic codecode codeverbatim codeunderline codestrikethrough codehttp://www.bing.com codehttp://www.google.com codehelpful text link codehttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg codehttp://imgs.xkcd.com/comics/t_cells.png codehttp://www.google.com code
bold verbatimitalic verbatimcode verbatimverbatim verbatimunderline verbatimstrikethrough verbatimhttp://www.bing.com verbatimhttp://www.google.com verbatimhelpful text link verbatimhttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg verbatimhttp://imgs.xkcd.com/comics/t_cells.png verbatimhttp://www.google.com verbatim
bold underlineitalic underlinecode underlineverbatim underlineunderline underlinestrikethrough underlinehttp://www.bing.com underlinehttp://www.google.com underlinehelpful text link underlinehttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg underlinehttp://imgs.xkcd.com/comics/t_cells.png underlinehttp://www.google.com underline
bold strikethroughitalic strikethroughcode strikethroughverbatim strikethroughunderline strikethroughstrikethrough strikethroughhttp://www.bing.com strikethroughhttp://www.google.com strikethroughhelpful text link strikethroughhttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg strikethroughhttp://imgs.xkcd.com/comics/t_cells.png strikethroughhttp://www.google.com strikethrough
bold http://www.bing.comitalic http://www.bing.comcode http://www.bing.comverbatim http://www.bing.comunderline http://www.bing.comstrikethrough http://www.bing.comhttp://www.bing.com http://www.bing.comhttp://www.google.com http://www.bing.comhelpful text link http://www.bing.comhttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.bing.comhttp://imgs.xkcd.com/comics/t_cells.png http://www.bing.comhttp://www.google.com http://www.bing.com
bold http://www.google.comitalic http://www.google.comcode http://www.google.comverbatim http://www.google.comunderline http://www.google.comstrikethrough http://www.google.comhttp://www.bing.com http://www.google.comhttp://www.google.com http://www.google.comhelpful text link http://www.google.comhttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.google.comhttp://imgs.xkcd.com/comics/t_cells.png http://www.google.comhttp://www.google.com http://www.google.com
bold helpful text linkitalic helpful text linkcode helpful text linkverbatim helpful text linkunderline helpful text linkstrikethrough helpful text linkhttp://www.bing.com helpful text linkhttp://www.google.com helpful text linkhelpful text link helpful text linkhttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg helpful text linkhttp://imgs.xkcd.com/comics/t_cells.png helpful text linkhttp://www.google.com helpful text link
bold http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpgitalic http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpgcode http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpgverbatim http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpgunderline http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpgstrikethrough http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpghttp://www.bing.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpghttp://www.google.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpghelpful text link http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpghttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpghttp://imgs.xkcd.com/comics/t_cells.png http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpghttp://www.google.com http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg
bold http://imgs.xkcd.com/comics/t_cells.pngitalic http://imgs.xkcd.com/comics/t_cells.pngcode http://imgs.xkcd.com/comics/t_cells.pngverbatim http://imgs.xkcd.com/comics/t_cells.pngunderline http://imgs.xkcd.com/comics/t_cells.pngstrikethrough http://imgs.xkcd.com/comics/t_cells.pnghttp://www.bing.com http://imgs.xkcd.com/comics/t_cells.pnghttp://www.google.com http://imgs.xkcd.com/comics/t_cells.pnghelpful text link http://imgs.xkcd.com/comics/t_cells.pnghttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://imgs.xkcd.com/comics/t_cells.pnghttp://imgs.xkcd.com/comics/t_cells.png http://imgs.xkcd.com/comics/t_cells.pnghttp://www.google.com http://imgs.xkcd.com/comics/t_cells.png
bold http://www.google.comitalic http://www.google.comcode http://www.google.comverbatim http://www.google.comunderline http://www.google.comstrikethrough http://www.google.comhttp://www.bing.com http://www.google.comhttp://www.google.com http://www.google.comhelpful text link http://www.google.comhttp://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg http://www.google.comhttp://imgs.xkcd.com/comics/t_cells.png http://www.google.comhttp://www.google.com http://www.google.com
ruby-org-0.8.0/spec/html_examples/emphasis.org000066400000000000000000000777521210571107600214250ustar00rootroot00000000000000* Inline Formatting test for emphasis ** Simple feature test *bold* /italic/ =code= ~verbatim~ _underline_ +strikethrough+ [[http://www.bing.com]] [[http://www.google.com]] http://www.gmail.com [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] ** All together in one line *bold* /italic/ =code= ~verbatim~ _underline_ +strikethrough+ [[http://www.bing.com]] [[http://www.google.com]] http://www.gmail.com [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] ** Within code test #+begin_example emphasis_tests = [ "*bold*", "/italic/", "=code=", "~verbatim~", "_underline_ ", "+strikethrough+", "[[http://www.bing.com]]", "[[http://www.google.com]]", "[[http://www.xkcd.com][helpful text link]]", "[[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]]", "[[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]]", "", ] all = emphasis_tests.map do |a| emphasis_tests.map do |b| [b, ' ', a, ' ', b, "\n\n"].join('') end end all.each {|e| puts e} #+end_example ** Mixed together test #+begin_example emphasis_tests = ["*","/","=","~","_","+"] all = emphasis_tests.map do |a| emphasis_tests.map do |b| [[a, 'Answer: ', b, '42', b, ' ',a, "\n\n"].join(''), [a, 'Answer: ', b, '42', b, '',a, "\n\n"].join('')].flatten end end all.each {|e| puts e} #+end_example *Answer: *42* * *Answer: *42** *Answer: /42/ * *Answer: /42/* *Answer: =42= * *Answer: =42=* *Answer: ~42~ * *Answer: ~42~* *Answer: _42_ * *Answer: _42_* *Answer: +42+ * *Answer: +42+* /Answer: *42* / /Answer: *42*/ /Answer: /42/ / /Answer: /42// /Answer: =42= / /Answer: =42=/ /Answer: ~42~ / /Answer: ~42~/ /Answer: _42_ / /Answer: _42_/ /Answer: +42+ / /Answer: +42+/ =Answer: *42* = =Answer: *42*= =Answer: /42/ = =Answer: /42/= =Answer: =42= = =Answer: =42== =Answer: ~42~ = =Answer: ~42~= =Answer: _42_ = =Answer: _42_= =Answer: +42+ = =Answer: +42+= ~Answer: *42* ~ ~Answer: *42*~ ~Answer: /42/ ~ ~Answer: /42/~ ~Answer: =42= ~ ~Answer: =42=~ ~Answer: ~42~ ~ ~Answer: ~42~~ ~Answer: _42_ ~ ~Answer: _42_~ ~Answer: +42+ ~ ~Answer: +42+~ _Answer: *42* _ _Answer: *42*_ _Answer: /42/ _ _Answer: /42/_ _Answer: =42= _ _Answer: =42=_ _Answer: ~42~ _ _Answer: ~42~_ _Answer: _42_ _ _Answer: _42__ _Answer: +42+ _ _Answer: +42+_ +Answer: *42* + +Answer: *42*+ +Answer: /42/ + +Answer: /42/+ +Answer: =42= + +Answer: =42=+ +Answer: ~42~ + +Answer: ~42~+ +Answer: _42_ + +Answer: _42_+ +Answer: +42+ + +Answer: +42++ ** Multiline support test :: one line #+begin_example emphasis_tests = ["*","/","=","~","_","+"] all = emphasis_tests.map do |a| emphasis_tests.map do |b| [a, 'Starting the line here ', "\n", b, 'and continuing here to close', b, a, "\n\n"].join('') end end all.each {|e| puts e} #+end_example *Starting the line here *and continuing here to close** *Starting the line here /and continuing here to close/* *Starting the line here =and continuing here to close=* *Starting the line here ~and continuing here to close~* *Starting the line here _and continuing here to close_* *Starting the line here +and continuing here to close+* /Starting the line here *and continuing here to close*/ /Starting the line here /and continuing here to close// /Starting the line here =and continuing here to close=/ /Starting the line here ~and continuing here to close~/ /Starting the line here _and continuing here to close_/ /Starting the line here +and continuing here to close+/ =Starting the line here *and continuing here to close*= =Starting the line here /and continuing here to close/= =Starting the line here =and continuing here to close== =Starting the line here ~and continuing here to close~= =Starting the line here _and continuing here to close_= =Starting the line here +and continuing here to close+= ~Starting the line here *and continuing here to close*~ ~Starting the line here /and continuing here to close/~ ~Starting the line here =and continuing here to close=~ ~Starting the line here ~and continuing here to close~~ ~Starting the line here _and continuing here to close_~ ~Starting the line here +and continuing here to close+~ _Starting the line here *and continuing here to close*_ _Starting the line here /and continuing here to close/_ _Starting the line here =and continuing here to close=_ _Starting the line here ~and continuing here to close~_ _Starting the line here _and continuing here to close__ _Starting the line here +and continuing here to close+_ +Starting the line here *and continuing here to close*+ +Starting the line here /and continuing here to close/+ +Starting the line here =and continuing here to close=+ +Starting the line here ~and continuing here to close~+ +Starting the line here _and continuing here to close_+ +Starting the line here +and continuing here to close++ ** Multiline support test :: two lines #+begin_example emphasis_tests = ["*","/","=","~","_","+"] all = emphasis_tests.map do |a| emphasis_tests.map do |b| [a, 'Starting the line here ', "\n", b, 'and continuing here', "\n", 'to close', b, a, "\n\n"].join('') end end all.each {|e| puts e} #+end_example *Starting the line here *and continuing here to close** *Starting the line here /and continuing here to close/* *Starting the line here =and continuing here to close=* *Starting the line here ~and continuing here to close~* *Starting the line here _and continuing here to close_* *Starting the line here +and continuing here to close+* /Starting the line here *and continuing here to close*/ /Starting the line here /and continuing here to close// /Starting the line here =and continuing here to close=/ /Starting the line here ~and continuing here to close~/ /Starting the line here _and continuing here to close_/ /Starting the line here +and continuing here to close+/ =Starting the line here *and continuing here to close*= =Starting the line here /and continuing here to close/= =Starting the line here =and continuing here to close== =Starting the line here ~and continuing here to close~= =Starting the line here _and continuing here to close_= =Starting the line here +and continuing here to close+= ~Starting the line here *and continuing here to close*~ ~Starting the line here /and continuing here to close/~ ~Starting the line here =and continuing here to close=~ ~Starting the line here ~and continuing here to close~~ ~Starting the line here _and continuing here to close_~ ~Starting the line here +and continuing here to close+~ _Starting the line here *and continuing here to close*_ _Starting the line here /and continuing here to close/_ _Starting the line here =and continuing here to close=_ _Starting the line here ~and continuing here to close~_ _Starting the line here _and continuing here to close__ _Starting the line here +and continuing here to close+_ +Starting the line here *and continuing here to close*+ +Starting the line here /and continuing here to close/+ +Starting the line here =and continuing here to close=+ +Starting the line here ~and continuing here to close~+ +Starting the line here _and continuing here to close_+ +Starting the line here +and continuing here to close++ ** Together in same paragraph test *bold* *bold* *bold* /italic/ *bold* /italic/ =code= *bold* =code= ~verbatim~ *bold* ~verbatim~ _underline_ *bold* _underline_ +strikethrough+ *bold* +strikethrough+ [[http://www.bing.com]] *bold* [[http://www.bing.com]] [[http://www.google.com]] *bold* [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] *bold* [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] *bold* [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] *bold* [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] *bold* *bold* /italic/ *bold* /italic/ /italic/ /italic/ =code= /italic/ =code= ~verbatim~ /italic/ ~verbatim~ _underline_ /italic/ _underline_ +strikethrough+ /italic/ +strikethrough+ [[http://www.bing.com]] /italic/ [[http://www.bing.com]] [[http://www.google.com]] /italic/ [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] /italic/ [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] /italic/ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] /italic/ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] /italic/ *bold* =code= *bold* /italic/ =code= /italic/ =code= =code= =code= ~verbatim~ =code= ~verbatim~ _underline_ =code= _underline_ +strikethrough+ =code= +strikethrough+ [[http://www.bing.com]] =code= [[http://www.bing.com]] [[http://www.google.com]] =code= [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] =code= [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] =code= [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] =code= [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] =code= *bold* ~verbatim~ *bold* /italic/ ~verbatim~ /italic/ =code= ~verbatim~ =code= ~verbatim~ ~verbatim~ ~verbatim~ _underline_ ~verbatim~ _underline_ +strikethrough+ ~verbatim~ +strikethrough+ [[http://www.bing.com]] ~verbatim~ [[http://www.bing.com]] [[http://www.google.com]] ~verbatim~ [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] ~verbatim~ [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] ~verbatim~ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] ~verbatim~ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] ~verbatim~ *bold* _underline_ *bold* /italic/ _underline_ /italic/ =code= _underline_ =code= ~verbatim~ _underline_ ~verbatim~ _underline_ _underline_ _underline_ +strikethrough+ _underline_ +strikethrough+ [[http://www.bing.com]] _underline_ [[http://www.bing.com]] [[http://www.google.com]] _underline_ [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] _underline_ [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] _underline_ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] _underline_ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] _underline_ *bold* +strikethrough+ *bold* /italic/ +strikethrough+ /italic/ =code= +strikethrough+ =code= ~verbatim~ +strikethrough+ ~verbatim~ _underline_ +strikethrough+ _underline_ +strikethrough+ +strikethrough+ +strikethrough+ [[http://www.bing.com]] +strikethrough+ [[http://www.bing.com]] [[http://www.google.com]] +strikethrough+ [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] +strikethrough+ [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] +strikethrough+ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] +strikethrough+ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] +strikethrough+ *bold* [[http://www.bing.com]] *bold* /italic/ [[http://www.bing.com]] /italic/ =code= [[http://www.bing.com]] =code= ~verbatim~ [[http://www.bing.com]] ~verbatim~ _underline_ [[http://www.bing.com]] _underline_ +strikethrough+ [[http://www.bing.com]] +strikethrough+ [[http://www.bing.com]] [[http://www.bing.com]] [[http://www.bing.com]] [[http://www.google.com]] [[http://www.bing.com]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://www.bing.com]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.bing.com]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.bing.com]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.bing.com]] *bold* [[http://www.google.com]] *bold* /italic/ [[http://www.google.com]] /italic/ =code= [[http://www.google.com]] =code= ~verbatim~ [[http://www.google.com]] ~verbatim~ _underline_ [[http://www.google.com]] _underline_ +strikethrough+ [[http://www.google.com]] +strikethrough+ [[http://www.bing.com]] [[http://www.google.com]] [[http://www.bing.com]] [[http://www.google.com]] [[http://www.google.com]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.google.com]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.google.com]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.google.com]] *bold* [[http://www.xkcd.com][helpful text link]] *bold* /italic/ [[http://www.xkcd.com][helpful text link]] /italic/ =code= [[http://www.xkcd.com][helpful text link]] =code= ~verbatim~ [[http://www.xkcd.com][helpful text link]] ~verbatim~ _underline_ [[http://www.xkcd.com][helpful text link]] _underline_ +strikethrough+ [[http://www.xkcd.com][helpful text link]] +strikethrough+ [[http://www.bing.com]] [[http://www.xkcd.com][helpful text link]] [[http://www.bing.com]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://www.xkcd.com][helpful text link]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][helpful text link]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][helpful text link]] *bold* [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] *bold* /italic/ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] /italic/ =code= [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] =code= ~verbatim~ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] ~verbatim~ _underline_ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] _underline_ +strikethrough+ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] +strikethrough+ [[http://www.bing.com]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.bing.com]] [[http://www.google.com]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] *bold* [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] *bold* /italic/ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] /italic/ =code= [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] =code= ~verbatim~ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] ~verbatim~ _underline_ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] _underline_ +strikethrough+ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] +strikethrough+ [[http://www.bing.com]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.bing.com]] [[http://www.google.com]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] *bold* *bold* /italic/ /italic/ =code= =code= ~verbatim~ ~verbatim~ _underline_ _underline_ +strikethrough+ +strikethrough+ [[http://www.bing.com]] [[http://www.bing.com]] [[http://www.google.com]] [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] ** Together within a table | *bold* *bold* | /italic/ *bold* | =code= *bold* | ~verbatim~ *bold* | _underline_ *bold* | +strikethrough+ *bold* | [[http://www.bing.com]] *bold* | [[http://www.google.com]] *bold* | [[http://www.xkcd.com][helpful text link]] *bold* | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] *bold* | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] *bold* | *bold* | | *bold* /italic/ | /italic/ /italic/ | =code= /italic/ | ~verbatim~ /italic/ | _underline_ /italic/ | +strikethrough+ /italic/ | [[http://www.bing.com]] /italic/ | [[http://www.google.com]] /italic/ | [[http://www.xkcd.com][helpful text link]] /italic/ | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] /italic/ | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] /italic/ | /italic/ | | *bold* =code= | /italic/ =code= | =code= =code= | ~verbatim~ =code= | _underline_ =code= | +strikethrough+ =code= | [[http://www.bing.com]] =code= | [[http://www.google.com]] =code= | [[http://www.xkcd.com][helpful text link]] =code= | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] =code= | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] =code= | =code= | | *bold* ~verbatim~ | /italic/ ~verbatim~ | =code= ~verbatim~ | ~verbatim~ ~verbatim~ | _underline_ ~verbatim~ | +strikethrough+ ~verbatim~ | [[http://www.bing.com]] ~verbatim~ | [[http://www.google.com]] ~verbatim~ | [[http://www.xkcd.com][helpful text link]] ~verbatim~ | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] ~verbatim~ | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] ~verbatim~ | ~verbatim~ | | *bold* _underline_ | /italic/ _underline_ | =code= _underline_ | ~verbatim~ _underline_ | _underline_ _underline_ | +strikethrough+ _underline_ | [[http://www.bing.com]] _underline_ | [[http://www.google.com]] _underline_ | [[http://www.xkcd.com][helpful text link]] _underline_ | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] _underline_ | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] _underline_ | _underline_ | | *bold* +strikethrough+ | /italic/ +strikethrough+ | =code= +strikethrough+ | ~verbatim~ +strikethrough+ | _underline_ +strikethrough+ | +strikethrough+ +strikethrough+ | [[http://www.bing.com]] +strikethrough+ | [[http://www.google.com]] +strikethrough+ | [[http://www.xkcd.com][helpful text link]] +strikethrough+ | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] +strikethrough+ | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] +strikethrough+ | +strikethrough+ | | *bold* [[http://www.bing.com]] | /italic/ [[http://www.bing.com]] | =code= [[http://www.bing.com]] | ~verbatim~ [[http://www.bing.com]] | _underline_ [[http://www.bing.com]] | +strikethrough+ [[http://www.bing.com]] | [[http://www.bing.com]] [[http://www.bing.com]] | [[http://www.google.com]] [[http://www.bing.com]] | [[http://www.xkcd.com][helpful text link]] [[http://www.bing.com]] | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.bing.com]] | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.bing.com]] | [[http://www.bing.com]] | | *bold* [[http://www.google.com]] | /italic/ [[http://www.google.com]] | =code= [[http://www.google.com]] | ~verbatim~ [[http://www.google.com]] | _underline_ [[http://www.google.com]] | +strikethrough+ [[http://www.google.com]] | [[http://www.bing.com]] [[http://www.google.com]] | [[http://www.google.com]] [[http://www.google.com]] | [[http://www.xkcd.com][helpful text link]] [[http://www.google.com]] | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.google.com]] | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.google.com]] | [[http://www.google.com]] | | *bold* [[http://www.xkcd.com][helpful text link]] | /italic/ [[http://www.xkcd.com][helpful text link]] | =code= [[http://www.xkcd.com][helpful text link]] | ~verbatim~ [[http://www.xkcd.com][helpful text link]] | _underline_ [[http://www.xkcd.com][helpful text link]] | +strikethrough+ [[http://www.xkcd.com][helpful text link]] | [[http://www.bing.com]] [[http://www.xkcd.com][helpful text link]] | [[http://www.google.com]] [[http://www.xkcd.com][helpful text link]] | [[http://www.xkcd.com][helpful text link]] [[http://www.xkcd.com][helpful text link]] | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][helpful text link]] | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][helpful text link]] | [[http://www.xkcd.com][helpful text link]] | | *bold* [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | /italic/ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | =code= [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | ~verbatim~ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | _underline_ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | +strikethrough+ [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | [[http://www.bing.com]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | [[http://www.google.com]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | [[http://www.xkcd.com][helpful text link]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | | *bold* [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | /italic/ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | =code= [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | ~verbatim~ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | _underline_ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | +strikethrough+ [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | [[http://www.bing.com]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | [[http://www.google.com]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | [[http://www.xkcd.com][helpful text link]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | | *bold* | /italic/ | =code= | ~verbatim~ | _underline_ | +strikethrough+ | [[http://www.bing.com]] | [[http://www.google.com]] | [[http://www.xkcd.com][helpful text link]] | [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] | [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] | | ruby-org-0.8.0/spec/html_examples/entities.html000066400000000000000000000523531210571107600216030ustar00rootroot00000000000000

ENTITIES

Org-ruby supports “smart double quotes,” ‘smart single quotes,’ apostrophes for contractions like won’t and can’t, and other things… like elipses. Oh – and dashes.

  • Question: What does org-mode do for ampersands, like R&R? or &lt;?
  • Answer: Those get escaped, too. ☺

<Even in headlines! funner & funner!>

« They α should β be γ able δ to η exist θ in ε the same line √ ».

\laquo They won't appear in in example blocks. \raquo

⌈ — — — — — — ⌉

Though they appear in center blocks

⌊ — — — — — — ⌋

To work they have to be separated, like ♥ ♥, not like ♥\hearts.

List of entities supported

# Script to generate the list of currently supported entities
require 'org-ruby'

Orgmode::HtmlEntities.each_pair do |entity, _|
  puts "- Writing =\\#{entity}=, results in: \\#{entity}"
end
bundle exec ruby /tmp/print_entities.rb
  • Writing \Agrave, results in: À
  • Writing \agrave, results in: à
  • Writing \Aacute, results in: Á
  • Writing \aacute, results in: á
  • Writing \Acirc, results in: Â
  • Writing \acirc, results in: â
  • Writing \Atilde, results in: Ã
  • Writing \atilde, results in: ã
  • Writing \Auml, results in: Ä
  • Writing \auml, results in: ä
  • Writing \Aring, results in: Å
  • Writing \AA, results in: Å
  • Writing \aring, results in: å
  • Writing \AElig, results in: Æ
  • Writing \aelig, results in: æ
  • Writing \Ccedil, results in: Ç
  • Writing \ccedil, results in: ç
  • Writing \Egrave, results in: È
  • Writing \egrave, results in: è
  • Writing \Eacute, results in: É
  • Writing \eacute, results in: é
  • Writing \Ecirc, results in: Ê
  • Writing \ecirc, results in: ê
  • Writing \Euml, results in: Ë
  • Writing \euml, results in: ë
  • Writing \Igrave, results in: Ì
  • Writing \igrave, results in: ì
  • Writing \Iacute, results in: Í
  • Writing \iacute, results in: í
  • Writing \Icirc, results in: Î
  • Writing \icirc, results in: î
  • Writing \Iuml, results in: Ï
  • Writing \iuml, results in: ï
  • Writing \Ntilde, results in: Ñ
  • Writing \ntilde, results in: ñ
  • Writing \Ograve, results in: Ò
  • Writing \ograve, results in: ò
  • Writing \Oacute, results in: Ó
  • Writing \oacute, results in: ó
  • Writing \Ocirc, results in: Ô
  • Writing \ocirc, results in: ô
  • Writing \Otilde, results in: Õ
  • Writing \otilde, results in: õ
  • Writing \Ouml, results in: Ö
  • Writing \ouml, results in: ö
  • Writing \Oslash, results in: Ø
  • Writing \oslash, results in: ø
  • Writing \OElig, results in: Œ
  • Writing \oelig, results in: œ
  • Writing \Scaron, results in: Š
  • Writing \scaron, results in: š
  • Writing \szlig, results in: ß
  • Writing \Ugrave, results in: Ù
  • Writing \ugrave, results in: ù
  • Writing \Uacute, results in: Ú
  • Writing \uacute, results in: ú
  • Writing \Ucirc, results in: Û
  • Writing \ucirc, results in: û
  • Writing \Uuml, results in: Ü
  • Writing \uuml, results in: ü
  • Writing \Yacute, results in: Ý
  • Writing \yacute, results in: ý
  • Writing \Yuml, results in: Ÿ
  • Writing \yuml, results in: ÿ
  • Writing \fnof, results in: ƒ
  • Writing \real, results in: ℜ
  • Writing \image, results in: ℑ
  • Writing \weierp, results in: ℘
  • Writing \Alpha, results in: Α
  • Writing \alpha, results in: α
  • Writing \Beta, results in: Β
  • Writing \beta, results in: β
  • Writing \Gamma, results in: Γ
  • Writing \gamma, results in: γ
  • Writing \Delta, results in: Δ
  • Writing \delta, results in: δ
  • Writing \Epsilon, results in: Ε
  • Writing \epsilon, results in: ε
  • Writing \varepsilon, results in: ε
  • Writing \Zeta, results in: Ζ
  • Writing \zeta, results in: ζ
  • Writing \Eta, results in: Η
  • Writing \eta, results in: η
  • Writing \Theta, results in: Θ
  • Writing \theta, results in: θ
  • Writing \thetasym, results in: ϑ
  • Writing \vartheta, results in: ϑ
  • Writing \Iota, results in: Ι
  • Writing \iota, results in: ι
  • Writing \Kappa, results in: Κ
  • Writing \kappa, results in: κ
  • Writing \Lambda, results in: Λ
  • Writing \lambda, results in: λ
  • Writing \Mu, results in: Μ
  • Writing \mu, results in: μ
  • Writing \nu, results in: ν
  • Writing \Nu, results in: Ν
  • Writing \Xi, results in: Ξ
  • Writing \xi, results in: ξ
  • Writing \Omicron, results in: Ο
  • Writing \omicron, results in: ο
  • Writing \Pi, results in: Π
  • Writing \pi, results in: π
  • Writing \Rho, results in: Ρ
  • Writing \rho, results in: ρ
  • Writing \Sigma, results in: Σ
  • Writing \sigma, results in: σ
  • Writing \sigmaf, results in: ς
  • Writing \varsigma, results in: ς
  • Writing \Tau, results in: Τ
  • Writing \Upsilon, results in: Υ
  • Writing \upsih, results in: ϒ
  • Writing \upsilon, results in: υ
  • Writing \Phi, results in: Φ
  • Writing \phi, results in: φ
  • Writing \Chi, results in: Χ
  • Writing \chi, results in: χ
  • Writing \acutex, results in: ´x
  • Writing \Psi, results in: Ψ
  • Writing \psi, results in: ψ
  • Writing \tau, results in: τ
  • Writing \Omega, results in: Ω
  • Writing \omega, results in: ω
  • Writing \piv, results in: ϖ
  • Writing \partial, results in: ∂
  • Writing \alefsym, results in: ℵ
  • Writing \ETH, results in: Ð
  • Writing \eth, results in: ð
  • Writing \THORN, results in: Þ
  • Writing \thorn, results in: þ
  • Writing \dots, results in: …
  • Writing \hellip, results in: …
  • Writing \middot, results in: ·
  • Writing \iexcl, results in: ¡
  • Writing \iquest, results in: ¿
  • Writing \shy, results in: ­
  • Writing \ndash, results in: –
  • Writing \mdash, results in: —
  • Writing \quot, results in: "
  • Writing \acute, results in: ´
  • Writing \ldquo, results in: “
  • Writing \rdquo, results in: ”
  • Writing \bdquo, results in: „
  • Writing \lsquo, results in: ‘
  • Writing \rsquo, results in: ’
  • Writing \sbquo, results in: ‚
  • Writing \laquo, results in: «
  • Writing \raquo, results in: »
  • Writing \lsaquo, results in: ‹
  • Writing \rsaquo, results in: ›
  • Writing \circ, results in: ˆ
  • Writing \vert, results in: |
  • Writing \brvbar, results in: ¦
  • Writing \sect, results in: §
  • Writing \amp, results in: &
  • Writing \lt, results in: <
  • Writing \gt, results in: >
  • Writing \tilde, results in: ˜
  • Writing \slash, results in: /
  • Writing \plus, results in: +
  • Writing \under, results in: _
  • Writing \equal, results in: =
  • Writing \asciicirc, results in: ^
  • Writing \dagger, results in: †
  • Writing \Dagger, results in: ‡
  • Writing \nbsp, results in:  
  • Writing \ensp, results in:  
  • Writing \emsp, results in:  
  • Writing \thinsp, results in:  
  • Writing \curren, results in: ¤
  • Writing \cent, results in: ¢
  • Writing \pound, results in: £
  • Writing \yen, results in: ¥
  • Writing \euro, results in: €
  • Writing \EUR, results in: €
  • Writing \EURdig, results in: €
  • Writing \EURhv, results in: €
  • Writing \EURcr, results in: €
  • Writing \EURtm, results in: €
  • Writing \copy, results in: ©
  • Writing \reg, results in: ®
  • Writing \trade, results in: ™
  • Writing \minus, results in: −
  • Writing \pm, results in: ±
  • Writing \plusmn, results in: ±
  • Writing \times, results in: ×
  • Writing \frasl, results in: ⁄
  • Writing \div, results in: ÷
  • Writing \frac12, results in: ½
  • Writing \frac14, results in: ¼
  • Writing \frac34, results in: ¾
  • Writing \permil, results in: ‰
  • Writing \sup1, results in: ¹
  • Writing \sup2, results in: ²
  • Writing \sup3, results in: ³
  • Writing \radic, results in: √
  • Writing \sum, results in: ∑
  • Writing \prod, results in: ∏
  • Writing \micro, results in: µ
  • Writing \macr, results in: ¯
  • Writing \deg, results in: °
  • Writing \prime, results in: ′
  • Writing \Prime, results in: ″
  • Writing \infin, results in: ∞
  • Writing \infty, results in: ∞
  • Writing \prop, results in: ∝
  • Writing \proptp, results in: ∝
  • Writing \not, results in: ¬
  • Writing \neg, results in: ¬
  • Writing \land, results in: ∧
  • Writing \wedge, results in: ∧
  • Writing \lor, results in: ∨
  • Writing \vee, results in: ∨
  • Writing \cap, results in: ∩
  • Writing \cup, results in: ∪
  • Writing \int, results in: ∫
  • Writing \there4, results in: ∴
  • Writing \sim, results in: ∼
  • Writing \cong, results in: ≅
  • Writing \simeq, results in: ≅
  • Writing \asymp, results in: ≈
  • Writing \approx, results in: ≈
  • Writing \ne, results in: ≠
  • Writing \neq, results in: ≠
  • Writing \equiv, results in: ≡
  • Writing \le, results in: ≤
  • Writing \ge, results in: ≥
  • Writing \sub, results in: ⊂
  • Writing \subset, results in: ⊂
  • Writing \sup, results in: ⊃
  • Writing \supset, results in: ⊃
  • Writing \nsub, results in: ⊄
  • Writing \sube, results in: ⊆
  • Writing \nsup, results in: ⊅
  • Writing \supe, results in: ⊇
  • Writing \forall, results in: ∀
  • Writing \exist, results in: ∃
  • Writing \exists, results in: ∃
  • Writing \empty, results in: ∅
  • Writing \emptyset, results in: ∅
  • Writing \isin, results in: ∈
  • Writing \in, results in: ∈
  • Writing \notin, results in: ∉
  • Writing \ni, results in: ∋
  • Writing \nabla, results in: ∇
  • Writing \ang, results in: ∠
  • Writing \angle, results in: ∠
  • Writing \perp, results in: ⊥
  • Writing \sdot, results in: ⋅
  • Writing \cdot, results in: ⋅
  • Writing \lceil, results in: ⌈
  • Writing \rceil, results in: ⌉
  • Writing \lfloor, results in: ⌊
  • Writing \rfloor, results in: ⌋
  • Writing \lang, results in: ⟨
  • Writing \rang, results in: ⟩
  • Writing \larr, results in: ←
  • Writing \leftarrow, results in: ←
  • Writing \gets, results in: ←
  • Writing \lArr, results in: ⇐
  • Writing \Leftarrow, results in: ⇐
  • Writing \uarr, results in: ↑
  • Writing \uparrow, results in: ↑
  • Writing \uArr, results in: ⇑
  • Writing \Uparrow, results in: ⇑
  • Writing \rarr, results in: →
  • Writing \to, results in: →
  • Writing \rightarrow, results in: →
  • Writing \rArr, results in: ⇒
  • Writing \Rightarrow, results in: ⇒
  • Writing \darr, results in: ↓
  • Writing \downarrow, results in: ↓
  • Writing \dArr, results in: ⇓
  • Writing \Downarrow, results in: ⇓
  • Writing \harr, results in: ↔
  • Writing \leftrightarrow, results in: ↔
  • Writing \hArr, results in: ⇔
  • Writing \Leftrightarrow, results in: ⇔
  • Writing \crarr, results in: ↵
  • Writing \hookleftarrow, results in: ↵
  • Writing \arccos, results in: arccos
  • Writing \arcsin, results in: arcsin
  • Writing \arctan, results in: arctan
  • Writing \arg, results in: arg
  • Writing \cos, results in: cos
  • Writing \cosh, results in: cosh
  • Writing \cot, results in: cot
  • Writing \coth, results in: coth
  • Writing \csc, results in: csc
  • Writing \det, results in: det
  • Writing \dim, results in: dim
  • Writing \exp, results in: exp
  • Writing \gcd, results in: gcd
  • Writing \hom, results in: hom
  • Writing \inf, results in: inf
  • Writing \ker, results in: ker
  • Writing \lg, results in: lg
  • Writing \lim, results in: lim
  • Writing \liminf, results in: liminf
  • Writing \limsup, results in: limsup
  • Writing \ln, results in: ln
  • Writing \log, results in: log
  • Writing \max, results in: max
  • Writing \min, results in: min
  • Writing \Pr, results in: Pr
  • Writing \sec, results in: sec
  • Writing \sin, results in: sin
  • Writing \sinh, results in: sinh
  • Writing \tan, results in: tan
  • Writing \tanh, results in: tanh
  • Writing \bull, results in: •
  • Writing \bullet, results in: •
  • Writing \star, results in: *
  • Writing \lowast, results in: ∗
  • Writing \ast, results in: ∗
  • Writing \odot, results in: o
  • Writing \oplus, results in: ⊕
  • Writing \otimes, results in: ⊗
  • Writing \checkmark, results in: ✓
  • Writing \para, results in: ¶
  • Writing \ordf, results in: ª
  • Writing \ordm, results in: º
  • Writing \cedil, results in: ¸
  • Writing \oline, results in: ‾
  • Writing \uml, results in: ¨
  • Writing \zwnj, results in: ‌
  • Writing \zwj, results in: ‍
  • Writing \lrm, results in: ‎
  • Writing \rlm, results in: ‏
  • Writing \smile, results in: ☺
  • Writing \smiley, results in: ☺
  • Writing \blacksmile, results in: ☻
  • Writing \sad, results in: ☹
  • Writing \clubs, results in: ♣
  • Writing \clubsuit, results in: ♣
  • Writing \spades, results in: ♠
  • Writing \spadesuit, results in: ♠
  • Writing \hearts, results in: ♥
  • Writing \heartsuit, results in: ♥
  • Writing \diams, results in: ♦
  • Writing \diamondsuit, results in: ♦
  • Writing \Diamond, results in: ⋄
  • Writing \loz, results in: ◊

Some special cases

In case nothing matches, the string is returned as is.

\for \example \this \wont \break

ruby-org-0.8.0/spec/html_examples/entities.org000066400000000000000000000343251210571107600214250ustar00rootroot00000000000000#+TITLE: ENTITIES =Org-ruby= supports "smart double quotes," 'smart single quotes,' apostrophes for contractions like won't and can't, and other things... like elipses. Oh -- and dashes. - Question: What does org-mode do for ampersands, like R&R? or <? - Answer: Those get escaped, too. \smiley * \laquo They \alpha should \beta be \gamma able \delta to \eta exist \theta in \epsilon the same line \radic \raquo. #+begin_example \laquo They won't appear in in example blocks. \raquo #+end_example #+begin_center \lceil \mdash \mdash \mdash \mdash \mdash \mdash \rceil Though they appear in center blocks \lfloor \mdash \mdash \mdash \mdash \mdash \mdash \rfloor #+end_center To work they have to be separated, like \hearts \hearts, not like \hearts\hearts. * List of entities supported #+begin_example :tangle /tmp/print_entities.rb # Script to generate the list of currently supported entities require 'org-ruby' Orgmode::HtmlEntities.each_pair do |entity, _| puts "- Writing =\\#{entity}=, results in: \\#{entity}" end #+end_example #+begin_example :results output bundle exec ruby /tmp/print_entities.rb #+end_example - Writing =\Agrave=, results in: \Agrave - Writing =\agrave=, results in: \agrave - Writing =\Aacute=, results in: \Aacute - Writing =\aacute=, results in: \aacute - Writing =\Acirc=, results in: \Acirc - Writing =\acirc=, results in: \acirc - Writing =\Atilde=, results in: \Atilde - Writing =\atilde=, results in: \atilde - Writing =\Auml=, results in: \Auml - Writing =\auml=, results in: \auml - Writing =\Aring=, results in: \Aring - Writing =\AA=, results in: \AA - Writing =\aring=, results in: \aring - Writing =\AElig=, results in: \AElig - Writing =\aelig=, results in: \aelig - Writing =\Ccedil=, results in: \Ccedil - Writing =\ccedil=, results in: \ccedil - Writing =\Egrave=, results in: \Egrave - Writing =\egrave=, results in: \egrave - Writing =\Eacute=, results in: \Eacute - Writing =\eacute=, results in: \eacute - Writing =\Ecirc=, results in: \Ecirc - Writing =\ecirc=, results in: \ecirc - Writing =\Euml=, results in: \Euml - Writing =\euml=, results in: \euml - Writing =\Igrave=, results in: \Igrave - Writing =\igrave=, results in: \igrave - Writing =\Iacute=, results in: \Iacute - Writing =\iacute=, results in: \iacute - Writing =\Icirc=, results in: \Icirc - Writing =\icirc=, results in: \icirc - Writing =\Iuml=, results in: \Iuml - Writing =\iuml=, results in: \iuml - Writing =\Ntilde=, results in: \Ntilde - Writing =\ntilde=, results in: \ntilde - Writing =\Ograve=, results in: \Ograve - Writing =\ograve=, results in: \ograve - Writing =\Oacute=, results in: \Oacute - Writing =\oacute=, results in: \oacute - Writing =\Ocirc=, results in: \Ocirc - Writing =\ocirc=, results in: \ocirc - Writing =\Otilde=, results in: \Otilde - Writing =\otilde=, results in: \otilde - Writing =\Ouml=, results in: \Ouml - Writing =\ouml=, results in: \ouml - Writing =\Oslash=, results in: \Oslash - Writing =\oslash=, results in: \oslash - Writing =\OElig=, results in: \OElig - Writing =\oelig=, results in: \oelig - Writing =\Scaron=, results in: \Scaron - Writing =\scaron=, results in: \scaron - Writing =\szlig=, results in: \szlig - Writing =\Ugrave=, results in: \Ugrave - Writing =\ugrave=, results in: \ugrave - Writing =\Uacute=, results in: \Uacute - Writing =\uacute=, results in: \uacute - Writing =\Ucirc=, results in: \Ucirc - Writing =\ucirc=, results in: \ucirc - Writing =\Uuml=, results in: \Uuml - Writing =\uuml=, results in: \uuml - Writing =\Yacute=, results in: \Yacute - Writing =\yacute=, results in: \yacute - Writing =\Yuml=, results in: \Yuml - Writing =\yuml=, results in: \yuml - Writing =\fnof=, results in: \fnof - Writing =\real=, results in: \real - Writing =\image=, results in: \image - Writing =\weierp=, results in: \weierp - Writing =\Alpha=, results in: \Alpha - Writing =\alpha=, results in: \alpha - Writing =\Beta=, results in: \Beta - Writing =\beta=, results in: \beta - Writing =\Gamma=, results in: \Gamma - Writing =\gamma=, results in: \gamma - Writing =\Delta=, results in: \Delta - Writing =\delta=, results in: \delta - Writing =\Epsilon=, results in: \Epsilon - Writing =\epsilon=, results in: \epsilon - Writing =\varepsilon=, results in: \varepsilon - Writing =\Zeta=, results in: \Zeta - Writing =\zeta=, results in: \zeta - Writing =\Eta=, results in: \Eta - Writing =\eta=, results in: \eta - Writing =\Theta=, results in: \Theta - Writing =\theta=, results in: \theta - Writing =\thetasym=, results in: \thetasym - Writing =\vartheta=, results in: \vartheta - Writing =\Iota=, results in: \Iota - Writing =\iota=, results in: \iota - Writing =\Kappa=, results in: \Kappa - Writing =\kappa=, results in: \kappa - Writing =\Lambda=, results in: \Lambda - Writing =\lambda=, results in: \lambda - Writing =\Mu=, results in: \Mu - Writing =\mu=, results in: \mu - Writing =\nu=, results in: \nu - Writing =\Nu=, results in: \Nu - Writing =\Xi=, results in: \Xi - Writing =\xi=, results in: \xi - Writing =\Omicron=, results in: \Omicron - Writing =\omicron=, results in: \omicron - Writing =\Pi=, results in: \Pi - Writing =\pi=, results in: \pi - Writing =\Rho=, results in: \Rho - Writing =\rho=, results in: \rho - Writing =\Sigma=, results in: \Sigma - Writing =\sigma=, results in: \sigma - Writing =\sigmaf=, results in: \sigmaf - Writing =\varsigma=, results in: \varsigma - Writing =\Tau=, results in: \Tau - Writing =\Upsilon=, results in: \Upsilon - Writing =\upsih=, results in: \upsih - Writing =\upsilon=, results in: \upsilon - Writing =\Phi=, results in: \Phi - Writing =\phi=, results in: \phi - Writing =\Chi=, results in: \Chi - Writing =\chi=, results in: \chi - Writing =\acutex=, results in: \acutex - Writing =\Psi=, results in: \Psi - Writing =\psi=, results in: \psi - Writing =\tau=, results in: \tau - Writing =\Omega=, results in: \Omega - Writing =\omega=, results in: \omega - Writing =\piv=, results in: \piv - Writing =\partial=, results in: \partial - Writing =\alefsym=, results in: \alefsym - Writing =\ETH=, results in: \ETH - Writing =\eth=, results in: \eth - Writing =\THORN=, results in: \THORN - Writing =\thorn=, results in: \thorn - Writing =\dots=, results in: \dots - Writing =\hellip=, results in: \hellip - Writing =\middot=, results in: \middot - Writing =\iexcl=, results in: \iexcl - Writing =\iquest=, results in: \iquest - Writing =\shy=, results in: \shy - Writing =\ndash=, results in: \ndash - Writing =\mdash=, results in: \mdash - Writing =\quot=, results in: \quot - Writing =\acute=, results in: \acute - Writing =\ldquo=, results in: \ldquo - Writing =\rdquo=, results in: \rdquo - Writing =\bdquo=, results in: \bdquo - Writing =\lsquo=, results in: \lsquo - Writing =\rsquo=, results in: \rsquo - Writing =\sbquo=, results in: \sbquo - Writing =\laquo=, results in: \laquo - Writing =\raquo=, results in: \raquo - Writing =\lsaquo=, results in: \lsaquo - Writing =\rsaquo=, results in: \rsaquo - Writing =\circ=, results in: \circ - Writing =\vert=, results in: \vert - Writing =\brvbar=, results in: \brvbar - Writing =\sect=, results in: \sect - Writing =\amp=, results in: \amp - Writing =\lt=, results in: \lt - Writing =\gt=, results in: \gt - Writing =\tilde=, results in: \tilde - Writing =\slash=, results in: \slash - Writing =\plus=, results in: \plus - Writing =\under=, results in: \under - Writing =\equal=, results in: \equal - Writing =\asciicirc=, results in: \asciicirc - Writing =\dagger=, results in: \dagger - Writing =\Dagger=, results in: \Dagger - Writing =\nbsp=, results in: \nbsp - Writing =\ensp=, results in: \ensp - Writing =\emsp=, results in: \emsp - Writing =\thinsp=, results in: \thinsp - Writing =\curren=, results in: \curren - Writing =\cent=, results in: \cent - Writing =\pound=, results in: \pound - Writing =\yen=, results in: \yen - Writing =\euro=, results in: \euro - Writing =\EUR=, results in: \EUR - Writing =\EURdig=, results in: \EURdig - Writing =\EURhv=, results in: \EURhv - Writing =\EURcr=, results in: \EURcr - Writing =\EURtm=, results in: \EURtm - Writing =\copy=, results in: \copy - Writing =\reg=, results in: \reg - Writing =\trade=, results in: \trade - Writing =\minus=, results in: \minus - Writing =\pm=, results in: \pm - Writing =\plusmn=, results in: \plusmn - Writing =\times=, results in: \times - Writing =\frasl=, results in: \frasl - Writing =\div=, results in: \div - Writing =\frac12=, results in: \frac12 - Writing =\frac14=, results in: \frac14 - Writing =\frac34=, results in: \frac34 - Writing =\permil=, results in: \permil - Writing =\sup1=, results in: \sup1 - Writing =\sup2=, results in: \sup2 - Writing =\sup3=, results in: \sup3 - Writing =\radic=, results in: \radic - Writing =\sum=, results in: \sum - Writing =\prod=, results in: \prod - Writing =\micro=, results in: \micro - Writing =\macr=, results in: \macr - Writing =\deg=, results in: \deg - Writing =\prime=, results in: \prime - Writing =\Prime=, results in: \Prime - Writing =\infin=, results in: \infin - Writing =\infty=, results in: \infty - Writing =\prop=, results in: \prop - Writing =\proptp=, results in: \proptp - Writing =\not=, results in: \not - Writing =\neg=, results in: \neg - Writing =\land=, results in: \land - Writing =\wedge=, results in: \wedge - Writing =\lor=, results in: \lor - Writing =\vee=, results in: \vee - Writing =\cap=, results in: \cap - Writing =\cup=, results in: \cup - Writing =\int=, results in: \int - Writing =\there4=, results in: \there4 - Writing =\sim=, results in: \sim - Writing =\cong=, results in: \cong - Writing =\simeq=, results in: \simeq - Writing =\asymp=, results in: \asymp - Writing =\approx=, results in: \approx - Writing =\ne=, results in: \ne - Writing =\neq=, results in: \neq - Writing =\equiv=, results in: \equiv - Writing =\le=, results in: \le - Writing =\ge=, results in: \ge - Writing =\sub=, results in: \sub - Writing =\subset=, results in: \subset - Writing =\sup=, results in: \sup - Writing =\supset=, results in: \supset - Writing =\nsub=, results in: \nsub - Writing =\sube=, results in: \sube - Writing =\nsup=, results in: \nsup - Writing =\supe=, results in: \supe - Writing =\forall=, results in: \forall - Writing =\exist=, results in: \exist - Writing =\exists=, results in: \exists - Writing =\empty=, results in: \empty - Writing =\emptyset=, results in: \emptyset - Writing =\isin=, results in: \isin - Writing =\in=, results in: \in - Writing =\notin=, results in: \notin - Writing =\ni=, results in: \ni - Writing =\nabla=, results in: \nabla - Writing =\ang=, results in: \ang - Writing =\angle=, results in: \angle - Writing =\perp=, results in: \perp - Writing =\sdot=, results in: \sdot - Writing =\cdot=, results in: \cdot - Writing =\lceil=, results in: \lceil - Writing =\rceil=, results in: \rceil - Writing =\lfloor=, results in: \lfloor - Writing =\rfloor=, results in: \rfloor - Writing =\lang=, results in: \lang - Writing =\rang=, results in: \rang - Writing =\larr=, results in: \larr - Writing =\leftarrow=, results in: \leftarrow - Writing =\gets=, results in: \gets - Writing =\lArr=, results in: \lArr - Writing =\Leftarrow=, results in: \Leftarrow - Writing =\uarr=, results in: \uarr - Writing =\uparrow=, results in: \uparrow - Writing =\uArr=, results in: \uArr - Writing =\Uparrow=, results in: \Uparrow - Writing =\rarr=, results in: \rarr - Writing =\to=, results in: \to - Writing =\rightarrow=, results in: \rightarrow - Writing =\rArr=, results in: \rArr - Writing =\Rightarrow=, results in: \Rightarrow - Writing =\darr=, results in: \darr - Writing =\downarrow=, results in: \downarrow - Writing =\dArr=, results in: \dArr - Writing =\Downarrow=, results in: \Downarrow - Writing =\harr=, results in: \harr - Writing =\leftrightarrow=, results in: \leftrightarrow - Writing =\hArr=, results in: \hArr - Writing =\Leftrightarrow=, results in: \Leftrightarrow - Writing =\crarr=, results in: \crarr - Writing =\hookleftarrow=, results in: \hookleftarrow - Writing =\arccos=, results in: \arccos - Writing =\arcsin=, results in: \arcsin - Writing =\arctan=, results in: \arctan - Writing =\arg=, results in: \arg - Writing =\cos=, results in: \cos - Writing =\cosh=, results in: \cosh - Writing =\cot=, results in: \cot - Writing =\coth=, results in: \coth - Writing =\csc=, results in: \csc - Writing =\det=, results in: \det - Writing =\dim=, results in: \dim - Writing =\exp=, results in: \exp - Writing =\gcd=, results in: \gcd - Writing =\hom=, results in: \hom - Writing =\inf=, results in: \inf - Writing =\ker=, results in: \ker - Writing =\lg=, results in: \lg - Writing =\lim=, results in: \lim - Writing =\liminf=, results in: \liminf - Writing =\limsup=, results in: \limsup - Writing =\ln=, results in: \ln - Writing =\log=, results in: \log - Writing =\max=, results in: \max - Writing =\min=, results in: \min - Writing =\Pr=, results in: \Pr - Writing =\sec=, results in: \sec - Writing =\sin=, results in: \sin - Writing =\sinh=, results in: \sinh - Writing =\tan=, results in: \tan - Writing =\tanh=, results in: \tanh - Writing =\bull=, results in: \bull - Writing =\bullet=, results in: \bullet - Writing =\star=, results in: \star - Writing =\lowast=, results in: \lowast - Writing =\ast=, results in: \ast - Writing =\odot=, results in: \odot - Writing =\oplus=, results in: \oplus - Writing =\otimes=, results in: \otimes - Writing =\checkmark=, results in: \checkmark - Writing =\para=, results in: \para - Writing =\ordf=, results in: \ordf - Writing =\ordm=, results in: \ordm - Writing =\cedil=, results in: \cedil - Writing =\oline=, results in: \oline - Writing =\uml=, results in: \uml - Writing =\zwnj=, results in: \zwnj - Writing =\zwj=, results in: \zwj - Writing =\lrm=, results in: \lrm - Writing =\rlm=, results in: \rlm - Writing =\smile=, results in: \smile - Writing =\smiley=, results in: \smiley - Writing =\blacksmile=, results in: \blacksmile - Writing =\sad=, results in: \sad - Writing =\clubs=, results in: \clubs - Writing =\clubsuit=, results in: \clubsuit - Writing =\spades=, results in: \spades - Writing =\spadesuit=, results in: \spadesuit - Writing =\hearts=, results in: \hearts - Writing =\heartsuit=, results in: \heartsuit - Writing =\diams=, results in: \diams - Writing =\diamondsuit=, results in: \diamondsuit - Writing =\Diamond=, results in: \Diamond - Writing =\loz=, results in: \loz * Some special cases In case nothing matches, the string is returned as is. \for \example \this \wont \break ruby-org-0.8.0/spec/html_examples/escape-pre.html000066400000000000000000000005721210571107600217770ustar00rootroot00000000000000
<li>[ ] &#8220;smart quotes&#8221;</li> 
<li>[ ] I think I need this for &#8216;single quotes&#8217; too. Don&#8217;t I?</li> 
<li>[ ] Em dashes would be great &#8212; wouldn&#8217;t they?</li> 
<li>[ ] I hope to develop an en dash sometime in 2010 &#8211; 2011.</li> 
ruby-org-0.8.0/spec/html_examples/escape-pre.org000066400000000000000000000004631210571107600216210ustar00rootroot00000000000000 #+BEGIN_EXAMPLE
  • [ ] “smart quotes”
  • [ ] I think I need this for ‘single quotes’ too. Don’t I?
  • [ ] Em dashes would be great — wouldn’t they?
  • [ ] I hope to develop an en dash sometime in 2010 – 2011.
  • #+END_EXAMPLE ruby-org-0.8.0/spec/html_examples/export-exclude-only.html000066400000000000000000000033041210571107600236760ustar00rootroot00000000000000

    export-headline-levels.org

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

    1 Headline 1

    1.1 Headline 2

    This bit of body should get exported.

    1.1.1 Headline 3

    This bit of body gets exported.

    1.1.1.1 Headline 4 (include)

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

    1.1.2 Another headline 3

    This one should not get exported!!

    1.1.2.1 Another headline 4

    This also cannot get exported!!

    ruby-org-0.8.0/spec/html_examples/export-exclude-only.org000066400000000000000000000061401210571107600235220ustar00rootroot00000000000000#+TITLE: export-headline-levels.org #+AUTHOR: #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-29 Tue #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_EXCLUDE_TAGS: exclude noexport #+TAGS: export noexport #+LINK_UP: #+LINK_HOME: What happens when you exceed the number of headline levels to export? * Shouldn't export :noexport: This text shouldn't be exported, right? ** Nor this subheading? Or its text? * Exlude me, too! :exclude: * Headline 1 :READING:DVD: ** Headline 2 This bit of body *should* get exported. *** Headline 3 :export: This bit of body gets exported. **** Headline 4 (include) Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. **** Headline 4 (exclude) :noexport: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. *** Another headline 3 This one *should not* get exported!! **** Another headline 4 This also *cannot* get exported!! ruby-org-0.8.0/spec/html_examples/export-keywords.html000066400000000000000000000005241210571107600231360ustar00rootroot00000000000000

    export-keywords.org

    Testing that I can export keywords.

    1 TODO This is a todo item.

    2 DONE this item is done!

    ruby-org-0.8.0/spec/html_examples/export-keywords.org000066400000000000000000000010771210571107600227650ustar00rootroot00000000000000#+TITLE: export-keywords.org #+AUTHOR: #+EMAIL: brian@BRIAN-DESK #+DATE: 2009-12-29 Tue #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: Testing that I can export keywords. * TODO This is a todo item. * DONE this item is done! ruby-org-0.8.0/spec/html_examples/export-tags.html000066400000000000000000000026011210571107600222230ustar00rootroot00000000000000

    export-headline-levels.org

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

    1 Headline 1

    1.1 Headline 2

    1.1.1 Headline 3

    This bit of body gets exported.

    1.1.1.1 Headline 4 (include)

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

    ruby-org-0.8.0/spec/html_examples/export-tags.org000066400000000000000000000061771210571107600220620ustar00rootroot00000000000000#+TITLE: export-headline-levels.org #+AUTHOR: #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-29 Tue #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: exclude noexport #+TAGS: export noexport #+LINK_UP: #+LINK_HOME: What happens when you exceed the number of headline levels to export? * Shouldn't export :noexport: This text shouldn't be exported, right? ** Nor this subheading? Or its text? * Exlude me, too! :exclude: * Headline 1 :READING:DVD: ** Headline 2 This bit of body should not get exported. *** Headline 3 :export: This bit of body gets exported. **** Headline 4 (include) Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. **** Headline 4 (exclude) :noexport: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. *** Another headline 3 This one *should not* get exported!! **** Another headline 4 This also *cannot* get exported!! ruby-org-0.8.0/spec/html_examples/export-title.html000066400000000000000000000002241210571107600224050ustar00rootroot00000000000000

    Export Title

    This simple org document should get a title from the TITLE option at the front of the file.

    ruby-org-0.8.0/spec/html_examples/export-title.org000066400000000000000000000001671210571107600222360ustar00rootroot00000000000000#+TITLE: Export Title This simple org document should get a title from the =TITLE= option at the front of the file. ruby-org-0.8.0/spec/html_examples/footnotes.html000066400000000000000000000015661210571107600217770ustar00rootroot00000000000000

    Footnotes

    Footnotes

    Using numbers 0

    Using letters and not defined in the footnote abc

    Using letters and defined in the footnote abc

    Defined in the footnote itself with markup 1

    0 Definition of first footnote

    Footnotes:

    abcdefinition of abc

    1blub

    ruby-org-0.8.0/spec/html_examples/footnotes.org000066400000000000000000000004421210571107600216120ustar00rootroot00000000000000#+TITLE: Footnotes #+OPTIONS: f:t * Footnotes Using numbers [fn:0] Using letters and not defined in the footnote [fn:abc] Using letters and defined in the footnote [fn:abc:definition of abc] Defined in the footnote itself with markup [fn:1:*blub*] [fn:0] Definition of first footnote ruby-org-0.8.0/spec/html_examples/horizontal_rule.html000066400000000000000000000002401210571107600231630ustar00rootroot00000000000000

    Useful contribution by Neil-Smithline

    5 hyphens or more,


    will produce a horizontal rule.

    ruby-org-0.8.0/spec/html_examples/horizontal_rule.org000066400000000000000000000002021210571107600230040ustar00rootroot00000000000000Useful contribution by [[http://www.neilsmithline.com][Neil-Smithline]] 5 hyphens or more, ----- will produce a horizontal rule. ruby-org-0.8.0/spec/html_examples/html-literal.html000066400000000000000000000002671210571107600223520ustar00rootroot00000000000000

    HTML literals

    ORG escapes HTML by default. This should <b>not be bold text!</b> Instead, it should look like regular text with some HTML tags around it.

    ruby-org-0.8.0/spec/html_examples/html-literal.org000066400000000000000000000002331210571107600221660ustar00rootroot00000000000000HTML literals ORG escapes HTML by default. This should not be bold text! Instead, it should look like regular text with some HTML tags around it. ruby-org-0.8.0/spec/html_examples/inline-formatting.html000066400000000000000000000046161210571107600234040ustar00rootroot00000000000000

    Inline Formatting

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

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

    Note the last one is not a link, as the source doesn’t include it in double-brackets and I don’t auto-recognize URLs.

    I should also handle links with helpful text.

    Helpful addition from punchagan, we now recognize when the link goes to an image and make the link anchor be the image, like this:

    • http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg

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

    • http://imgs.xkcd.com/comics/t_cells.png

    Helpful addition from wallyqs:

    While “naked” links don’t work (like http://www.google.com), angle links do work. This should look like a link: http://www.google.com.

    It should be possible to use both kind of links on the same paragraph:

    This is an angle link http://google.com and this is a bracket link to a repository.

    This is a bracket link to a repository and this is an angle link http://google.com.

    This is a bracket link to a repository and this is a bracket link too to a repository.

    This is an angle link http://google.com and this is an angle link too http://google.com.

    ruby-org-0.8.0/spec/html_examples/inline-formatting.org000066400000000000000000000032701210571107600232220ustar00rootroot00000000000000Inline Formatting I want to make sure I handle all inline formatting. I need to handle *bold*, /italic/, =code=, ~verbatim~, _underline_, +strikethrough+. In addition, I need to make sure I can handle links. We've got simple links, like this: - [[http://www.bing.com]] - [[http://www.google.com]] - http://www.gmail.com Note the last one *is not* a link, as the source doesn't include it in double-brackets and I don't auto-recognize URLs. I should also handle links with [[http://www.xkcd.com][helpful text]]. Helpful addition from [[https://github.com/punchagan][punchagan]], we now recognize when the link goes to an image and make the link anchor be the image, like this: - [[http://farm7.static.flickr.com/6078/6084185195_552aa270b2.jpg]] Also, if you make the descriptive text be an image, then it will get formatted with an image tag, like so: - [[http://www.xkcd.com][http://imgs.xkcd.com/comics/t_cells.png]] Helpful addition from [[https://github.com/wallyqs][wallyqs]]: While "naked" links don't work (like http://www.google.com), angle links do work. This should look like a link: . It should be possible to use both kind of links on the same paragraph: This is an angle link and this is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]]. This is a bracket link [[https://github.com/bdewey/org-ruby][to a repository]] and this is an angle link . 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]]. This is an angle link and this is an angle link too . ruby-org-0.8.0/spec/html_examples/inline-images.html000066400000000000000000000011131210571107600224640ustar00rootroot00000000000000

    Inline Images

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

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

    I currently do not support the caption/link syntax, but I can include the inline image. I recognize the following image file types:

    • .jpg
    • .png
    • .gif
    • .jpeg
    ruby-org-0.8.0/spec/html_examples/inline-images.org000066400000000000000000000006521210571107600223160ustar00rootroot00000000000000Inline Images Per the org-mode [[http://orgmode.org/manual/Images-and-tables.html#Images-and-tables][spec]], you can include inline images as links without any descriptive link text, like this: [[http://farm5.static.flickr.com/4049/4358074549_5efb8b4903.jpg]] I currently do not support the caption/link syntax, but I can include the inline image. I recognize the following image file types: - .jpg - .png - .gif - .jpeg ruby-org-0.8.0/spec/html_examples/link-features.html000066400000000000000000000022421210571107600225200ustar00rootroot00000000000000

    link-features.org

    Org-mode export supports a lot of link features. I’ve covered “simple” HTML links elsewhere. Now let’s cover links to other org files, other sections within documents, etc.

    Links to other org files

    This is a link to the code-comment.org file in the same directory. In emacs, if you click it, the other file opens. We want the same behavior in the HTML export.

    Code Comment

    Search links

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

    Code Comment

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

    In these links, .org is converted to .html

    ruby-org-0.8.0/spec/html_examples/link-features.org000066400000000000000000000017111210571107600223430ustar00rootroot00000000000000#+TITLE: link-features.org Org-mode export supports a lot of link features. I've covered "simple" HTML links elsewhere. Now let's cover links to other org files, other sections within documents, etc. * Links to other org files This is a link to the ~code-comment.org~ file in the same directory. In ~emacs~, if you click it, the other file opens. We want the same behavior in the HTML export. [[file:code-comment.org][Code Comment]] * Search links This is a search link into code-comment.org. [[file:code-comment.org::*Code%20Comment][Code Comment]] * Correct handling of .org URIs in HTML markup routine (thanks @rayl!) - [[http://foo.com][foo.com website]] - [[http://foo.org][foo.org website]] - [[http://foo.org/foo.org][foo.org/foo.org]] - [[http://localhost:4567/foo.org][localhost:4567/foo.org]] * In these links, .org is converted to .html - [[file:path.org][file:path.org label]] - [[file:notes/path.org][file:notes/path.org label]] ruby-org-0.8.0/spec/html_examples/lists.html000066400000000000000000000035301210571107600211060ustar00rootroot00000000000000

    Lists

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

    • This is an unordered list
    • This continues the unordered list

    And this is a paragraph after the list.

    Wrapping within the list

    • This is a single-line list item in the org file.
    • Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
    • And this is the next item. The previous item needs to be on one line to keep textile happy.
    • Ditto the previous line, actually.

    Edge cases

    • This is a single-line list.

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

    Invalid lists

    Note that spaces are required to denote lists. Thus, none of the following should get recognized as lists.

    -This isn’t a list. -And this isn’t a list.

    1.And this isn’t a list. 2.And this isn’t a list.

    ruby-org-0.8.0/spec/html_examples/lists.org000066400000000000000000000033121210571107600207270ustar00rootroot00000000000000* Lists I want to make sure I have great support for lists. - This is an unordered list - This continues the unordered list And this is a paragraph *after* the list. ** Wrapping within the list - This is a single-line list item in the org file. - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. - And this is the next item. The previous item needs to be on one line to keep =textile= happy. - Ditto the previous line, actually. ** Edge cases - This is a single-line list. And this is a *separate paragraph.* Note the indentation in the org file. ** Invalid lists Note that spaces are required to denote lists. Thus, none of the following should get recognized as lists. -This isn't a list. -And this isn't a list. 1.And this isn't a list. 2.And this isn't a list. ruby-org-0.8.0/spec/html_examples/metadata-comment.html000066400000000000000000000015771210571107600232010ustar00rootroot00000000000000

    Metadata, etc.

    I normally filter out things that look like metadata. Can’t do it any more. I need to see all of the following:

    * DONE Handle inline formatting
      CLOSED: [2009-12-26 Sat 21:41]
      :PROPERTIES:
      :ARCHIVE_TIME: 2009-12-26 Sat 22:16
      :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
      :ARCHIVE_OLPATH: <%= @page.title %>/Future Development
      :ARCHIVE_CATEGORY: orgmode_parser
      :ARCHIVE_TODO: DONE
      :END:
    
      I still need to handle:
    
      - [ ] =Inline code=
    
      How does the =emacs= HTML parser handle *inline* formatting? Ah,
      it looks like it defines everything in =org-emphasis-alist= (line
      2855 of =org.el=).
    
      And then look at =org-emphasis-regexp-components=, line 2828 of
      =org.el=. It looks like they just use a crazy regexp for inline
      formatting. Which is good, because it means I can copy!
    
    
    
    ruby-org-0.8.0/spec/html_examples/metadata-comment.org000066400000000000000000000015461210571107600230200ustar00rootroot00000000000000* Metadata, etc. I normally filter out things that look like metadata. Can't do it any more. I need to see all of the following: #+BEGIN_EXAMPLE * DONE Handle inline formatting CLOSED: [2009-12-26 Sat 21:41] :PROPERTIES: :ARCHIVE_TIME: 2009-12-26 Sat 22:16 :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org :ARCHIVE_OLPATH: <%= @page.title %>/Future Development :ARCHIVE_CATEGORY: orgmode_parser :ARCHIVE_TODO: DONE :END: I still need to handle: - [ ] =Inline code= How does the =emacs= HTML parser handle *inline* formatting? Ah, it looks like it defines everything in =org-emphasis-alist= (line 2855 of =org.el=). And then look at =org-emphasis-regexp-components=, line 2828 of =org.el=. It looks like they just use a crazy regexp for inline formatting. Which is good, because it means I can copy! #+END_EXAMPLE ruby-org-0.8.0/spec/html_examples/only-list.html000066400000000000000000000002751210571107600217050ustar00rootroot00000000000000
    • This file has only a list
    • Note it will end with nothing other than a list item.
    • the world wants to know: Will org-ruby write the closing ul tag?
    ruby-org-0.8.0/spec/html_examples/only-list.org000066400000000000000000000002271210571107600215250ustar00rootroot00000000000000- This file has only a list - Note it will end with nothing other than a list item. - the world wants to know: Will org-ruby write the closing ul tag? ruby-org-0.8.0/spec/html_examples/only-table.html000066400000000000000000000005401210571107600220140ustar00rootroot00000000000000
    OneTwoThreeFour
    FiveSixSevenEight
    NineTenElevenTwelve
    formattextincells
    ruby-org-0.8.0/spec/html_examples/only-table.org000066400000000000000000000003151210571107600216370ustar00rootroot00000000000000| One | Two | Three | Four | |----------+--------+--------+---------| | Five | Six | Seven | Eight | | Nine | Ten | Eleven | Twelve | | *format* | /text/ | ~in~ | _cells_ | ruby-org-0.8.0/spec/html_examples/properties_drawer.html000066400000000000000000000007311210571107600235100ustar00rootroot00000000000000

    The mount point of the fullest disk

    query all mounted disks

    df \
    

    strip the header row

    |sed '1d' \
    

    sort by the percent full

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

    extract the mount point

    |awk '{print $2}'
    

    Properties drawer example

    These properties are metadata so they should not be visible.

    ruby-org-0.8.0/spec/html_examples/properties_drawer.org000066400000000000000000000015141210571107600233330ustar00rootroot00000000000000# Example taken from the wiki # http://orgmode.org/manual/noweb_002dref.html#noweb_002dref * The mount point of the fullest disk :PROPERTIES: :noweb-ref: fullest-disk :END: ** query all mounted disks #+BEGIN_EXAMPLE df \ #+END_EXAMPLE ** strip the header row #+BEGIN_EXAMPLE |sed '1d' \ #+END_EXAMPLE ** sort by the percent full #+BEGIN_EXAMPLE |awk '{print $5 " " $6}'|sort -n |tail -1 \ #+END_EXAMPLE ** extract the mount point #+BEGIN_EXAMPLE |awk '{print $2}' #+END_EXAMPLE * Properties drawer example :PROPERTIES: :ARCHIVE_TIME: 2009-12-26 Sat 22:16 :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org :ARCHIVE_OLPATH: <%= @page.title %>/Future Development :ARCHIVE_CATEGORY: orgmode_parser :ARCHIVE_TODO: DONE :END: These properties are metadata so they should not be visible. ruby-org-0.8.0/spec/html_examples/raw-html.html000066400000000000000000000004711210571107600215040ustar00rootroot00000000000000

    Raw html can be embedded

    The following will render the tag as is:

    Hello

    And this will render some Javascript:

    HTML blocks

    They behave as follows:

    
    Hello.
    
    

    ruby-org-0.8.0/spec/html_examples/raw-html.org000066400000000000000000000005061210571107600213260ustar00rootroot00000000000000* Raw html can be embedded The following will render the tag as is: #+html: Hello And this will render some Javascript: #+html: ** HTML blocks They behave as follows: #+begin_html

    
    Hello.
    
    

    #+end_html ruby-org-0.8.0/spec/html_examples/skip-header.html000066400000000000000000000002471210571107600221460ustar00rootroot00000000000000

    skip-header.org

    1 First heading

    This should be the first text in the output.

    ruby-org-0.8.0/spec/html_examples/skip-header.org000066400000000000000000000014361210571107600217720ustar00rootroot00000000000000#+TITLE: skip-header.org #+AUTHOR: #+EMAIL: brian@BRIAN-DESK #+DATE: 2009-12-29 Tue #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:t d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: This is header text. It exists in the org-file, but shouldn't show up in the HTML output. - Same with this list - Nope, shouldn't be in the output. #+BEGIN_EXAMPLE Even this code snippet shouldn't be there. Like a ninja. You can't see me. #+END_EXAMPLE * First heading This should be the first text in the output. ruby-org-0.8.0/spec/html_examples/skip-table.html000066400000000000000000000003741210571107600220060ustar00rootroot00000000000000

    skip-table.org

    Checking that tables are skipped when directed.

    For grins, here’s another table without a header. Just keep the bases covered.

    Again, in the HTML output, you should see no tables.

    ruby-org-0.8.0/spec/html_examples/skip-table.org000066400000000000000000000006431210571107600216300ustar00rootroot00000000000000#+TITLE: skip-table.org #+OPTIONS: |:nil Checking that tables are skipped when directed. | One | Two | Three | |-------+-------+-------| | Four | Five | Six | | Seven | Eight | Nine | For grins, here's another table without a header. Just keep the bases covered. | One | Two | Three | | Four | Five | Six | | Seven | Eight | Nine | Again, in the HTML output, you should see *no tables*. ruby-org-0.8.0/spec/html_examples/subsupscript-nil.html000066400000000000000000000000561210571107600232760ustar00rootroot00000000000000

    SUBSUPSCRIPT

    a^{b}

    a_{b}

    ruby-org-0.8.0/spec/html_examples/subsupscript-nil.org000066400000000000000000000000541210571107600231170ustar00rootroot00000000000000#+OPTIONS: ^:nil SUBSUPSCRIPT a^{b} a_{b} ruby-org-0.8.0/spec/html_examples/subsupscript.html000066400000000000000000000000761210571107600225200ustar00rootroot00000000000000

    SUBSUPSCRIPT

    ab

    ab

    ruby-org-0.8.0/spec/html_examples/subsupscript.org000066400000000000000000000000331210571107600223340ustar00rootroot00000000000000SUBSUPSCRIPT a^{b} a_{b} ruby-org-0.8.0/spec/html_examples/tables.html000066400000000000000000000026211210571107600212220ustar00rootroot00000000000000

    TABLES

    Different types of ORG tables.

    Simple table, no header.

    Cell oneCell two
    Cell threeCell four

    Indented table

    Cell one
    Cell two

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

    Table with header

    OneTwoThree
    FourFiveSix
    SevenEightNine

    The separator row should not get printed out.

    Table with complete box

    OneTwoThree
    FourFiveSix
    SevenEightNine

    Only the first row should be a header row.

    Table with extra lines

    OneTwoThree
    FourFiveSix
    SevenEightNine
    TenElevenTwelve

    Only the first row should be a header row.

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

    foobar
    12

    https://github.com/bdewey/org-ruby/pull/34

    ruby-org-0.8.0/spec/html_examples/tables.org000066400000000000000000000022311210571107600210420ustar00rootroot00000000000000TABLES Different types of ORG tables. * Simple table, no header. | Cell one | Cell two | | Cell three | Cell four | * Indented table | Cell one | | Cell two | And here's some paragraph content. The line breaks will need to get removed here, but not for the tables. * Table with header | One | Two | Three | |-------+-------+-------| | Four | Five | Six | | Seven | Eight | Nine | The separator row should not get printed out. * Table with complete box |-------+-------+-------| | One | Two | Three | |-------+-------+-------| | Four | Five | Six | | Seven | Eight | Nine | |-------+-------+-------| Only the first row should be a header row. * Table with extra lines |-------+--------+--------| | One | Two | Three | |-------+--------+--------| | Four | Five | Six | | Seven | Eight | Nine | |-------+--------+--------| | Ten | Eleven | Twelve | |-------+--------+--------| Only the first row should be a header row. * Fix error when table starts with hline (Thanks @til!) |-----+-----| | foo | bar | |-----+-----| | 1 | 2 | https://github.com/bdewey/org-ruby/pull/34 ruby-org-0.8.0/spec/html_examples/text.html000066400000000000000000000017131210571107600207350ustar00rootroot00000000000000

    The simplest case: translating plain text.

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

    ruby-org-0.8.0/spec/html_examples/text.org000066400000000000000000000016441210571107600205630ustar00rootroot00000000000000The simplest case: translating plain text. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ruby-org-0.8.0/spec/line_spec.rb000066400000000000000000000111721210571107600165070ustar00rootroot00000000000000require 'spec_helper' describe Orgmode::Line do it "should tell comments" do comments = ["# hello", "#hello" ] comments.each do |c| line = Orgmode::Line.new c line.comment?.should be_true end not_comments = ["", "\n", "hello\n", " foo ### bar\n"] not_comments.each do |c| line = Orgmode::Line.new c line.comment?.should_not be_true end end it "should tell blank lines" do blank = ["", " ", "\t", "\n", " \t\t\n\n"] blank.each do |b| line = Orgmode::Line.new b line.blank?.should be_true end end [": inline", " : inline", "\t\t:\tinline"].each do |inline_example| it "should recognize this inline example: #{inline_example}" do Orgmode::Line.new(inline_example).inline_example?.should be_true end end list_formats = ["- ", "+ ", " - ", " + ", " 1. ", " 2) "] list_formats.each do |list| it "should recognize this list format: '#{list}'" do line = Orgmode::Line.new list line.plain_list?.should be_true end end ["-foo", "+foo", "1.foo", "2.foo"].each do |invalid_list| it "should not recognize this invalid list: '#{invalid_list}'" do line = Orgmode::Line.new invalid_list line.plain_list?.should_not be_true end end it "should recognize horizontal rules" do Orgmode::Line.new("-----").horizontal_rule?.should be_true Orgmode::Line.new("----------").horizontal_rule?.should be_true Orgmode::Line.new(" \t ----- \t\t\t").horizontal_rule?.should be_true Orgmode::Line.new("----").horizontal_rule?.should_not be_true end it "should recognize table rows" do Orgmode::Line.new("| One | Two | Three |").table_row?.should be_true Orgmode::Line.new(" |-------+-------+-------|\n").table_separator?.should be_true Orgmode::Line.new("| Four | Five | Six |").table_row?.should be_true Orgmode::Line.new("| Seven | Eight | Nine |").table_row?.should be_true end it "should recognize indentation" do Orgmode::Line.new("").indent.should eql(0) Orgmode::Line.new(" a").indent.should eql(1) Orgmode::Line.new(" ").indent.should eql(0) Orgmode::Line.new(" \n").indent.should eql(0) Orgmode::Line.new(" a").indent.should eql(3) end it "should return paragraph type" do Orgmode::Line.new("").paragraph_type.should eql(:blank) Orgmode::Line.new("1. foo").paragraph_type.should eql(:list_item) Orgmode::Line.new("- [ ] checkbox").paragraph_type.should eql(:list_item) Orgmode::Line.new("hello!").paragraph_type.should eql(:paragraph) end it "should recognize BEGIN and END comments" do begin_examples = { "#+BEGIN_SRC emacs-lisp -n -r\n" => "SRC", "#+BEGIN_EXAMPLE" => "EXAMPLE", "\t#+BEGIN_QUOTE " => "QUOTE" } end_examples = { "#+END_SRC" => "SRC", "#+END_EXAMPLE" => "EXAMPLE", "\t#+END_QUOTE " => "QUOTE" } begin_examples.each_key do |str| line = Orgmode::Line.new str line.begin_block?.should be_true line.block_type.should eql(begin_examples[str]) end end_examples.each_key do |str| line = Orgmode::Line.new str line.end_block?.should be_true line.block_type.should eql(end_examples[str]) end end pending "should accept assigned types" do cases = { "# this looks like a comment" => :comment, " 1. This looks like an ordered list" => :ordered_list, " - this looks like an # unordered list" => :unordered_list, " | one | two | table! | \n" => :table_row, "\n" => :blank, " |-----+-----+--------| \n" => :table_separator } end it "should parse in-buffer settings" do cases = { "#+ARCHIVE: %s_done" => { :key => "ARCHIVE", :value => "%s_done" }, "#+CATEGORY: foo" => { :key => "CATEGORY", :value => "foo"}, "#+BEGIN_EXAMPLE:" => { :key => "BEGIN_EXAMPLE", :value => "" }, "#+A:" => { :key => "A", :value => "" } # Boundary: Smallest keyword is one letter } cases.each_pair do |key, value| l = Orgmode::Line.new key l.in_buffer_setting?.should be_true called = nil l.in_buffer_setting? do |k, v| k.should eql(value[:key]) v.should eql(value[:value]) called = true end called.should be_true end end it "should reject ill-formed settings" do cases = [ "##+ARCHIVE: blah", "#CATEGORY: foo", "", "\n", " #+BEGIN_EXAMPLE:\n" ] cases.each do |c| l = Orgmode::Line.new c l.in_buffer_setting?.should be_nil end end end ruby-org-0.8.0/spec/output_buffer_spec.rb000066400000000000000000000014331210571107600204500ustar00rootroot00000000000000require 'spec_helper' describe Orgmode::OutputBuffer do it "computes outline level numbering" do output_buffer = Orgmode::OutputBuffer.new "" output_buffer.get_next_headline_number(1).should eql("1") output_buffer.get_next_headline_number(1).should eql("2") output_buffer.get_next_headline_number(1).should eql("3") output_buffer.get_next_headline_number(1).should eql("4") output_buffer.get_next_headline_number(2).should eql("4.1") output_buffer.get_next_headline_number(2).should eql("4.2") output_buffer.get_next_headline_number(1).should eql("5") output_buffer.get_next_headline_number(2).should eql("5.1") output_buffer.get_next_headline_number(2).should eql("5.2") output_buffer.get_next_headline_number(4).should eql("5.2.0.1") end end ruby-org-0.8.0/spec/parser_spec.rb000066400000000000000000000157621210571107600170650ustar00rootroot00000000000000require 'spec_helper' describe Orgmode::Parser do it "should open ORG files" do parser = Orgmode::Parser.load(RememberFile) end it "should fail on non-existant files" do lambda { parser = Orgmode::Parser.load("does-not-exist.org") }.should raise_error end it "should load all of the lines" do parser = Orgmode::Parser.load(RememberFile) parser.lines.length.should eql(53) end it "should find all headlines" do parser = Orgmode::Parser.load(RememberFile) parser.should have(12).headlines end it "can find a headline by index" do parser = Orgmode::Parser.load(RememberFile) parser.headlines[1].line.should eql("** YAML header in Webby\n") end it "should determine headline levels" do parser = Orgmode::Parser.load(RememberFile) parser.headlines[0].level.should eql(1) parser.headlines[1].level.should eql(2) end it "should put body lines in headlines" do parser = Orgmode::Parser.load(RememberFile) parser.headlines[0].should have(1).body_lines parser.headlines[1].should have(7).body_lines end it "should understand lines before the first headline" do parser = Orgmode::Parser.load(FreeformFile) parser.should have(19).header_lines end it "should load in-buffer settings" do parser = Orgmode::Parser.load(FreeformFile) parser.should have(12).in_buffer_settings parser.in_buffer_settings["TITLE"].should eql("Freeform") parser.in_buffer_settings["EMAIL"].should eql("bdewey@gmail.com") parser.in_buffer_settings["LANGUAGE"].should eql("en") end it "should understand OPTIONS" do parser = Orgmode::Parser.load(FreeformFile) parser.should have(19).options parser.options["TeX"].should eql("t") parser.options["todo"].should eql("t") parser.options["\\n"].should eql("nil") parser.export_todo?.should be_true parser.options.delete("todo") parser.export_todo?.should be_false end it "should skip in-buffer settings inside EXAMPLE blocks" do parser = Orgmode::Parser.load(FreeformExampleFile) parser.should have(0).in_buffer_settings end it "should return a textile string" do parser = Orgmode::Parser.load(FreeformFile) parser.to_textile.should be_kind_of(String) end it "should understand export table option" do fname = File.join(File.dirname(__FILE__), %w[html_examples skip-table.org]) data = IO.read(fname) p = Orgmode::Parser.new(data) p.export_tables?.should be_false end context "with a table that begins with a separator line" do let(:parser) { Orgmode::Parser.new(data) } let(:data) { Pathname.new(File.dirname(__FILE__)).join('data', 'tables.org').read } it "should parse without errors" do parser.headlines.size.should == 2 end end describe "Custom keyword parser" do fname = File.join(File.dirname(__FILE__), %w[html_examples custom-todo.org]) p = Orgmode::Parser.load(fname) valid_keywords = %w[TODO INPROGRESS WAITING DONE CANCELED] invalid_keywords = %w[TODOX todo inprogress Waiting done cANCELED NEXT |] valid_keywords.each do |kw| it "should match custom keyword #{kw}" do (kw =~ p.custom_keyword_regexp).should be_true end end invalid_keywords.each do |kw| it "should not match custom keyword #{kw}" do (kw =~ p.custom_keyword_regexp).should be_nil end end it "should not match blank as a custom keyword" do ("" =~ p.custom_keyword_regexp).should be_nil end end describe "Custom include/exclude parser" do fname = File.join(File.dirname(__FILE__), %w[html_examples export-tags.org]) p = Orgmode::Parser.load(fname) it "should load tags" do p.should have(2).export_exclude_tags p.should have(1).export_select_tags end end describe "Export to Textile test cases" do data_directory = File.join(File.dirname(__FILE__), "textile_examples") org_files = File.expand_path(File.join(data_directory, "*.org" )) files = Dir.glob(org_files) files.each do |file| basename = File.basename(file, ".org") textile_name = File.join(data_directory, basename + ".textile") textile_name = File.expand_path(textile_name) it "should convert #{basename}.org to Textile" do expected = IO.read(textile_name) expected.should be_kind_of(String) parser = Orgmode::Parser.new(IO.read(file)) actual = parser.to_textile actual.should be_kind_of(String) actual.should == expected end end end describe "Export to HTML test cases" do # Dynamic generation of examples from each *.org file in html_examples. # Each of these files is convertable to HTML. data_directory = File.join(File.dirname(__FILE__), "html_examples") org_files = File.expand_path(File.join(data_directory, "*.org" )) files = Dir.glob(org_files) files.each do |file| basename = File.basename(file, ".org") textile_name = File.join(data_directory, basename + ".html") textile_name = File.expand_path(textile_name) it "should convert #{basename}.org to HTML" do expected = IO.read(textile_name) expected.should be_kind_of(String) parser = Orgmode::Parser.new(IO.read(file)) actual = parser.to_html actual.should be_kind_of(String) actual.should == expected end it "should render #{basename}.org to HTML using Tilt templates" do expected = IO.read(textile_name) template = Tilt.new(file).render template.should == expected end end end describe "Export to HTML test cases with code syntax highlight" do code_syntax_examples_directory = File.join(File.dirname(__FILE__), "html_code_syntax_highlight_examples") # Include the code syntax highlight support tests if defined? CodeRay # Use CodeRay for syntax highlight (pure Ruby solution) org_files = File.expand_path(File.join(code_syntax_examples_directory, "*-coderay.org")) elsif defined? Pygments # Use pygments (so that it works with Jekyll, Gollum and possibly Github) org_files = File.expand_path(File.join(code_syntax_examples_directory, "*-pygments.org")) else # Do not use syntax coloring for source code blocks org_files = File.expand_path(File.join(code_syntax_examples_directory, "*-no-color.org")) end files = Dir.glob(org_files) files.each do |file| basename = File.basename(file, ".org") textile_name = File.join(code_syntax_examples_directory, basename + ".html") textile_name = File.expand_path(textile_name) it "should convert #{basename}.org to HTML" do expected = IO.read(textile_name) expected.should be_kind_of(String) parser = Orgmode::Parser.new(IO.read(file)) actual = parser.to_html actual.should be_kind_of(String) actual.should == expected end it "should render #{basename}.org to HTML using Tilt templates" do expected = IO.read(textile_name) template = Tilt.new(file).render template.should == expected end end end end ruby-org-0.8.0/spec/regexp_helper_spec.rb000066400000000000000000000035321210571107600204120ustar00rootroot00000000000000require 'spec_helper' describe Orgmode::RegexpHelper do it "should recognize simple markup" do e = Orgmode::RegexpHelper.new total = 0 e.match_all("/italic/") do |border, string| border.should eql("/") string.should eql("italic") total += 1 end total.should eql(1) total = 0 borders = %w[* / ~] strings = %w[bold italic verbatim] e.match_all("This string contains *bold*, /italic/, and ~verbatim~ text.")\ do |border, str| border.should eql(borders[total]) str.should eql(strings[total]) total += 1 end total.should eql(3) end it "should not get confused by links" do e = Orgmode::RegexpHelper.new total = 0 # Make sure the slashes in these links aren't treated as italics e.match_all("[[http://www.bing.com/twitter]]") do |border, str| total += 1 end total.should eql(0) end it "should correctly perform substitutions" do e = Orgmode::RegexpHelper.new map = { "*" => "strong", "/" => "i", "~" => "code" } n = e.rewrite_emphasis("This string contains *bold*, /italic/, and ~verbatim~ text.") do |border, str| "<#{map[border]}>#{str}" end n = e.restore_code_snippets n n.should eql("This string contains bold, italic, and verbatim text.") end it "should allow link rewriting" do e = Orgmode::RegexpHelper.new str = e.rewrite_links("[[http://www.bing.com]]") do |link,text| text ||= link "\"#{text}\":#{link}" end str.should eql("\"http://www.bing.com\":http://www.bing.com") str = e.rewrite_links("") do |link| "\"#{link}\":#{link}" end str.should eql("\"http://www.google.com\":http://www.google.com") end end # describe Orgmode::RegexpHelper ruby-org-0.8.0/spec/spec_helper.rb000066400000000000000000000010241210571107600170320ustar00rootroot00000000000000require 'org-ruby' RememberFile = File.join(File.dirname(__FILE__), %w[data remember.org]) FreeformFile = File.join(File.dirname(__FILE__), %w[data freeform.org]) FreeformExampleFile = File.join(File.dirname(__FILE__), %w[data freeform-example.org]) RSpec.configure do |config| # == Mock Framework # # RSpec uses it's own mocking framework by default. If you prefer to # use mocha, flexmock or RR, uncomment the appropriate line: # # config.mock_with :mocha # config.mock_with :flexmock # config.mock_with :rr end ruby-org-0.8.0/spec/textile_examples/000077500000000000000000000000001210571107600175735ustar00rootroot00000000000000ruby-org-0.8.0/spec/textile_examples/block_code.org000066400000000000000000000011521210571107600223670ustar00rootroot00000000000000* Block Code I need to get block code examples working. In =orgmode=, they look like this: #+BEGIN_EXAMPLE def initialize(output) @output = output @buffer = "" @output_type = :start @list_indent_stack = [] @paragraph_modifier = nil @logger = Logger.new(STDERR) @logger.level = Logger::WARN end #+END_EXAMPLE And now I should be back to normal text. Putting in another paragraph for good measure. Code should also get cancelled by a list, thus: #+BEGIN_EXAMPLE This is my code! Another line! #+END_EXAMPLE - My list should cancel this. - Another list line. ruby-org-0.8.0/spec/textile_examples/block_code.textile000066400000000000000000000011031210571107600232520ustar00rootroot00000000000000h1. Block Code p. I need to get block code examples working. In @orgmode@, they look like this: bc. def initialize(output) @output = output @buffer = "" @output_type = :start @list_indent_stack = [] @paragraph_modifier = nil @logger = Logger.new(STDERR) @logger.level = Logger::WARN end p. And now I should be back to normal text. p. Putting in another paragraph for good measure. p. Code should also get cancelled by a list, thus: bc. This is my code! Another line! * My list should cancel this. * Another list line. ruby-org-0.8.0/spec/textile_examples/blockquote.org000066400000000000000000000002261210571107600224540ustar00rootroot00000000000000BLOCKQUOTE Testing that I can have block quotes: #+BEGIN_QUOTE /Example:/ This is blockquote text. #+END_QUOTE And now I'm back to normal text! ruby-org-0.8.0/spec/textile_examples/blockquote.textile000066400000000000000000000002171210571107600233430ustar00rootroot00000000000000p. BLOCKQUOTE p. Testing that I can have block quotes: bq. _Example:_ bq. This is blockquote text. p. And now I'm back to normal text! ruby-org-0.8.0/spec/textile_examples/center.org000066400000000000000000000001161210571107600215620ustar00rootroot00000000000000#+TITLE: Fou not center #+BEGIN_CENTER center #+END_CENTER not center, again ruby-org-0.8.0/spec/textile_examples/center.textile000066400000000000000000000000611210571107600224500ustar00rootroot00000000000000 p. not center p=. center p. not center, again ruby-org-0.8.0/spec/textile_examples/footnotes.org000066400000000000000000000004421210571107600223240ustar00rootroot00000000000000#+TITLE: Footnotes #+OPTIONS: f:t * Footnotes Using numbers [fn:0] Using letters and not defined in the footnote [fn:abc] Using letters and defined in the footnote [fn:abc:definition of abc] Defined in the footnote itself with markup [fn:1:*blub*] [fn:0] Definition of first footnote ruby-org-0.8.0/spec/textile_examples/footnotes.textile000066400000000000000000000004451210571107600232160ustar00rootroot00000000000000 h1. Footnotes p. Using numbers [0] p. Using letters and not defined in the footnote [1] p. Using letters and defined in the footnote [1] p. Defined in the footnote itself with markup [2] p. [0] Definition of first footnote fn0. DEFINITION NOT FOUND fn1. definition of abc fn2. *blub* ruby-org-0.8.0/spec/textile_examples/keywords.org000066400000000000000000000005251210571107600221550ustar00rootroot00000000000000KEYWORDS By default, I don't want keywords exported to textile. * DONE Recognize standard keywords CLOSED: [2009-12-21 Mon 15:23] The standard =orgmode= keywords are TODO and DONE. Recognize those. * TODO Recongize buffer-specific keywords There's a way to define a custom keyword list in a buffer. Research that and handle it. ruby-org-0.8.0/spec/textile_examples/keywords.textile000066400000000000000000000004641210571107600230460ustar00rootroot00000000000000p. KEYWORDS p. By default, I don't want keywords exported to textile. h1. Recognize standard keywords p. The standard @orgmode@ keywords are TODO and DONE. Recognize those. h1. Recongize buffer-specific keywords p. There's a way to define a custom keyword list in a buffer. Research that and handle it. ruby-org-0.8.0/spec/textile_examples/links.org000066400000000000000000000003501210571107600214220ustar00rootroot00000000000000LINKS [[http://www.bing.com]] * Supported Link Styles - [[http://www.hotmail.com]] => Simple - [[http://www.hotmail.com][Hotmail]] => With link text - [[http://url/with spaces][with spaces]] - [[http://url/with spaces]] ruby-org-0.8.0/spec/textile_examples/links.textile000066400000000000000000000004411210571107600223120ustar00rootroot00000000000000p. LINKS p. "http://www.bing.com":http://www.bing.com h1. Supported Link Styles * "http://www.hotmail.com":http://www.hotmail.com => Simple * "Hotmail":http://www.hotmail.com => With link text * "with spaces":http://url/with%20spaces * "http://url/with spaces":http://url/with%20spaces ruby-org-0.8.0/spec/textile_examples/lists.org000066400000000000000000000027211210571107600214440ustar00rootroot00000000000000* Lists I want to make sure I have great support for lists. - This is an unordered list - This continues the unordered list And this is a paragraph *after* the list. ** Wrapping within the list - This is a single-line list item in the org file. - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. - And this is the next item. The previous item needs to be on one line to keep =textile= happy. - Ditto the previous line, actually. ** Edge cases - This is a single-line list. And this is a *separate paragraph.* Note the indentation in the org file. ruby-org-0.8.0/spec/textile_examples/lists.textile000066400000000000000000000025761210571107600223430ustar00rootroot00000000000000h1. Lists p. I want to make sure I have great support for lists. * This is an unordered list * This continues the unordered list p. And this is a paragraph *after* the list. h2. Wrapping within the list * This is a single-line list item in the org file. * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * And this is the next item. The previous item needs to be on one line to keep @textile@ happy. * Ditto the previous line, actually. h2. Edge cases * This is a single-line list. p. And this is a *separate paragraph.* Note the indentation in the org file. ruby-org-0.8.0/spec/textile_examples/single-space-plain-list.org000066400000000000000000000007041210571107600247310ustar00rootroot00000000000000** Anatomy of a BVP Each BVP followed a simple, one-page template with the following parts: - Customer Summary - Storyboard - Requirements - Partner teams The following sections walk through each section and give an example from one of our BVPs, [[http://windows/hyper-v/initiatives/Value Propositions/DynamicDatacenter-ValueProp.docx][Resource-Smart Virtualization Infrastructure]] (also called /Dynamic Datacenter/). ruby-org-0.8.0/spec/textile_examples/single-space-plain-list.textile000066400000000000000000000006541210571107600256240ustar00rootroot00000000000000h2. Anatomy of a BVP p. Each BVP followed a simple, one-page template with the following parts: * Customer Summary * Storyboard * Requirements * Partner teams p. The following sections walk through each section and give an example from one of our BVPs, "Resource-Smart Virtualization Infrastructure":http://windows/hyper-v/initiatives/Value%20Propositions/DynamicDatacenter-ValueProp.docx (also called _Dynamic Datacenter_). ruby-org-0.8.0/spec/textile_examples/tables.org000066400000000000000000000017751210571107600215700ustar00rootroot00000000000000TABLES Different types of ORG tables. * Simple table, no header. | Cell one | Cell two | | Cell three | Cell four | * Indented table | Cell one | | Cell two | And here's some paragraph content. The line breaks will need to get removed here, but not for the tables. * Table with header | One | Two | Three | |-------+-------+-------| | Four | Five | Six | | Seven | Eight | Nine | The separator row should not get printed out. * Table with complete box |-------+-------+-------| | One | Two | Three | |-------+-------+-------| | Four | Five | Six | | Seven | Eight | Nine | |-------+-------+-------| Only the first row should be a header row. * Table with extra lines |-------+--------+--------| | One | Two | Three | |-------+--------+--------| | Four | Five | Six | | Seven | Eight | Nine | |-------+--------+--------| | Ten | Eleven | Twelve | |-------+--------+--------| Only the first row should be a header row. ruby-org-0.8.0/spec/textile_examples/tables.textile000066400000000000000000000014171210571107600224500ustar00rootroot00000000000000p. TABLES p. Different types of ORG tables. h1. Simple table, no header. | Cell one | Cell two | | Cell three | Cell four | h1. Indented table | Cell one | | Cell two | p. And here's some paragraph content. The line breaks will need to get removed here, but not for the tables. h1. Table with header | One | Two | Three | | Four | Five | Six | | Seven | Eight | Nine | p. The separator row should not get printed out. h1. Table with complete box | One | Two | Three | | Four | Five | Six | | Seven | Eight | Nine | p. Only the first row should be a header row. h1. Table with extra lines | One | Two | Three | | Four | Five | Six | | Seven | Eight | Nine | | Ten | Eleven | Twelve | p. Only the first row should be a header row. ruby-org-0.8.0/spec/textile_output_buffer_spec.rb000066400000000000000000000013711210571107600222070ustar00rootroot00000000000000require 'spec_helper' describe Orgmode::TextileOutputBuffer do it "should substitute / with _" do Orgmode::TextileOutputBuffer.new("").inline_formatting("/italic/").should eql("_italic_") end it "should convert simple links" do Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com]]").should \ eql("\"http://www.google.com\":http://www.google.com") end it "should convert links with text" do Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com][Google]]").should \ eql("\"Google\":http://www.google.com") end it "should convert spaces in urls" do Orgmode::TextileOutputBuffer.new("").inline_formatting("[[my url]]").should eql("\"my url\":my%20url") end end ruby-org-0.8.0/tasks/000077500000000000000000000000001210571107600144125ustar00rootroot00000000000000ruby-org-0.8.0/tasks/test_case.rake000066400000000000000000000073511210571107600172360ustar00rootroot00000000000000require 'org-ruby' namespace :testcase do @data_directory = File.join(File.dirname(__FILE__), "../spec/html_examples") desc "List all of the current HTML test cases" task :list do org_files = File.expand_path(File.join(@data_directory, "*.org" )) files = Dir.glob(org_files) files.each do |file| puts File.basename(file, ".org") end end desc "Accept the current org-ruby output for the test case as correct" task :accept, :case do |t, args| basename = args[:case] raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename fname = File.expand_path(File.join(@data_directory, "#{basename}.org")) oname = File.expand_path(File.join(@data_directory, "#{basename}.html")) data = IO.read(fname) puts "=== #{fname} is: ===>>>\n\n" puts data puts "\n\n=== ACCEPTING OUTPUT: ===>>>\n\n" p = Orgmode::Parser.new(data) puts p.to_html File.open(oname, "w") do |s| s.write(p.to_html) end end desc "Look at the current org-ruby output for a test case" task :inspect, :case do |t, args| basename = args[:case] raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename fname = File.expand_path(File.join(@data_directory, "#{basename}.org")) data = IO.read(fname) puts "=== #{fname} is: ===>>>\n\n" puts data puts "\n\n=== #{fname} converts to: ===>>>\n\n" p = Orgmode::Parser.new(data) puts p.to_html end # Special namespace to test syntax highlighting with different technologies namespace :highlight do @code_syntax_examples_directory = File.join(File.dirname(__FILE__), "../spec/html_code_syntax_highlight_examples") desc "List all of the current HTML test cases" task :list do org_files = File.expand_path(File.join(@code_syntax_examples_directory, "*.org" )) files = Dir.glob(org_files) files.each do |file| puts File.basename(file, ".org") end end desc "Special tests cases for code syntax highlight support" task :accept, :case do |t, args| basename = args[:case] raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename fname = File.expand_path(File.join(@code_syntax_examples_directory, "#{basename}.org")) oname = File.expand_path(File.join(@code_syntax_examples_directory, "#{basename}.html")) data = IO.read(fname) puts "=== #{fname} is: ===>>>\n\n" puts data puts "\n\n=== ACCEPTING OUTPUT: ===>>>\n\n" p = Orgmode::Parser.new(data) puts p.to_html File.open(oname, "w") do |s| s.write(p.to_html) end end desc "Inspect code syntax highlight support" task :inspect, :case do |t, args| basename = args[:case] raise "Must supply a test case name. Example: rake testcase:inspecthighlight[casename]" unless basename fname = File.expand_path(File.join(@code_syntax_examples_directory, "#{basename}.org")) data = IO.read(fname) puts "=== #{fname} is: ===>>>\n\n" puts data puts "\n\n=== #{fname} converts to: ===>>>\n\n" p = Orgmode::Parser.new(data) puts p.to_html end end end desc "Alias for testcase:list" task :testcase => ["testcase:list"] task :test do puts "Testing without CodeRay nor Pygments for code syntax highlight" system('bundle --without pygments:coderay > /dev/null 2>&1') system('bundle exec rake spec') puts "Testing with CodeRay for code syntax highlight" system('bundle --without pygments > /dev/null 2>&1') system('bundle exec rake spec') puts "Testing with Pygments for code syntax highlight" system('bundle --without coderay > /dev/null 2>&1') system('bundle exec rake spec') end ruby-org-0.8.0/util/000077500000000000000000000000001210571107600142425ustar00rootroot00000000000000ruby-org-0.8.0/util/gen-special-replace.el000066400000000000000000000041261210571107600203670ustar00rootroot00000000000000;; This code creates ruby code to replace special symbols with the corresponding utf8/html code (require 'org-entities) (defvar gen-use-entities-user t) (defvar gen-file-name "replace-entities.rb") (defun generate-replace-inbuffer (what) (let ((ll (if gen-use-entities-user (append org-entities-user org-entities) org-entities)) (to (if (string= what "html") 3 6))) ; use utf8 for textile (insert " " (capitalize what) "Entities = {\n" (mapconcat (lambda (entity) (let ((symb (nth to entity))) ;; escape backslashes and quotation marks (setq symb (replace-regexp-in-string "\\(\\\\\\|\\\"\\)" "\\\\\\&" symb)) ;; escape percent marks from further formatting (setq symb (replace-regexp-in-string "%" "%%" symb)) (concat " \"" (car entity) "\" => \"" symb "\""))) (remove-if-not 'listp ll) ",\n") "\n }\n"))) (defun generate-replace-header (what) (insert "# Autogenerated by util/gen-special-replace.el\n\n" "module Orgmode\n")) (defun generate-replace-footer (what) (insert " @org_entities_regexp = /\\\\(there4|sup[123]|frac[13][24]|[a-zA-Z]+)($|\\{\\}|[^a-zA-Z])/\n\n" " def Orgmode.special_symbols_to_" what " str\n" " str.gsub! @org_entities_regexp do |match|\n" " if " (capitalize what) "Entities[$1]\n" " if $2 == \"{}\" then \"#{" (capitalize what) "Entities[$1]}\"\n" " else \"#{" (capitalize what) "Entities[$1]}#{$2}\"\n" " end\n" " else\n" " $&\n" " end\n" " end\n" " end\n" "end # module Orgmode\n")) (defun generate-replace (file-name what) (let ((file (expand-file-name file-name))) (with-temp-buffer (generate-replace-header what) (generate-replace-inbuffer what) (generate-replace-footer what) (write-file file)))) (generate-replace "../lib/org-ruby/html_symbol_replace.rb" "html") (generate-replace "../lib/org-ruby/textile_symbol_replace.rb" "textile")