# Automating org-mode export with org-reveal exporter

I have an org-mode document that I am exporting to reveal.js via org-reveal. Currently, I do a (require 'ox-reveal) and then I can do C-e R R from within my org-mode document. I am wondering how I can script this so I can do this from within bash. I currently have a bash script for a related project that does uses batch mode as follows,

 emacs my-doc.org --batch -f org-html-export-to-html --kill 

I am wondering how to adapt this to org-reveal. Part of the problem is making sure (require 'ox-reveal) happens in batch mode.

Looking forward to any pointers here.

Thanks!

## 1 Answer

With external config file,

emacs --batch --no-init-file --load config.el --find-file to-export.org --funcall org-export-function


Or without your "normal" init.el,

emacs --batch --eval "(require 'ox-backend)" --find-file to-export.org --funcall org-export-function

• Thank you rasmus. I really appreciate your answer. One final point of confusion, for the org-reveal exporter, I currently use 'C-c e R R` to call the exporter. There must be a function I can call that does the export directly, but I am not sure what it is. Do you happen to know? – stevejb Aug 3 '16 at 13:48
• I think it is org-reveal-export-to-html, as seen in the bottom of github.com/yjwen/org-reveal/blob/master/ox-reveal.el – stevejb Aug 3 '16 at 13:51