Question

Situation

I'm building an org-reveal presentation (.org file exported to a HTML5 presentation using reveal.js). But I want to be able to handle this presentation using a script. In order to embed a script, I need to be able to insert custom HTML elements the exported source code. But I don't want a preamble/postamble defined in ~/.emacs globally for all my presentations - I want to define that custom elements locally in the .org file of my presentation

Question

How can I insert custom HTML elements to the exported source code that way?

Thanks for your answers - if anything's unclear, please leave a comment.

Was it helpful?

Solution

The Org-reveal is just updated, now you can define preamble/postamble locally by setting options "#+REVEAL_PREAMBLE:" and "#+REVEAL_POSTAMBLE:".

The preamble/postamble contents can be also defined by Emacs-Lisp Functions. For a detail instruction, please refer to the Org-reveal's Readme.org

OTHER TIPS

You can customize the variable org-publish-project-alist, see Org manual. An example

(setq org-publish-project-alist
      '(("site-content"
     :base-directory "/path/to/base-directory"
     :publishing-directory "/path/to/publishing-directory"
     :publishing-function org-publish-org-to-html
     :author "Me"
     :link-home "index.html"
     :html-preamble (concat "INSERT HTML CODE HERE FOR PREAMBLE")
     :html-postamble (concat "INSERT HTML CODE HERE FOR POSTAMBLE"))
    ("site" :components ("site-content"))))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top