From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: a post-processing export hook? Date: Tue, 01 Dec 2015 19:50:49 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3vdI-0003IN-6A for emacs-orgmode@gnu.org; Tue, 01 Dec 2015 19:50:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3vdE-0002tP-Ug for emacs-orgmode@gnu.org; Tue, 01 Dec 2015 19:50:56 -0500 Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]:36760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3vdE-0002tI-QS for emacs-orgmode@gnu.org; Tue, 01 Dec 2015 19:50:52 -0500 Received: by qgcc31 with SMTP id c31so20991995qgc.3 for ; Tue, 01 Dec 2015 16:50:52 -0800 (PST) Received: from Johns-MacBook-Air.local (c-71-206-238-169.hsd1.pa.comcast.net. [71.206.238.169]) by smtp.gmail.com with ESMTPSA id e134sm183288qhc.49.2015.12.01.16.50.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 16:50:50 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode 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 could have used a filter on a paragraph, which is where most of the things I was modifying were. Is there some other way I could have done this? -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu