2

I have the following folder structure:

  • ~/org/notes/x.org with notes in org files
  • ~/org/presentations/y.org with reveal.js presentations in org files
  • ~/org/img/demo.png with static images used in notes and presentations

I now want to publish all of them to ~/public_html/. My spacemacs config contains the following configuration, which does not work:

(setq org-publish-project-alist
    '(
      ("org-presentations"
       :base-directory "~/org/presentations"
       :base-extension "org"
       :publishing-directory "~/public_html/presentations"
       :recursive t
       :auto-sitemap t
       :publishing-function org-reveal-export-to-html
       :with-sub-superscript nil
       :headline-levels 4             ; Just the default for this project.
       :auto-preamble t)

      ("org-notes"
       :base-directory "~/org/notes"
       :base-extension "org"
       :publishing-directory "~/public_html/notes"
       :recursive t
       :auto-sitemap t
       :publishing-function org-twbs-publish-to-html
       ;;:publishing-function org-publish
       :with-sub-superscript nil
       :headline-levels 4             ; Just the default for this project.
       :auto-preamble t)

      ("org-static"
       :base-directory "~/org/img/"
       :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
       :publishing-directory "~/public_html/img/"
       :recursive t
       :publishing-function org-publish-attachment)

      ("org" :components ("org-notes" "org-presentations" "org-static"))))

The presentations don't get published. Any idea for the correct publishing-function for reveal.js presentations?

1

I am thinking about the same thing. I think the issue is that org-reveal-export-to-html is not a defined publishing function. There is a nice solution provided by Matt Price and it works on my system as well. Here it is: Define a publishing function that connects reveal to org-publish.

(defun mwp-org-reveal-publish-to-html (plist filename pub-dir)
  "Publish an org file to reveal.js HTML Presentation.
FILENAME is the filename of the Org file to be published.  PLIST
is the property list for the given project.  PUB-DIR is the
publishing directory. Returns output file name."
  (let ( (org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/                         )
         (org-reveal-extra-css "css/theme/pikestreet.css"))

    (org-publish-org-to 'reveal filename ".html" plist pub-dir))
  )

After you define this function, you can use

("reveal"
       :base-directory "your directory"
       :base-extension "org"
       :publishing-directory " your directory"
       :publishing-function mwp-org-reveal-publish-to-html
       :section-numbers nil
       :recursive t
       :with-toc t
       )

It works like a magic! Credit goes to: https://matt.hackinghistory.ca/2015/07/11/creating-and-publishing-presentations-with-org-reveal/

  • 2
    Please summarize the solution you link to. This answer risks being deleted, because it is currently a link-only answer. – Drew Dec 12 '17 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.