Code Monkey home page Code Monkey logo

org-parse-old's Introduction

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.

org-parse-old's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.