emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to run a command after exporting agenda to HTML?
@ 2016-08-10  9:27 Christopher DeMarco
  2016-08-10 16:21 ` Kaushal Modi
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher DeMarco @ 2016-08-10  9:27 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

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?

--cmd

Christopher DeMarco <cdemarco@gmail.com>
+1-775-KETCHUP

[-- Attachment #2: Type: text/html, Size: 697 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to run a command after exporting agenda to HTML?
  2016-08-10  9:27 How to run a command after exporting agenda to HTML? Christopher DeMarco
@ 2016-08-10 16:21 ` Kaushal Modi
  0 siblings, 0 replies; 2+ messages in thread
From: Kaushal Modi @ 2016-08-10 16:21 UTC (permalink / raw)
  To: Christopher DeMarco, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

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 <cdemarco@gmail.com>
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

[-- Attachment #2: Type: text/html, Size: 2163 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-10 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10  9:27 How to run a command after exporting agenda to HTML? Christopher DeMarco
2016-08-10 16:21 ` Kaushal Modi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).