[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Org mode and "shunt" exporters?
From: |
Eric Schulte |
Subject: |
Re: [O] Org mode and "shunt" exporters? |
Date: |
Thu, 05 Dec 2013 19:10:00 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Brett Viren <address@hidden> writes:
> 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.
You can use `org-element-parse-buffer' to convert an Emacs Buffer to a
structured Emacs Lisp object. At that point you can use existing tools
for converting lisp to JSON or YAML. I've used cl-json for Common Lisp,
I would imagine something similar exists for Emacs Lisp.
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D
- [O] Org mode and "shunt" exporters?, Brett Viren, 2013/12/05
- Re: [O] Org mode and "shunt" exporters?,
Eric Schulte <=
- Re: [O] Org mode and "shunt" exporters?, Brett Viren, 2013/12/09
- Re: [O] Org mode and "shunt" exporters?, Nicolas Goaziou, 2013/12/09
- Re: [O] Org mode and "shunt" exporters?, Brett Viren, 2013/12/13
- Re: [O] Org mode and "shunt" exporters?, Nicolas Goaziou, 2013/12/13
- Re: [O] Org mode and "shunt" exporters?, Eric Schulte, 2013/12/13
- Re: [O] Org mode and "shunt" exporters?, Brett Viren, 2013/12/13
Re: [O] Org mode and "shunt" exporters?, John Kitchin, 2013/12/06