PyInfo - Easy Latex to HTML

07/02/09

Introduction

Having written documentation for various projects professionally, I needed a system that was good for generating documenation in HTML format, which was good for writing high level documentation as opposed to comments and API documentation. However, I found writing HTML extremely boring and required a lot of boiler plate code.

Having already used a system like Latex, I decided to write a simple converter from Latex to HTML with the goal of maximizing readability for a reader and making it easy for the author to write clear structured documents without involving himself in too much of the HTML and formatting issues. And thus, PyInfo was born.

PyInfo is a program which takes as input a simple subset of the Latex text processing system and generates a html page, styled by a user specified css theme. It only supports some simply latex commands, however, it also supports arbitrary inline html support, meaning complete control of the output, when necessary.

This document was generated using the PyInfo system and you can download the source for this document here

Supported Latex Directives

The PyInfo system supports the following latex directives

and adds an extra directive \style{cssfilename}.

The directives

The article directive takes exactly one argument, the title of the article, which also becomes the heading and the title of the generated HTML page. The section directive, again takes the name of the section as the argument, and generates section titles in a smaller heading size.

It assumes that any sequence of lines are part of the same paragraph and puts them inside a set of HTML <p> tags. An empty line is used for indicating paragraph breaks.

Software

The PyInfo system, along with the default style file can be downloaded here.

A note of caution

This is a system which satisfies most of my needs, however, it is still work in progress and may need additions to make it better. Contributions are always welcome.