From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Org mode and "shunt" exporters? Date: Fri, 6 Dec 2013 08:02:24 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5d856dee91c704ecdd41ed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vov36-00083y-Ol for emacs-orgmode@gnu.org; Fri, 06 Dec 2013 08:02:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vov35-0005Kk-37 for emacs-orgmode@gnu.org; Fri, 06 Dec 2013 08:02:28 -0500 Received: from mail-pb0-x231.google.com ([2607:f8b0:400e:c01::231]:38759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vov34-0005Ka-Nd for emacs-orgmode@gnu.org; Fri, 06 Dec 2013 08:02:27 -0500 Received: by mail-pb0-f49.google.com with SMTP id jt11so1029989pbb.22 for ; Fri, 06 Dec 2013 05:02:25 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Brett Viren Cc: "emacs-orgmode@gnu.org" --047d7b5d856dee91c704ecdd41ed Content-Type: text/plain; charset=ISO-8859-1 that sounds like an interesting approach. xml seems like what you really want, since looking at the parsetree there is a lot of information (e.g. attributes, properties, etc...) that would be tricky to generate a fully representative json scheme. This page suggests at the bottom you could export to texinfo, and convert that to docbook: http://orgmode.org/worg/exporters/ox-overview.html - (1) DocBook export, available in previous Org-mode versions, has not currently been ported to the new exporter, however the new ox-texinfobackend can generate DocBook format. Once file.texi is created via ox-texinfo, simply execute: makeinfo --docbook file.texi John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Thu, Dec 5, 2013 at 3:30 PM, Brett Viren wrote: > Has anyone written any new-style exporter which will produce a common > markup/data language format like JSON or YAML? I'm looking for > something that fully preserves the original org document structure and > does no semantic interpretation along the way. > > What I really want is to parse arbitrary org files in Python. I've > looked at the entries at worg's "org-tool" node which do this but they > seem out of date or make assumptions about what org elements exist or > their URLs are not loading (NEO). If any of that's a misrepresentation > please correct me. > > In any case, using org's own exporter to produce JSON or YAML and then > relying on these format's Python modules for parsing seems like the best > way to go to let me author in org and process in Python. > > I'm not very good with elisp (which is why I want to get org data into > Python) but I guess I can have a go at making such a "shunt" exporter. > Before I try, I just wanted to check if someone had this wheel already > spinning. > > Thanks, > -Brett. > --047d7b5d856dee91c704ecdd41ed Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
that sounds like an interesting approach. xml seems l= ike what you really want, since looking at the parsetree there is a lot of = information (e.g. attributes, properties, etc...) that would be tricky to g= enerate a fully representative json scheme.

This page suggests at the bottom you could export to texinfo, and conve= rt that to docbook:
http://orgmode.org/worg/exporters/ox-overview.html

  • (1) DocBook export, available in previous Org-mode versi= ons, has not currently been ported to the new exporter, however the new ox-texinfo backend can ge= nerate DocBook format. Once file.texi is created via ox-texinfo,= simply execute:
makeinfo --docbook file.texi
=



John

-----= ------------------------------
John Kitchin
Associate Professor
Do= herty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsbu= rgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Thu, Dec 5, 2013 at 3:30 PM, Brett Vi= ren <b= v@bnl.gov> wrote:
Has anyone written any new-style exporter which will produce a common
markup/data language format like JSON or YAML? =A0I'm looking for
something that fully preserves the original org document structure and
does no semantic interpretation along the way.

What I really want is to parse arbitrary org files in Python. =A0I've looked at the entries at worg's "org-tool" node which do this= but they
seem out of date or make assumptions about what org elements exist or
their URLs are not loading (NEO). =A0If any of that's a misrepresentati= on
please correct me.

In any case, using org's own exporter to produce JSON or YAML and then<= br> relying on these format's Python modules for parsing seems like the bes= t
way to go to let me author in org and process in Python.

I'm not very good with elisp (which is why I want to get org data into<= br> Python) but I guess I can have a go at making such a "shunt" expo= rter.
Before I try, I just wanted to check if someone had this wheel already
spinning.

Thanks,
-Brett.

--047d7b5d856dee91c704ecdd41ed--