bbcode

bbcode is a command-line tool I made in C to generate the HTML content of this website. It takes as input files written in the BBCode markup, used on many web forums, and writes HTML that can be included in a HTML document, like the one you are reading.

This was mostly a fun exercise as there already exist markup tools for the same purpose, although none for BBCode that I know of.

Downloads
Source code tarball: bbcode-0.02.tar.gz

You can get the latest code from the Github repository.

Details
Unlike many other BBCode implementations, this tool does not use regular expressions, which tend to be limited in how they can interpret the structure of a text. It ensures that the written HTML is structured in a proper hierarchy even if the BBCode input is not.

As an example, to get the following:

italic text, bold and italic text, bold text.

You can write this BBCode:

[i]italic text, [b]bold and italic text[/i], bold text.[/b]

And get the following HTML output:

<em>italic text, <strong>bold and italic text</strong></em><strong>, bold text.</strong>