[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Best way to include METAPOST in ConTeXt exporter
From: |
Ihor Radchenko |
Subject: |
Re: Best way to include METAPOST in ConTeXt exporter |
Date: |
Wed, 13 Oct 2021 14:51:49 +0800 |
Jason Ross <jasonross1024@gmail.com> writes:
> Here's a hook that modifies the source blocks to wrap their
> output in #+BEGIN/END_METAPOST tags if the ConTeXt backend is used,
> before Org Babel gets to them, but otherwise leaves them alone.
>
> I wonder if anyone has any better ideas of how to do this. I'm
> modifying the Org source with the hook before the document gets parsed
> so that it can be more backend-agnostic but it seems like it would
> be better if there was a way to modify the document parse tree
> directly instead. I don't like that I'm effectively parsing and
> rebuilding (hopefully) the same string in order to change the :result
> type.
I am not sure if there is an easy way. ob-exp gets run before backend
filters and you do not yet have access to the document parse tree.
You may consider a patch for ob-exp to get better control over code
execution during export.
Best,
Ihor