Write Slides in Org Mode and export to Shower Presentation Engine
Isn't that amazing!
Requirements
A shower file requires to:
- Include Shower CSS and JavaScript
- A
body
tag with classshower
and onesection
with classslide
per slide - An optional initial
header
section to set the title of the slide
Approach
We are going to build a Shower HTML file by exporting an Org Mode file using the standard HTML export engine. The Org Mode file contains a bit of configuration and a bit of JavaScript, where the configuration is not expressive enough.
You can also directly view the source of this presentation or download a stripped-down template.
Body with class shower
and one section per slide
- Add
#+HTML_CONTAINER: section
to the header of your file. This ensures each heading is wrapped by a<section>
tag - Add the following JavaScript at the end of your presentation, which ensures
body
andsection
are assigned the correct classes:
<script> document.body.classList.add('shower'); document.querySelectorAll('section').forEach(function(section) { section.classList.add('slide'); }); </script>
An optional initial header
in the overview
This is achieved by exporting to HTML:
<header class="caption"> <h1>Write Slides in Org Mode and export to Shower Presentation Engine</h1> <p>Isn't that amazing!</p> </header>
... and you are all set!
Styling Tips
The following slides provide some formatting tips to translate Org Mode markup language to the markup required by Shower CSS.
Background images
Add an image and assign it the class cover
, using #+ATTR_HTML
, as in the example
below:
#+ATTR_HTML: :class cover [[https://www.thewowstyle.com/wp-content/uploads/2015/02/landscape-photography-image-free-wallpaper.jpg]]
Notice that a bit of CSS might be needed to style the text. Here, for instance, I am
using the property :HTML_CONTAINER_CLASS:
to add a class dark-background
to
the section
of this slide.
Markup for Rich Content
Org Mode markup works out of the box: bold, italic, verbatim
,
code
, strikethrough, links and lists.
Underlined text is an exception: underlined is not really underlined. If it is
important for you, add a CSS class to style .underline
text, if you want.
Structural Elements
Bulleted:
- slide 1
- slide 2
Ordered:
- slide 1
- slide 2
Tables
Despite having fewer stars, Shower is a nice framework producing good looking slides:
CSS Framework | GitHub Stars | Last Commit |
---|---|---|
Shower | 4.8K | 3 years ago |
Reveal.js | 66.5K | 2 weeks ago |
Tables (II)
You can override some of the table styles, to achieve a simpler look. Here,
for instance, I am overriding the background-image
property of the rule .slide
tr:not(:last-of-type) > *
:
CSS Framework | GitHub Stars | Last Commit |
---|---|---|
Shower | 4.8K | 3 years ago |
Reveal.js | 66.5K | 2 weeks ago |
You can have a slide with no title… simply by not setting the title of the heading!
Two columns
Two columns can be obtained by exporting a div
with two p
.
A list on the second column:
- first point
- second point
Serious Citations
Use #+begin_quote
:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia.
You can even shout!
Documentation
Documentation available here:
Conclusions
Shower produces nice slides publishable on the Web.
It is very simple to typeset the slides in Org Mode, adding a bit of JavaScript, and then use the standard HTML export facilities to produce a nice deck publishable on the web.