2

I'm currently creating a programming workshop (actually it is about OOD, but that shouldn't matter to much).

I have mainly two kinds of resources:

  • slides (HTML / reveal.js)
  • sample projects (Java)

In many places code from the sample projects should appear in the presentation.

What is a good way to achieve that?

My Requirements are

  • an easy way to specify a code snippet to be used in a presentation, and the place where it should appear

  • changes in the code are reflected in the presentation automatically (running a build tool is ok, manually cutting and pasting stuff is not)

  • broken links (like trying to embed a code snippet that does not exists or marking a snippet that does not get used in the presentation should create a warning

  • Bonus points for having links between code and presentation

1 Answers1

3

Asciidoctor http://asciidoctor.org/ might solve most of your requirements:

  • use plain ASCII to write the content
  • include code snippets from real source code files
  • broken links will create a warning when building the output
  • created presentations in reveal.js and deck.js

You'll find at https://github.com/asciidoctor/asciidoctor-gradle-examples some examples how to use Asciidoctor with gradle (but other build tools work as well).

You can browse the sample output here and you'll find a presentation rendered with deck.js and reveal.js (look for the sub-chapters 3.4 and 9.4 labeled "Outputs")

Another source of inspiration might be Dan Allan's set of decks: https://github.com/mojavelinux/decks

You also asked for links from the code back to the presentation. The best Asciidoctor can provide you AFAIK is that the tag you used to mark your code snippet in the code (// tag::XXX[]) will also be present in your presentation's source (include::Class.java[tags=XXX])

ahus1
  • 145