Sha256: 726199cbccb48b290cce0f0f24828a1228d032704f6fb4b7685a6559797bc799

Contents?: true

Size: 1.63 KB

Versions: 2

Compression:

Stored size: 1.63 KB

Contents

= org-parse

A library of Ruby which converts a document of Org-Mode into other formats.
http://orgmode.org/

I refer to cords of org-ruby. 
http://orgmode.org/worg/org-tutorials/org-ruby.php

== using gems
  ultraviolet (for syntax highlight)
  shoulda (for test)

== Usage

=== command line tool

Usage: org-parse [options] <file>
    -h, --help                       Show this message
    -f, --format FORMAT              Translate the ORG file to the specified format. html(default) or textile
    -t, --template TEMPLATE          Erb template to build the html output.

format
  html (default)
  textile

template
  Erb script.
   default: lib/org-parse/templates/single.html.erb
   
   variables
    * title -- document title
    * language -- document language
    * charset
    * add_to_head -- additional lines for <head> ... </head>
    * before_text -- Texts before first section( #+TEXT ...)
    * body -- body contents
    * footnotes -- footnote definitions
    * @options[] -- options

   function
    * table_of_contents

=== as libraly
    see bin/org-parse

    Get a parser 
      parser = OrgParse::StructParser.new(data, title)
        data: Org-Mode document (String)
        title: Document title (Optional)
    Do parse
      root = parser.parse
    Get a visitor 
      visitor = OrgParse::HtmlVisitor.new(root, template)
             or
      visitor = OrgParse::TextileVisitor.new(root)

      template is optional. default is lib/org-parse/templates/single.html.erb
    Build output
      visitor.build

=== todo
  * write documents
  * make tests
  * impilment meny functions...

== Copyright

Copyright (c) 2010 knb. See LICENSE for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
org-parse-0.1.2 README.rdoc
org-parse-0.1.1 README.rdoc