emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How to run a command after exporting agenda to HTML?


From: Kaushal Modi
Subject: Re: [O] How to run a command after exporting agenda to HTML?
Date: Wed, 10 Aug 2016 16:21:08 +0000

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 <address@hidden> 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


reply via email to

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