Question

I'd like to create slides for my presentation. My presentation will contain these: slide title, bullet points, code snippets (in a monospace font), some code lines highlighted as bold, Python code snippets (with syntax highlighting).

I need an application or tool which can generate such slides in HTML (or HTML5), so when I open the generated HTML in my web browser, and put the web browser to full screen mode, it will start the slideshow. I prefer writing my presentation as a .txt file with some markup, and then the tool should generate the HTML.

I know about the presentation feature Google Docs, but that doesn't support Python syntax highlighting.

I also know about LaTeX and Beamer, but that would generate PDF instead of HTML (not a big problem), and doesn't have Python syntax highlighting built in.

I'd prefer projecting my presentation using a vanilla Google Chrome or Mozilla Firefox. I don't want to install any presentation software (such as bruce) on the projecting machine.

Is there an alternative?

Was it helpful?

Solution

Try one of the following:

  1. Restructured text with S5

    http://meyerweb.com/eric/tools/s5/

    http://docutils.sourceforge.net/docs/user/slide-shows.html

    If you install docutils (snapshot is preferred), you will get rst2s5.py in the tools folder.

  2. Bruce, The Presentation Tool

    http://code.google.com/p/bruce-tpt/

  3. Pandoc: a universal document converter

    http://johnmacfarlane.net/pandoc/

  4. AsciiDoc has an option to generate generate self-contained Slidy HTML

OTHER TIPS

Just recently slippy appeared: edit your presentation as HTML, with Python (and lots of other languages) highlighting.

You should definitely take a look at landslide, this is a python app that allows to create really nice looking slides in HTML5 from markdown formatted text, and it supports syntax highlighting. To have a preview of what it can do, just take a look at the sample slideshow generated from the project's README.

html5slides is great option.

http://code.google.com/p/html5slides/

It's only a part of what you're asking for, but if you want to do syntax-highlighting of Python and conversion to HTML, then you can do this in Emacs using python-mode to do the syntax highlighting and htmlize to do the conversion to HTML.

For example, you might start with

def decode_safely(s, charset='ascii'):
    """Return s decoded according to charset, but do so safely."""
    try:
        return s.decode(charset or 'ascii', 'replace')
    except LookupError: # bogus charset
        return s.decode('ascii', 'replace')

and after passing through htmlize you get:

<pre><span class="keyword">def</span> <span class="function-name">decode_safely</span>(s, charset=<span class="string">'ascii'</span>):
    <span class="string">"""Return s decoded according to charset, but do so safely."""</span>
    <span class="keyword">try</span>:
        <span class="keyword">return</span> s.decode(charset <span class="keyword">or</span> <span class="string">'ascii'</span>, <span class="string">'replace'</span>)
    <span class="keyword">except</span> <span class="type">LookupError</span>: <span class="comment"># see job002442
</span>        <span class="keyword">return</span> s.decode(<span class="string">'ascii'</span>, <span class="string">'replace'</span>)
</pre>

You can see that each piece of syntax is marked up with a <span> that belongs to a class indicating which syntax class it belongs to: you can then use CSS to specify the colours you want. (htmlize can be configured to specify explicit colours instead — <span style="color:#b22222"> — but the class/CSS approach is more flexible.)

This can be easily automated as part of your slide-generation process, but I think that's enough for one answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top