This project is still under development but you can already test this parser and code generator if you want :)
Currently the library contains only a Python-based implementation of the org-mode parser and code generator.
The usage of this library is very simple. Just import the libOrg class and
call the constructor with a file name.
import libOrg from libOrg orgfile = libOrg( "<PATH-TO-AN-ORG-FILE>" )
Now the file is already parsed and can be generated to the desired format.
Just call the method generate and pass a file stream parameter and libOrg
does the rest. By default the generate method exports to HTML.
import sys orgfile.generate( sys.stdout )
You want to export to a different language? No problem! libOrg is designed
very flexible and currently it defines an export format to HTML and LaTeX.
And it is very easy to adopted, change or even create new export formats
for libOrg.
Here is another example where a parsed org file is generated to a temporary
file with the LaTeX exporter.
import io
with io.open( "out.tex" , "w" ) as fd:
orgfile.generate( fd, emit = libOrg.LATEX )
I will provide more export formats in the future but currently the focus is
only on the HTML and the LaTeX export format.
A fully list of all features is coming soon!
In the var folder you can find a quick example org-mode file which was translated to HTML and LaTeX. Furthermore, the LaTeX file was compiled to a PDF file.
The copyright holder of liborg is Philipp Paulweber (@ppaulweber) and the used license of libstdhl is a GNU GPLv3+ with an additional permission (“GPL Linking Exception”).