jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.58k stars 3.38k forks source link

org-babel support for plantuml, dia, graphiviz and dot for example #3049

Closed timoc closed 8 years ago

timoc commented 8 years ago

Hi,

I would like to see pandoc support org-babel. Two features i would like to see are:

tarleb commented 8 years ago

This is related to #656. I wholeheartedly agree, this would be nice to have. It's a bit out of scope as far as Pandoc is concerned. One could probably hack something together using either a pandoc filter, panflute, a custom writer, or a separate tool altogether.

There is also the now defunct rundoc project, which I started a few years ago and which never made it past the good-intentions stage. The main reason for this is that babel is just so powerful and complex that it's difficult to get even remotely close. So I rather focused on improving the org reader instead.

If you find or hack something suitable, please do let us know.

timoc commented 8 years ago

I'm not necessarily talking about a full babel implementation processing the output and re-processing it in pandoc, or anything so drastic rather making pandoc both a pre-and post processor, so that say in a script i can:

# export babel src output for external processing.
pandoc --from babel --to src MAKEME.org -o makeme/
# choose the plantuml from the exported source and generate images for document
for plant in makeme/*.plantuml; do 
    plantuml $plant ./$plant.png
done;
# process org document to PDF - now with updated generated images
pandoc --from org --to pdf MAKEME.org -o makeme.pdf

I don't do haskel, so no help from me here, but it would need some measure of exclude/nonexclude support even if it is tags in the exported filename.

tarleb commented 8 years ago

Like I said, it is an important idea which could benefit many people, but it is out of scope for pandoc. If you know python, using the aforementioned panflute is probably the best choice for now. Otherwise you could also re-raise the issue at rundoc.