#Slippery
Marries the flexible Kramdown parser for Markdown with the flexibility of DOM manipulation with Hexp to generate HTML slides backed by either Reveal.js or Impress.js.
Because Slippery slides are the best slides.
Create a markdown file, say presentation.md
, that will be the source of your presentation. use ---
to separate slides.
In the same directory, create a Rakefile, here's a basic example :
task :build_presentation do
doc = Slippery::Document.new(File.read('presentation.md'))
presentation = Slippery::Presentation.new(doc, type: :reveal_js)
File.write('presentation.html', presentation.to_html)
end
The presentation object responds to the Hexp DSL, so you can manipulate it before writing it out. In fact, Slippery contains several "processor objects" for common tasks.
These are defined in the Slippery::Processors
namespace.
The "Dot" language is a DSL (domain specific language) for describing graphs. Using the GraphvizDot
processor, you can turn "dot" fragments into inline SVG graphics.
In your presentation :
````dot
graph dependencies {
node[shape=circle color=blue]
edge[color=black penwidth=3]
slippery[fontcolor=red];
slippery -> hexp -> equalizer;
slippery -> kramdown;
hexp -> ice_nine;
}
````
In the Rakefile
task :build_presentation do
include Slippery::Processors
doc = Slippery::Document.new(File.read('presentation.md'))
presentation = Slippery::Presentation.new(doc, type: :reveal_js)
.process(GraphvizDot)
File.write('presentation.html', presentation.to_html)
end
And the result:
<title>dependencies</title> <title>slippery</title> slippery <title>hexp</title> hexp <title>slippery->hexp</title> <title>kramdown</title> kramdown <title>slippery->kramdown</title> <title>equalizer</title> equalizer <title>hexp->equalizer</title> <title>ice_nine</title> ice_nine <title>hexp->ice_nine</title>