Small Frawkenstein to convert presentations written for Deckset to be compatible with conversion via pandoc and reveal.js to HTML.
Note that this is customised for how I write my slides and the theme I use. Caveat emptor.
An example:
- Looks similar enough (I use the Inter font family instead of Ostrich Sans)
- I didn't want to fight with CSS a lot, so, fixed sizes where needed (so, it will look like crap on phones)
- It just works good enough to convert at least the presentation above, haven't tried with any others yet
- Expects some whitespace exatly where I put it in my markdown, and some is actually
needed by
pandoc
¯\_(ツ)_/¯
- I don't recommend you use this, to be fair
It's just an ad-hoc parser for markdown, using full slides as "tokens". Since
getting the DOM/CSS to play along can be tricky, there are some parts of the
slide that need rewriting before being passed to pandoc
. This makes the code
slightly convoluted.
The workflow is that the AWK parser converts markdown files with extension .md
into reprocessed files with extension .md_2
, then pandoc
uses these to
create an HTML page. The intermediate .md_2
files are kept, and are human
readable, just some rehashing of the original presentation (useful to find
places where the parser is doing something pandoc
doesn't like)
You can use make verbose
to see the rules applied in the parsing/building, and
there is a set of example presentations (with image splits, images, floats, text
formatting) to see what is being done. You will need to serve them somehow
(make serve
will start a Python 3 folder server, but you need Python 3 for
that)
Clone or download, add your markdown file to the folder where the .awk
and
makefile
files are and run make
. You will need gawk
for this, since I use
two exclusive features (includes and deleting arrays).
The current settings will use reveal.js
from the web. If you want a fully
standalone version, you need to download reveal.js
to a folder called
reveal.js
(this is the default when you unzip their releases) and run make local
.
-
I love using Deckset, but I miss having a shareable version where animated gifs play. Fixed.
-
I have always felt AWK is underrated as a language. It is quick to write, readable and gets the job done pretty nicely. This is obviously not the cleanest AWK I have ever written, but it got the job done pretty fast. And if you are asking tests? I'm working on that.