Add support for org-reveal to org layer

org-reveal is an extension to org mode that allows exporting of org files as
reveal.js presentations. Since not everyone needs this functionality, the
loading of the package is controlled via the `org-enable-reveal-js` switch,
which, if set to `t` would load the package.
This commit is contained in:
Nikola Knezevic 2015-09-09 13:49:43 +02:00 committed by syl20bnr
parent e9cb18f2f2
commit 678a2b7945
3 changed files with 43 additions and 0 deletions

View File

@ -11,6 +11,7 @@
- [[#layer][Layer]]
- [[#github-support][Github support]]
- [[#gnuplot-support][Gnuplot support]]
- [[#reveal.js support][reveal.js support]]
- [[#different-bullets][Different bullets]]
- [[#key-bindings][Key bindings]]
- [[#org][Org]]
@ -88,6 +89,26 @@ at this stage. It is possible to disable the configuration of gnuplot support
as usual by adding the package =gnuplot= to your =dotspacemacs-excluded-packages=
variable.
** Reveal.js support
To enable the export of your org file as a [[http://lab.hakim.se/reveal-js/][reveal.js]] presentation, set the
variable =org-enable-reveal-js= to =t=. This will install the [[https://github.com/yjwen/org-reveal/][org-reveal]] extension.
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(org :variables
org-enable-reveal-js t)))
#+END_SRC
In order to be able to use org-reveal, download =reveal.js= from its
[[http://lab.hakim.se/reveal-js/#/][homepage]] and set =org-reveal-js= to the
download path, as described in the [[https://github.com/yjwen/org-reveal#obtain-revealjs][manual]]. Alternatively, add the following line
to each =.org= file you want to process:
#+BEGIN_EXAMPLE
#+REVEAL_ROOT: http://cdn.jsdelivr.net/reveal.js/3.0.0/
#+END_EXAMPLE
** Different bullets
You can tweak the bullets displayed in the org buffer in the function
=dotspacemacs/user-config= of your dotfile by setting the variable

View File

@ -14,4 +14,7 @@
(defvar org-enable-github-support nil
"If non-nil Github related packages are configured.")
(defvar org-enable-reveal-js nil
"If non-nil, enables ox-reveal export.")
(spacemacs|defvar-company-backends org-mode)

View File

@ -31,6 +31,7 @@
org-repo-todo
(ox-gfm :location local)
persp-mode
ox-reveal
))
(defun org/post-init-company ()
@ -559,6 +560,24 @@ a Markdown buffer and use this command to convert it.
:body
(find-file (first (org-agenda-files)))))
(defun org/init-toc-org ()
(use-package toc-org
:defer t
:init
(progn
(setq toc-org-max-depth 10)
(add-hook 'org-mode-hook 'toc-org-enable))))
(defun org/init-ox-reveal ()
(use-package ox-reveal
:if org-enable-reveal-js
:defer t
:init
(progn
;; seems to be required otherwise the extension is not
;; loaded properly by org
(with-eval-after-load 'org (require 'ox-reveal)))))
(defun org/init-htmlize ()
(use-package htmlize
:defer t))