WARNING: the following code is a hack and doesn't meet many quality standards.˛

Hi

Emacs's org-mode is very convenient to organize and transform documents.

So when asked to produce 2 articles for the German Perl magazine $foo I started sketching and outlining ideas in org-mode.
But then I needed to produce a special POD format for printing

It was easier to hack the following script to just translate the markups I needed.

There are already ORG-Parsers on CPANš but I needed a lightweight solution which allows to mix in some POD markups, and to DWIM-add some other markups to facilitate the creative process.
It's far from being complete or error free, but fits my needs.

First, don't take these in any way as criticisms, but more as opportunities to make it process a larger subset of the org files out there.

I really like that it is simple and does not have prerequisites, so it is able to parse simple org files without a large footprint. That being said, my org files are very seldom simple, and I rely heavily on data within drawers, properties (node, tree, and global), among other things. Additionally, you have started the ball rolling with some actual code.

See lisp/org-exp.el, around line 2167 (barring any major updates) for a better pattern for the BEGIN_SRC line. It should allow an optional ':' after the BEGIN_SRC, and it is case insensitive.

The closest thing that I would have for an agenda would be to have a defined format for the org file itself. I would like to see the org community adopt a format for the org file, and a set of core functions (dealing with manipulating files, nodes, and properties) that behave in a defined fashion. Beyond that, it is basically up to the interface / library how it behaves based on the content of the file.

I see in rereading this that my comment about the source for the emacs regexp was misunderstood. I did not mean to imply that all of the other block types contained in that regexp should be parsed, I was only commenting on the possible formats that a "BEGIN_SRC" block could take.

The link to Org::Parser was a reference to the unlinked reference (now linked in a footnote), not an indicator that you should use it in this script.

The suggestion for github was to make it more readily able to have patches applied to it.

OT: Just as only perl can parse Perl, only org-mode can parse Org -- and Org is always changing. For simple documents, a simple script like this is great; for true Org translation, the way to go would be to export HTML or DocBook and work from there. IMHO, Org::Parser is doing it wrong: it's no longer simple, yet it will never truly parse Org.

you're so right! I was pondering to migrate the regexes from org.el and org-exp.el when I noticed that emphasizes are allowed to spread 2 lines
(actually the number of lines is customizable in "Org Emphasis Regexp Components")