Code2Html

I developed this software while I was creating the WKGL. I kept having to create turorials, and give presentations on it. Manually highlighting everything was tedious, so like any good programmer I spent 10 times as long writing a program to do it for me. Basically, this software creates a HTML file that displays code using syntax highlighting. To do this this program uses three files.

First there is language word file (.lang). This file represents the key strings for each basic type. The file begins with a delimiter line, it has the following format: <>\txx comment. Where \t is the tab character, xx is a two letter code, and comment is any other text on that line. The next n lines contain one string each. These strings are called words. Then there is another delimeter line with a different two letter code. The words are associated with the two letter code. For an example look at cpp.lang. Each the codes must be one of the following:

  1. sc — Single Line Comment
  2. mc — Mulit Line Comment (both the opener and the closer)
  3. st — String Delimiters
  4. op — Operators
  5. kw — Keywords
  6. s1..s9 — Standard Language Extensions (for example see java.lang)

The next important file is the user word file. This file has the same format as the language word file. It is an optional file that contains any additional words that you wish to specify a style for. The character codes are u1, u2, u3, ... u9.

Finally is the code.css file. It can be found in the lang directory. Basically the program wraps the words in span tags that have the class attribute that cooresponds to the two-letter character codes the word was found in.

Note: currently conversion from HTML is broken

©Micheal Nooner, 2004