I implemented something like this in Python for my LaTeX/beamer presentation recently. For example, see this and the following slides:<p><a href="https://speakerdeck.com/mmcloughlin/better-x86-assembly-generation-with-go?slide=56" rel="nofollow">https://speakerdeck.com/mmcloughlin/better-x86-assembly-gene...</a><p>The sample code is in a file with special comments at the end of each line specifying which slide numbers it should be revealed on as well as inline commentary to show to the right of the line. Syntax highlighting is provided by Pygments.<p>I was thinking about open sourcing it, it's actually only approx 200 lines of Python but I think it's quite effective.
Way too few presentation tools support code in any meaningful way. Try getting coloured code into Google Slides or PowerPoint is extremely difficult.<p>Nice to see somebody is actually focusing on this!
How easy (or not) would it be to embed one of these in a markdown file (e.g., README.md)? Seems to me that might be a significantly better way to do code examples for a given repo.