From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: How to run a command after exporting agenda to HTML? Date: Wed, 10 Aug 2016 16:21:08 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134fa3e0c76570539ba0ac9 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXWFy-0002SY-Vi for emacs-orgmode@gnu.org; Wed, 10 Aug 2016 12:21:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXWFt-0005fz-MP for emacs-orgmode@gnu.org; Wed, 10 Aug 2016 12:21:22 -0400 Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:36637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXWFt-0005fM-GD for emacs-orgmode@gnu.org; Wed, 10 Aug 2016 12:21:21 -0400 Received: by mail-oi0-x231.google.com with SMTP id f189so65893226oig.3 for ; Wed, 10 Aug 2016 09:21:19 -0700 (PDT) In-Reply-To: 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" To: Christopher DeMarco , emacs-orgmode@gnu.org --001a1134fa3e0c76570539ba0ac9 Content-Type: text/plain; charset=UTF-8 See if this helps: (defun my-org-html-post-process (file) "Do stuff on FILE after it is created by org html export." ;; Do your stuff here (message "Exported file: %s" file) file) ; Has to return FILE (defun my-org-html-export-to-html (&optional async subtreep visible-only body-only ext-plist) "Pass `my-org-html-post-process' as POST-PROCESS arg to `org-export-to-file'. Rest of the code is the exact same as the original `org-html-export-to-html'." (interactive) (let* ((extension (concat "." (or (plist-get ext-plist :html-extension) org-html-extension "html"))) (file (org-export-output-file-name extension subtreep)) (org-export-coding-system org-html-coding-system)) (org-export-to-file 'html file async subtreep visible-only body-only ext-plist #'my-org-html-post-process))) (advice-add 'org-html-export-to-html :override #'my-org-html-export-to-html) On Wed, Aug 10, 2016 at 5:28 AM Christopher DeMarco wrote: > Hi all . . . I want to run a command (to sync a directory with AWS S3) > after my agenda views are exported to HTML. There used to be a > `org-export-html-final-hook` which looks like something that could be > helpful, but it doesn't appear to be available anymore. > > Is there a way to do this in current Org? > -- Kaushal Modi --001a1134fa3e0c76570539ba0ac9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
See if this helps:

(defun my-org-html-post-pro= cess (file)
=C2=A0 "Do stuff on FILE after it is created by = org html export."=C2=A0
=C2=A0 ;; Do your stuff here
=C2=A0 (message "Exported file: %s" file)
=C2=A0 fil= e) ; Has to return FILE

(defun my-org-html-export-= to-html
=C2=A0 =C2=A0 (&optional async subtreep visible-only = body-only ext-plist)
=C2=A0 "Pass `my-org-html-post-process&= #39; as POST-PROCESS arg to `org-export-to-file'.
Rest of the= code is the exact same as the original `org-html-export-to-html'."= ;
=C2=A0 (interactive)
=C2=A0 (let* ((extension (concat= "." (or (plist-get ext-plist :html-extension)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-html-extension
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "html")))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file (org-export-output-file-nam= e extension subtreep))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-exp= ort-coding-system org-html-coding-system))
=C2=A0 =C2=A0 (org-exp= ort-to-file 'html file
=C2=A0 =C2=A0 =C2=A0 async subtreep vi= sible-only body-only ext-plist #'my-org-html-post-process)))
=
(advice-add 'org-html-export-to-html :override #'my-= org-html-export-to-html)

On Wed, Aug 10, 2016 at 5:28 AM Christopher DeMarco <cdemarco@gmail.com> wrote:
Hi all . . . I want t= o run a command (to sync a directory with AWS S3) after my agenda views are= exported to HTML. There used to be a `org-export-html-final-hook` which lo= oks like something that could be helpful, but it doesn't appear to be a= vailable anymore.

Is there a way to do this in cur= rent Org?
--

Kaushal Modi

--001a1134fa3e0c76570539ba0ac9--