Couldn’t get it to run because of some problems building the dependencies (for which I do not fault the author at all, mind you, given that it’s a total hack).
However, it seems like much more work to build this than it is to just write those text files in a normal editor and export code to html. Here’s how to do it in vim:
:TOhtml
To be fair, that method is flawed because it just creates a single HTML file, which is not the same as a slideshow.
Another alternative is to export code to RTF and just paste that in Keynote or Powerpoint or Impress. You can do this using highlight[0]. Here’s an example that works on a mac, (change pbcopy to xclip if you’re on linux; also note that you can easily do this on a text selection from inside of vim):
cat codes.scala | highlight -S scala -O rtf -k Menlo -K 20 | pbcopy
If that’s still too much, check out pandoc[1], which can convert a markdown file into a Slidy slideshow[2] (or S5, or some others, though I prefer the minimalist style of Slidy).
pandoc -t slidy -s slideshow.md -o slideshow.html
One issue with this is that you just get very basic code formatting. No problem, just add highlight.js[3] to the generated html file. It supports 52 languages out of the box, will guess the language in the <code> block, and will highlight them automatically (yes, you can specify the language if necessary).
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.2/styles/default.min.css">
<script src="http://yandex.st/highlightjs/7.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
[0] http://www.andre-simon.de/doku/highlight/en/highlight.html
[1] http://johnmacfarlane.net/pandoc/README.html#producing-slide-shows-with-pandoc
In principle the script is portable. The very first commit shelled out to run stty, but now the terminal is configured by the standard Ruby (1.9) library io/console.
This is a total hack. It is procedural, uses a global variable, it has not been parametrized or generalized in any way. It was tailor-made for what I exactly wanted but some people in the audience asked for the script. Even if it is quick and dirty I am very happy to share it so I have commented the source code and there you go!
I don’t see anything super OSX specific, but what I mean is that it might be, since that’s what computer fxn was using.
I was partly wondering because if it was then a tag of “osx” would be handy. Anyways, i’d have look at this more closely to see if it’s usable in some form on ubuntu bash in gnome-terminal.
This is very similar to
pandoc’s approach. See http://johnmacfarlane.net/pandoc/demos.html and the source file that can be converted into a slideshow: http://johnmacfarlane.net/pandoc/demo/SLIDES.Also similar to Terminal Keynote https://github.com/fxn/tkn (disclaimer, it is mine :).
FYI, I had to switch to CodeRay, because pygments doesn’t work on Mac OS X standard ruby implementation.
gem install pygmentizeHad I known about that I might have originally used it. Somehow it didn’t come up first in searches. CodeRay isn’t causing any issues right now, my biggest issue is io-console not working on 1.8.
If coderay stops being a solution I’ll probably switch to that. Thanks.
Interesting that they split it by header. I wouldn’t have thought of that.