emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] the "right way" to build OMPL export and import


From: Eric Abrahamsen
Subject: Re: [O] the "right way" to build OMPL export and import
Date: Fri, 26 Apr 2013 15:23:43 -0700
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
> Eric Abrahamsen <address@hidden> writes:
>
>> I'm not sure the general export engine is going to be of much use,
>> since XML is so completely flexible, but you'll definitely want to
>> build it on top of the internal parser.
>
> It would be a bad idea not to use the export framework, unless you want
> to reinvent the wheel (e.g., re-implementing skipping of :noexport:
> tags).
>
>> Luckily, the parser turns an org subtree into a parse tree, and the
>> function `xml-print' turns a parse tree into XML. They're not quite the
>> same parse tree, but I guess you'll want to do something like this:
>>
>>
>> #+BEGIN_SRC org
>>   ,* My Great Playlist
>>   ,** The Cold Cold Ground.mp3
>>   :PROPERTIES:
>>   :OPML_TYPE: song
>>   :OPML_F:   Tom Waits - The Cold Cold Ground
>>   :END:
>>   ,** Don't Eat the Yellow Snow.mp3
>>   :PROPERTIES:
>>   :OPML_TYPE: song
>>   :OPML_F:   Frank Zappa - Don't Eat the Yellow Snow
>>   :END:
>> #+END_SRC
>>
>>
>> |
>> |
>> org-element--parse-elements
>
> Please use `org-element-parse-buffer' instead. As the two consecutive
> hyphens suggest, this is an internal function.

I was hoping you'd jump in!

Would you suggest an export backend that only handles headlines (other
elements are a no-op)? I suppose you could just write org-opml-headline
to read properties and return XML chunks, and then you wouldn't have to
use `org-element-parse-buffer' at all.

E




reply via email to

[Prev in Thread] Current Thread [Next in Thread]