In addition to a standard Python installation, Pylize depends on HTMLgen, a Python package used to generate HTML; Empy, one of the templating packages available for Python; and, optionally, the Python Imaging Library. The Python Imaging Library and HTMLgen have been packaged for a number of distributions (for example, there are Ubuntu and Fedora packages available). Empy comes with a standard
setup.py which you can use to install the package with the
python setup.py install command. To install Pylize itself, run the
install.py Python script that comes with the distribution (after you've installed the prerequisites).
Once you've installed Pylize, you can start building a presentation by running the
pylize create command in an empty directory to create the file all.html, which you edit to create your presentation. When you edit this file, you will see a set of
<meta> tags. Review these and edit them to your satisfaction. For example, the
<meta> tag with a "name" attribute of "author" should have its "content" attribute set to your name:
<meta name="author" content="Keith Fieldhouse">
While you're editing this file, remove the line after the
<body> tag that reads:
<!-- Example: to process example remove comment markers here and at the end
You should also remove the line near the end of the file that reads:
Example ends here //-->
Save the file and execute the command
pylize in your presentation directory. This will create an index.html and a series of slide_nn.html files. Open index.html in a browser and click on the Start Presentation link to display the sample presentation's table of contents. Now you can begin editing the all.html file to create the slides for your presentation.
Each slide begins with a
<h1> tag. The contents of the tag will be your slide's title. An optional following
<h2> tag provides a subtitle. The body of the slide can be virtually any valid HTML. For example, to create a typical bullet-point slide, use the unordered list (<UL>) and list item (<LI>) tags. Bear in mind that you have the full expressive capability of HTML available to you. Image and table tags provide different ways to present information. You can even embed Flash and other dynamic content. Pylize controls the headers and footers of your slides, but the body is available for whatever purposes you require.
If you add a "delayed" class attribute to an HTML element, that element will not be displayed when the slide first appears, but rather will appear when you press the space bar. If there are multiple elements with a class of "delayed," each will be revealed in turn, after which the next space will advance to the next slide. This allows you to easily construct a bulleted list where each item is revealed one at a time:
<li>This is the first bullet. It appears immediately when the slide is shown.</li>
<li class="delayed">This is the second bullet. It appears when you press the space bar.</li>
<li class=delayed>This is the last bullet. After this, the next slide will be displayed.</li>
A number of other CSS classes in the default installation are helpful when you're building presentations. If you enclose some content in a
<pre> tag with a class attribute of "code" (e.g.
<pre class="code>), the content will be displayed as you write it in a monospaced font (ideal for code examples). Using "fancy" as a class attribute for a
<UL> tag will result in the list items having a push pin graphic as their "bullet."
<TABLE> tags with a "fancytable" class attribute will be formatted with nice borders and a white background.
Even with this collection of CSS features, it's possible that you'll want to add features of your own. This is easy to do. Find the Pylize "share" directory (on Linux systems it's likely /usr/share/pylize), and copy the Empy templating syntax file
mine.tmpl. You can adjust this file in a number of ways to change the way Pylize constructs your slides. For instance, to change the default CSS stylesheet, search for default.css and change it to mine.css. Then go to the "css" sub-directory of the "share" directory and copy default.css to mine.css to create the file you should edit to suit your needs.
To use your new template and new stylesheet, use the
-t argument to the
pylize -t mine. This will cause Pylize to use your new template, and as a result, reference your new stylesheet. The command copies the entire contents of the "css" directory, and thus it will be available in your presentation directory.
Once you're satisfied with your presentation, you need to deliver it. Your presentation's working directory is self-contained and has no external dependencies. You can use it where it is or move it to some other convenient location. One useful technique is to simply upload the presentation to a Web server, thus making it available to any Internet-connected computer. Open the file index.html and use your browser's full-screen mode for your presentation.
With a little bit of HTML knowledge and Pylize you can quickly build professional presentations.