Project

org-parse

0.0
No commit activity in last 3 years
No release in over 3 years
This gem contains libraries for parsing org-mode files and build html or textile format file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

org-parse¶ ↑

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

I refer to cords of org-ruby. 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 © 2010 knb. See LICENSE for details.