[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Google Summer of Code -- 3 Org projects for our first participat
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Google Summer of Code -- 3 Org projects for our first participation! |
Date: |
Sat, 05 May 2012 11:36:59 +0200 |
Hello,
Neil Smithline <address@hidden> writes:
> I've looked at org-element.el and don't really see how it will make writing
> other Org Mode to HTML converter easier. org-element.el is, well it's
> elisp. Very elispy. No surprise but I'm not sure that it can easily be
> converted to another language.
>
> Is Nicolas working from a grammar?
Since org-element can parse 98%[1] of Org syntax, there must be
a grammar defined somewhere. When I started org-element, there was no
structural definition of Org syntax (there wasn't even a full list of
syntactic objects). Now, org-element is the grammar embodied in elisp.
Alas, I have no plan to formalize it. Though, I agree that it would be
a great thing to have in order to implement equivalent parsers in other
languages.
If someone wants to study org-element and extract a formal grammar out
of it, I will gladly help him in the process.
Otherwise, you can use the intermediary representation of an Org
document. org-element can produce the representation and read the
representation to produce an Org document.
#+begin_src emacs-lisp
(org-element-interpret-data
'(org-data
nil
(headline
(:level 1 :title ("It works") :priority ?A :todo-keyword "TODO" :tags
("test"))
(section
nil
(center-block
nil
(paragraph nil "Really"))))))
#+end_src
Thus, you may only need to write converters from that representation to
another syntax (like HTML). That's the purpose of org-export and its
back-ends.
Regards,
[1] I still don't know what to do with "under\_line": there is no
`kludge' object type so far (!).
--
Nicolas Goaziou