I wanted to automate the html export of two org-mode files using a elisp defun defined in ~/.emacs. I wrote the following code:
(defun publish-custom-orgs ()
"publish certain org files as html files"
(interactive)
(find-file "~/org/a.org")
(org-export-as-html)
(find-file "~/org/b.org")
(org-export-as-html)
)
But this does not export the files; instead, it shows a strange output in the minibuffer:

What am I doing wrong?
You can try org-export-as-html-batch
(defun publish-custom-orgs ()
"publish certain org files as html files"
(interactive)
(find-file "~/org/a.org")
(org-export-as-html-batch)
(find-file "~/org/b.org")
(org-export-as-html-batch)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With