From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Shlyakhter Subject: Re: suggestion: "native" orgmode XML export (and import?) Date: Fri, 7 Aug 2009 11:46:57 +0200 Message-ID: <4b11f87e0908070246rc21ec59k99b0f6ddaac84be3@mail.gmail.com> References: <4b11f87e0908060754o7601aeb1uf9b8cebf44c29a24@mail.gmail.com> <1f38ae890908061457m7350ecfdw566e7ce9adc6f06e@mail.gmail.com> <1f38ae890908061458kc3d71fci7f944ae03c2400e@mail.gmail.com> <4b11f87e0908062305ue685293m633213469c47d0e8@mail.gmail.com> <1f38ae890908070213x1fabc9e3o75db945d9f86b2fa@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZM2S-0000kz-6L for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:47:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZM2N-0000ke-O8 for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:47:03 -0400 Received: from [199.232.76.173] (port=56281 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZM2N-0000kb-Fz for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:46:59 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:53834) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MZM2M-0007rc-U9 for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:46:59 -0400 Received: by ewy7 with SMTP id 7so1282798ewy.42 for ; Fri, 07 Aug 2009 02:46:58 -0700 (PDT) In-Reply-To: <1f38ae890908070213x1fabc9e3o75db945d9f86b2fa@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andrew Stribblehill Cc: emacs-orgmode That's great, thanks! I should be able to take it from there. It would be great if at some point this became official, and also included an XML exporter and specification. thanks, ilya On Fri, Aug 7, 2009 at 11:13 AM, Andrew Stribblehill wrote: > [re-adding the mailing list] > > No, EXPERIMENTAL/org-export.el. Here's what I did after M-x load-file > /path/to/org-export.el: > > (defun org-export-sexp (arg) > =A0(interactive "p") > =A0(let ((bufstr (org-export-parse arg))) > =A0 =A0(save-excursion > =A0 =A0 =A0(switch-to-buffer (get-buffer-create "*Org export*")) > =A0 =A0 =A0(erase-buffer) > =A0 =A0 =A0(insert (format "%s" bufstr))))) > > An org file such as: > ---- > Objectives > > * Q3 2009 > =A0 =A0:PROPERTIES: > =A0 =A0:SCORE: =A0 =A00.77 > =A0 =A0:END: > ** Operations > > *** [#0] Oncall. Keep the site up > *** [#1] Keep the tubes clear. > > ** Projects > ---- > > comes out as: > ((:level 1 > =A0:heading Q3 2009 > =A0:properties ((SCORE . 0.77) (CATEGORY . proj-sanitised)) > =A0:content :subtree > =A0((:level 2 > =A0 =A0:heading Operations > =A0 =A0:properties ((CATEGORY . proj-sanitised)) > =A0 =A0:content :subtree > =A0 =A0((:level 3 > =A0 =A0 =A0:heading Oncall. Keep the site up > =A0 =A0 =A0:properties ((PRIORITY . 0) (CATEGORY . proj-sanitised)) > =A0 =A0 =A0:content =A0:subtree nil) > =A0 =A0 (:level 3 > =A0 =A0 =A0:heading Keep the tubes clear. > =A0 =A0 =A0:properties ((PRIORITY . 1) (CATEGORY . proj-sanitised)) > =A0 =A0 =A0:content :subtree nil))) > =A0 (:level 2 > =A0 =A0:heading Projects > =A0 =A0:properties ((CATEGORY . proj-sanitised)) > =A0 =A0:content :subtree nil)))) > > 2009/8/7 Ilya Shlyakhter : >> Thanks for the pointer. =A0 Did you mean org-exp.el? =A0 How exactly do = I >> get the internal representation? >> thanks, >> ilya >> >> On Thu, Aug 6, 2009 at 11:58 PM, Andrew Stribblehill wro= te: >>> I notice the experimental org-export.el contains an internal representa= tion. >>> It would probably be very easy for your python to parse the lisp >>> s-expression it uses, if it were exported. >>> >>> On Aug 6, 2009 3:55 PM, "Ilya Shlyakhter" wrote= : >>> >>> I'm not an emacs-lisp programmer, but I'd like to write scripts >>> (ideally in Python) to generate custom reports from my .org files. >>> What would help a lot, is if there was a command to export an .org >>> file to a "native" XML format that would mirror the org file's >>> structure and all its logical elements (tags, properties, drawers, >>> dates etc). =A0 I know about the DocBook exporter, but it maps orgmode'= s >>> concepts onto DocBook concepts such as articles. =A0 I'm a longtime >>> orgmode user and it would be much simpler to write a program in terms >>> of the familiar org concepts (hierarchical entries, tags, properties >>> etc). >>> It would also be great if there was a way to import such an XML file >>> back into org. =A0Then one could e.g. take Toodledo.com tasks and >>> transform them into an orgmode file. >>> >>> There is an orgmode Python reader at >>> http://www.members.optusnet.com.au/~charles57/GTD/orgnode.html >>> and I plan to use that for now. =A0But it doesn't support all orgmode >>> features, and more importantly it does its own parsing of orgfiles (so >>> may not keep up with any future changes). =A0 Using orgmode's own >>> parser, and then exporting the results as XML, would be much more >>> reliable. >>> >>> ilya >>> >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Remember: use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>> >> >