# txt2tags

### History

## txt2tags History

On July 2001, it was launched the first public release of txt2tags, version 0.1. But its origins date more than a year before that...

This article gives an overview about the tool development since its very first draw.

## 1999 January: Pre-History

My really first attempts of a text conversion tool began back in 1999, as a very simple and limited Bourne Shell script that converts marked text to an HTML page.

> Yes, Yet-Another txt2html tool. Everyone, everywhere must have done one of this already...

In short, it just recognized simple marks such as `*bold*`, `/italic/`, `_under_`, and escape the classic `< & >` HTML special characters. Not impressive, but hey! I was young ;)

## 1999 June: Still Pre-History

Some months passed, and a big Sgml hype arrived at the company I was working (Conectiva). So the txt2html turned into a txt2sgml script.

I was really trying to learn about SED* at that moment so txt2sgml was a 110 lines Bourne Shell script with lots of SED code.

> Note: SED is the UNIX Stream EDitor, an automatic text editing tool.

This improved Sgml version has more supported structures as lists and verbatim text. On the following sample file, you can see the txt2tags marks origins:

    * This was a bold line (BOLD line oriented? Well...)

      --
    - bullet list was very similar to txt2tags list
    - but with these -- to begin and close a list
      --

    =----------------------
    Verbatim text was delimited by the =-- pattern.
    The other ------- were just cosmetic.
    =----------------------

Still not impressive, but the big step is coming...

## 2000 August: Not Pre-History Anymore

A year passed and at that time I was really in love with SED. The txt2sgml.sh shell script was rewritten and became a 350 lines pure SED script.

Some exciting features were added such as subsections, URL recognition and sublists. I have used and improved this script a lot, for almost a year.

A txt2sgml.sed sample file:

    * Hey, here are the first 3 magic lines
    * The document title / author / date
    * But they required those asterisks at the beginning

    MAIN TITLE

    Titles were made by uppercase-only lines. Subtitles were identified by
    leading spaces. Each space denoted a new sublevel. The beautifiers:
    *bold*, **strong**, "italic" and `typewriter`.

    - lists
      + sublists
        = and subsublists (by identifier, not indentation)

    Two blank lines to close lists. Links as www.example.com and e-mails
    were recognized automagically by regular expressions. And there was a
    strange image mark:
    %%image: path/to/image.jpg

## 2001 May: Pythonization and Multi-target Idea

I've started to write my Regular Expression book and used the txt2sgml.sed marked text format. This way I could convert it to sgml (then to HTML using sgml2html tool) and quickly check on the browser how the book was going.

As 'quick' and 'sgml2html' don't match, I've modified the SED script to a txt2html.sed tool, generating HTML directly.

The publisher used Adobe PageMaker software to format books and it was a problem for a Linux guy like me. But I was happy to know that PageMaker had a tagged HTML-like language, so I've started to turn my script into a txt2pagemaker.sed tool.

I've ended up with three similar SED scripts, converting my texts to sgml, HTML and PageMaker. And some other Shell scripts were made to extract the book TOC (Table Of Contents) and do post formatting.

At the middle of the book writing, I had the idea to join it all in a single tool, and choose Python as the language. TXT2TAGS was born.

## 2001 July: 0.x series: Debut of txt2tags (World Release)

The release of the printed book (July, 31) and the release of the very first txt2tags 0.1 version (July, 26) were very close, a matter of days. One depended on the other, they were developed together.

Besides sgml, HTML and PageMaker, other targets were implemented for this release: MoinMoin, MagicPoint and plain text.

For more than a year, more releases of the 0.x series were made and the program began to grow: new target UNIX Man Page, %%date macro, table support, Web interface, smart image alignment and Table Of Contents generation.

On version 0.2 a Shell script wrapper was added to handle file operation and command line options. I've made it because I was a shell wizard and a Python newbie. Only in version 0.9 txt2tags came back to a 100% Python code.

## 2002 September: 1.x series: Growing

The txt2tags idea has proved to be good. I've decided to get serious on it.

The next step was to spread the program out, to tell the world about it: documentation! The program site was launched, mailing lists (english and portuguese) were configured and the User Guide has born.

The user base grew and many contributions came. Yes, I thought, it is working.

The new features added on the 1.x series include: Graphical interface (GUI), Windows & Mac compatibility, LaTeX target, %!style, include command and the powerful Pre and Post processing filters.

## 2004 July: 2.x series: Maturing

Growing is hard and strange. Remember I said I was a Python newbie? Now I got better, but the old mistakes accumulated, and a major code rewrite was unavoidable.

This broke backwards compatibility with some marks, and an upgrade script was created. It took a long time, but version 2.0 was released. It came with tons of news such as XHTML target, W3C validated code, i18n, and RC file.

A team of translators has came and the program and its documentation were translated to many languages.

The Lout target was added, and new macros: %%mtime, %%infile, %%outfile, and %%toc.