emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] a post-processing export hook?


From: Rasmus
Subject: Re: [O] a post-processing export hook?
Date: Wed, 02 Dec 2015 12:33:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

John Kitchin <address@hidden> writes:

> Rasmus writes:
>
>> John Kitchin <address@hidden> writes:
>>
>>> Hi all,
>>>
>>> I tried using org-export-before-parsing-hook to modify an org-file prior
>>> to export to replace some regular expressions with html.
>>>
>>> I ran into the following issue. For short substitutions,
>>> @@html:replacement@@ worked fine. If the replacement text got too long,
>>> this broke. I did wrap it in a #+begin_html: block, but that introduced
>>> line breaks that were undesireable. The replacement text was long
>>> because I had a large tool tip to put on some text.
>>>
>>> I ended up doing a post-process like this:
>>>
>>> (with-current-buffer (org-html-export-as-html)
>>>   (org-process-key-bindings 'html)
>>>   (org-process-emacs-commands 'html)
>>>   (write-file "blog.html")
>>>   (browse-url "blog.html"))
>>>
>>> But, I wondered if there should be a post-export hook? I can see some
>>> challenge for pdf export, for example. The hook should run after the
>>> latex export, not after the pdf is made.
>>
>> I don't think your example warrant an extra hook.  Replacing strings is
>> something that org-export-filter-final-output-functions is perfectly
>> capable of doing IMO.  It’s a bit of a hassle to work with transcoded
>> strings, but having a hook would not change this.
>
> True enough. I tried it with a paragraph filter and it worked fine. I
> didn't know about the org-export-filter-final-output-functions, that is
> pretty much the hook I was looking for. Thanks,

OK.  Now OP makes more sense.  All filters are listed in:

   org-export-filters-alist

The documentation is mostly in the source of ox.el.

—Rasmus

-- 
Lasciate ogni speranza o voi che entrate: siete nella mani di'machellaio




reply via email to

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