org-reveal
org-reveal copied to clipboard
Using plugins seems broken with current reveal.js
If I set #+REVEAL_PLUGINS: (notes highlight)
, this results in these lines being added to the Reveal.initialize()
call:
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'http://localhost:8000/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'http://localhost:8000/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }]
I can't see any other effect. The plugins do not seem to be loaded in my presentation.
However, the reveal.js Docs specify that to use these two plugins, this code must be added:
<script src="plugin/highlight/highlight.js"></script>
<script src="plugin/notes/notes.js"></script>
<script>
Reveal.initialize({
plugins: [ RevealHighlight, RevealNotes ]
});
</script>
I got these two plugins working in my presentation with the changes from PR #473 and these three option lines:
#+REVEAL_EXTRA_SCRIPT_SRC: plugin/notes/notes.js
#+REVEAL_EXTRA_SCRIPT_SRC: plugin/highlight/highlight.js
#+REVEAL_INIT_OPTIONS: plugins:[RevealNotes, RevealHighlight]
However, #+REVEAL_PLUGINS
seems non-functional at the moment.
With the updated PR #473, plugin loading can now be achieved with:
#+REVEAL_EXTRA_SCRIPT_BEFORE_SRC: plugin/notes/notes.js
#+REVEAL_EXTRA_SCRIPT_BEFORE_SRC: plugin/highlight/highlight.js
#+REVEAL_INIT_OPTIONS: plugins:[RevealNotes, RevealHighlight]
But org-reveal has been updated to keep up with the new plugin codes.
The plugin code
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'http://localhost:8000/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'http://localhost:8000/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }]
is for reveal.js 3.x.
It is mostly possible that org-reveal failed to detect the reveal.js version. Please try to set it explicitly by
#+REVEAL_REVEAL_JS_VERSION: 4
@yjwen The hightlight.js css file is broken i think . You have
(defcustom org-reveal-highlight-css "%r/lib/css/zenburn.css" "Highlight.js CSS file." :group 'org-export-reveal :type 'string)
Which wont work with current Reveal version as the css is inside "%r/plugin/highlight/zenburn.css"