OrgRuby

<img src=“https://secure.travis-ci.org/wallyqs/org-ruby.png?branch=master” alt=“Build Status” />

An Org mode parser written in Ruby.

Originally by Brian Dewey

Installation

gem install org-ruby

Usage

From Ruby:

require 'org-ruby'

# Renders HTML
Orgmode::Parser.new("* Hello world!").to_html
# => "<h1>Hello world!</h1>\n"

# Renders Textile
Orgmode::Parser.new("* Hello world!").to_textile
# => "h1. Hello world!\n" 

# Renders Markdown
Orgmode::Parser.new("* Hello world!").to_markdown
# => "# Hello world!\n"

The supported output exporters can be also called from the command line:

org-ruby --translate html     sample.org
org-ruby --translate textile  sample.org
org-ruby --translate markdown sample.org

Current status

Not all of the Org mode features are implemented yet. Currently, the development of the gem is mostly oriented towards giving support for exporting Org mode into other formats.

Brief list of features supported:

  • Converts Org mode files to HTML, Textile or Markdown.

  • Supports tables, block quotes, code blocks, and html blocks

  • Supports bold, italic, underline, strikethrough, and code inline formatting.

  • Supports hyperlinks

  • Supports lists

  • Supports footnotes

  • Supports .org views in Rails through Tilt.

  • Code syntax highlight of code blocks using Pygments.rb or Coderay when available

Contributing

  • If you see a feature missing, please create an issue so that the maintainer considers its implementation

  • Also, PRs are always welcome! Before submitting make sure to check what breaks by running rake spec

Projects using it

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.