Once again I went down a rabbit hole figuring something out, and now you -- yes, you, random person on the internet -- can benefit from my work.
I write slides for my classes in markdown and turn them into reveal.js slides. Sometimes I want to post the slides, but I want to strip out speaker notes and other non-useful bits. I could edit the output, maybe, but...ugh. Let's do this properly.
You can write filters for pandoc, but the documentation just wasn't that great.
Well, I figured it out: https://gist.github.com/dandrake/1b6deb7779b5629f75b35bfac3a2f9aa
